![]() |
CANopenNode
CANopen protocol stack
|
Calculation of CRC 16 CCITT polynomial. More...
Collaboration diagram for CRC 16 CCITT:Files | |
| file | crc16-ccitt.h |
| Calculation of CRC 16 CCITT polynomial. | |
Functions | |
| void | crc16_ccitt_single (uint16_t *crc, const uint8_t chr) |
| Update crc16_ccitt variable with one data byte. | |
| uint16_t | crc16_ccitt (const uint8_t block[], size_t blockLength, uint16_t crc) |
| Calculate CRC sum on block of data. | |
Calculation of CRC 16 CCITT polynomial.
Equation:
x^16 + x^12 + x^5 + 1
Update crc16_ccitt variable with one data byte.
This function updates crc variable for one data byte using crc16 ccitt algorithm.
| [in,out] | crc | Externally defined variable for CRC checksum. Before start of new CRC calculation, variable must be initialized (zero for xmodem). |
| chr | One byte of data |
Calculate CRC sum on block of data.
| block | Pointer to block of data. |
| blockLength | Length of data in bytes; |
| crc | Initial value (zero for xmodem). If block is split into multiple segments, previous CRC is used as initial. |