Skip to content

File syn_crc.c

FileList > src > syntropic > util > syn_crc.c

Go to the source code of this file

CRC calculation implementations.

  • #include "syn_crc.h"

Public Static Attributes

Type Name
const uint16_t crc16_ccitt_table = /* multi line expression */
CRC-16 CCITT lookup table.
const uint16_t crc16_modbus_table = /* multi line expression */
CRC-16 Modbus lookup table.
const uint32_t crc32_table
CRC-32 lookup table.
const uint8_t crc8_table = /* multi line expression */
CRC-8 lookup table.

Public Functions

Type Name
uint16_t syn_crc16_ccitt_update (uint16_t crc, const void * data, size_t len)
Update CRC-16 CCITT with a block of data.
uint16_t syn_crc16_modbus_update (uint16_t crc, const void * data, size_t len)
Update CRC-16 Modbus with a block of data.
uint32_t syn_crc32_update (uint32_t crc, const void * data, size_t len)
Update CRC-32 with a block of data.
uint8_t syn_crc8_update (uint8_t crc, const void * data, size_t len)
Update CRC-8 with a block of data.

Public Static Attributes Documentation

variable crc16_ccitt_table

CRC-16 CCITT lookup table.

const uint16_t crc16_ccitt_table[256];


variable crc16_modbus_table

CRC-16 Modbus lookup table.

const uint16_t crc16_modbus_table[256];


variable crc32_table

CRC-32 lookup table.

const uint32_t crc32_table[256];


variable crc8_table

CRC-8 lookup table.

const uint8_t crc8_table[256];


Public Functions Documentation

function syn_crc16_ccitt_update

Update CRC-16 CCITT with a block of data.

uint16_t syn_crc16_ccitt_update (
    uint16_t crc,
    const void * data,
    size_t len
) 

Parameters:

  • crc Running CRC value (start with SYN_CRC16_CCITT_INIT).
  • data Data buffer.
  • len Length in bytes.

Returns:

Updated CRC-16.


function syn_crc16_modbus_update

Update CRC-16 Modbus with a block of data.

uint16_t syn_crc16_modbus_update (
    uint16_t crc,
    const void * data,
    size_t len
) 

Parameters:

  • crc Running CRC value (start with SYN_CRC16_MODBUS_INIT).
  • data Data buffer.
  • len Length in bytes.

Returns:

Updated CRC-16.


function syn_crc32_update

Update CRC-32 with a block of data.

uint32_t syn_crc32_update (
    uint32_t crc,
    const void * data,
    size_t len
) 

Parameters:

  • crc Running CRC value (start with SYN_CRC32_INIT).
  • data Data buffer.
  • len Length in bytes.

Returns:

Updated CRC-32 (call syn_crc32_final to finalize).


function syn_crc8_update

Update CRC-8 with a block of data.

uint8_t syn_crc8_update (
    uint8_t crc,
    const void * data,
    size_t len
) 

Parameters:

  • crc Running CRC value (start with SYN_CRC8_INIT).
  • data Data buffer.
  • len Length in bytes.

Returns:

Updated CRC-8.



The documentation for this class was generated from the following file src/syntropic/util/syn_crc.c