no-OS
crc16.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef __CRC16_H
40 #define __CRC16_H
41 
42 #include <stdint.h>
43 #include <stddef.h>
44 
45 #define CRC16_TABLE_SIZE 256
46 
47 #define DECLARE_CRC16_TABLE(_table) \
48  static uint16_t _table[CRC16_TABLE_SIZE]
49 
50 void crc16_populate_msb(uint16_t * table, const uint16_t polynomial);
51 uint16_t crc16(const uint16_t * table, const uint8_t *pdata, size_t nbytes,
52  uint16_t crc);
53 
54 #endif // __CRC16_H
crc16
uint16_t crc16(const uint16_t *table, const uint8_t *pdata, size_t nbytes, uint16_t crc)
crc16_populate_msb
void crc16_populate_msb(uint16_t *table, const uint16_t polynomial)