utils
utilities in C for microcontrollers
crc16.h
Go to the documentation of this file.
1 
7 #ifndef CRC16_H
8 #define CRC16_H
9 
10 #include <stddef.h>
11 #include <stdint.h>
12 
16 #define CRC16_INIT (0xffff)
17 
23 #define CRC16_FINALIZE(val) (val ^ 0xffff)
24 
32 int crc16(uint16_t *crc, const uint8_t *data, size_t size);
33 
34 #endif /* CRC16_H_ */
35 
int crc16(uint16_t *crc, const uint8_t *data, size_t size)
computes the crc for data and uses crc for the result
Definition: crc16.c:23