35#ifndef PROTOCORE_CRC_H
36#define PROTOCORE_CRC_H
93 void (*
const begin)(uint8_t *work);
94 void (*
const update)(uint8_t *work);
95 void (*
const final)(uint8_t *work);
96 void (*
const compute)(uint8_t *work);
110static const CrcNs Crc __attribute__((unused)) = {
const protocore_crc_params PROTOCORE_CRC8_SMBUS
CRC-8/SMBUS (a.k.a. CRC-8). check = 0xF4.
const protocore_crc_params PROTOCORE_CRC32_ISO_HDLC
CRC-32/ISO-HDLC (zlib / PKZIP / Ethernet). check = 0xCBF43926.
CrcVars CrcV
The operands and the outcome.
const protocore_crc_params PROTOCORE_CRC8_NRSC5
CRC-8/NRSC-5 - the sensor CRC. check = 0xF7. Used by services/sht3x.
const protocore_crc_params PROTOCORE_CRC32_BZIP2
CRC-32/BZIP2 (unreflected CRC-32). check = 0xFC891918.
void protocore_crc_final(uint8_t *work)
void protocore_crc_compute(uint8_t *work)
const protocore_crc_params PROTOCORE_CRC16_IBM_3740
CRC-16/IBM-3740 (often called CCITT-FALSE). check = 0x29B1.
const protocore_crc_params PROTOCORE_CRC16_XMODEM
CRC-16/XMODEM. check = 0x31C3.
const protocore_crc_params PROTOCORE_CRC16_X25
CRC-16/X-25 (HDLC FCS). check = 0x906E. Used by services/radio/thread, mbplus, nema_ts2.
const protocore_crc_params PROTOCORE_CRC8_MAXIM_DOW
CRC-8/MAXIM-DOW (1-Wire / Dallas). check = 0xA1.
const protocore_crc_params PROTOCORE_CRC16_DNP
CRC-16/DNP (DNP3 link-layer block check). check = 0xEA82. Used by services/dnp3.
const protocore_crc_params PROTOCORE_CRC24_OPENPGP
CRC-24/OPENPGP. check = 0x21CF02.
const protocore_crc_params PROTOCORE_CRC16_ARC
CRC-16/ARC (a.k.a. CRC-16, IBM). check = 0xBB3D.
void protocore_crc_update(uint8_t *work)
void protocore_crc_begin(uint8_t *work)
const protocore_crc_params PROTOCORE_CRC16_KERMIT
CRC-16/KERMIT (a.k.a. CRC-16/CCITT, reflected). check = 0x2189.
const protocore_crc_params PROTOCORE_CRC16_MODBUS
CRC-16/MODBUS. check = 0x4B37.
What one CRC step runs over: the definition, the running register, and the octets.
const uint8_t * data
the octets a fold takes
uint32_t crc
the running register a fold or a finish carries in
const protocore_crc_params * params
the CRC's full definition
void(*const begin)(uint8_t *work)
One CRC's full definition (Rocksoft model). See the file comment.
uint32_t init
initial register value.
uint8_t width
register width in bits, 8..32.
proto_bool refout
reflect the final register before the XOR.
uint32_t xorout
XORed into the final register.
proto_bool refin
reflect each input octet before feeding it in.
uint32_t poly
generator polynomial, normal form (implicit top bit dropped).
_Bool proto_bool
The truth value.