crc16 1.0
CRC calcualtion library
Loading...
Searching...
No Matches
crc16.h
Go to the documentation of this file.
1
20
21#ifndef CRC16_H_
22#define CRC16_H_
23
24 #ifndef CRC16_INITIAL_VALUE
35 #define CRC16_INITIAL_VALUE 0x0000
36 #endif
37
38 #ifndef CRC16_POLYNOM
50 #define CRC16_POLYNOM 0x8005
51 #endif
52
53 void crc16_init(unsigned int value);
54 void crc16_update(unsigned char data);
55 void crc16_calculate(unsigned char initial, unsigned char *data, unsigned char length);
56 unsigned int crc16_result(void);
57 void crc16_result_array(unsigned char *crc);
58
59#endif /* CRC16_H_ */
void crc16_init(unsigned int value)
Initializes the CRC16 calculation with a specified starting value.
Definition crc16.c:35
void crc16_update(unsigned char data)
Updates the CRC16 value with a single data byte.
Definition crc16.c:53
void crc16_result_array(unsigned char *crc)
Stores the CRC16 result as a two-byte array.
Definition crc16.c:124
void crc16_calculate(unsigned char initial, unsigned char *data, unsigned char length)
Calculates a complete CRC16 checksum over a data buffer.
Definition crc16.c:87
unsigned int crc16_result(void)
Returns the current CRC16 result.
Definition crc16.c:108