WISP ERT (Client)  1.0.0
The WISP Extended Runtime (WISP side)
crc16.h
Go to the documentation of this file.
1 
9 #ifndef CRC16_H_
10 #define CRC16_H_
11 
12 // DEFINES
13 #define ZERO_BIT_CRC (0x1020) /* state of the CRC16 calculation after running a '0' */
14 #define ONE_BIT_CRC (0x0001) /* state of the CRC16 calculation after running a '1' */
15 #define CRC_NO_PRELOAD (0x0000) /* don't preload it, start with 0! */
16 #define CCITT_POLY (0x1021)
17 
18 #ifndef __ASSEMBLER__
19 #include <stdint.h> /* use xintx_t good var defs (e.g. uint8_t) */
20 
21 // CRC calculation
22 extern uint16_t crc16_ccitt (uint16_t preload,uint8_t *dataPtr, uint16_t numBytes);
23 extern uint16_t crc16Bits_ccitt (uint16_t preload,uint8_t *dataPtr, uint16_t numBytes,uint16_t numBits);
24 
25 #endif /* __ASSEMBLER__ */
26 
27 #endif /* CRC16_H_ */
uint16_t crc16_ccitt(uint16_t preload, uint8_t *dataPtr, uint16_t numBytes)
uint16_t crc16Bits_ccitt(uint16_t preload, uint8_t *dataPtr, uint16_t numBytes, uint16_t numBits)