bglibs: crc16_xmodem.h Source File

bglibs

crc16_xmodem.h
1 #ifndef CRC16__XMODEM__H__
2 #define CRC16__XMODEM__H__
3
4 #include "uint16.h"
5
6 #define CRC16_XMODEM_POLY ((uint16)0x8408)
7 #define CRC16_XMODEM_INIT ((uint16)0x0000)
8 #define CRC16_XMODEM_POST ((uint16)0x0000)
9
10 extern const uint16 crc16_xmodem_table[256];
11 #define crc16_xmodem_update(C,D,L) gcrc16rfl((C),(D),(L),crc16_xmodem_table)
12 #define crc16_xmodem_block(B,L) crc16_xmodem_update(0,(B),(L))
13
14 #endif