Cyclic Redundancy Check#
Functions that provide access to cyclic redundancy code (CRC) calculation.
See crc.h for source code.
Functions#
Calculates 16-bit cyclic redundancy code (CITT CRC 16).
Calculates 32-bit cyclic redundancy code.
Macros#
initial crc
crc32 start
For CRC32 POLYNOMIAL run LSB-MSB.
Function Documentation#
halCommonCrc16#
uint16_t halCommonCrc16 (uint8_t newByte, uint16_t prevResult)
Calculates 16-bit cyclic redundancy code (CITT CRC 16).
N/A | newByte | The new byte to be run through CRC. |
N/A | prevResult | The previous CRC result. |
Applies the standard CITT CRC 16 polynomial to a single byte. It should support being called first with an initial value, then repeatedly until all data is processed.
Returns
The new CRC result.
43
of file platform/service/legacy_hal/inc/crc.h
halCommonCrc32#
uint32_t halCommonCrc32 (uint8_t newByte, uint32_t prevResult)
Calculates 32-bit cyclic redundancy code.
N/A | newByte | The new byte to be run through CRC. |
N/A | prevResult | The previous CRC result. |
Note
On some radios or micros, the CRC for error detection on packet data is calculated in hardware.
Applies a CRC32 polynomial to a single byte. It should support being called first with an initial value, then repeatedly until all data is processed.
Returns
The new CRC result.
60
of file platform/service/legacy_hal/inc/crc.h
Macro Definition Documentation#
INITIAL_CRC#
#define INITIAL_CRCValue:
0xFFFFFFFFL
initial crc
63
of file platform/service/legacy_hal/inc/crc.h
CRC32_START#
#define CRC32_STARTValue:
INITIAL_CRC
crc32 start
64
of file platform/service/legacy_hal/inc/crc.h
CRC32_END#
#define CRC32_ENDValue:
0xDEBB20E3L
For CRC32 POLYNOMIAL run LSB-MSB.
65
of file platform/service/legacy_hal/inc/crc.h