Cyclic Redundancy Code (CRC)
Functions that provide access to cyclic redundancy code (CRC) calculation. See
crc.h
for source code.
More...
Macros |
|
#define | INITIAL_CRC |
#define | CRC32_START |
#define | CRC32_END |
Functions |
|
uint16_t | halCommonCrc16 (uint8_t newByte, uint16_t prevResult) |
Calculates 16-bit cyclic redundancy code (CITT CRC 16).
More...
|
|
uint32_t | halCommonCrc32 (uint8_t newByte, uint32_t prevResult) |
Calculates 32-bit cyclic redundancy code.
More...
|
|
Detailed Description
Functions that provide access to cyclic redundancy code (CRC) calculation. See
crc.h
for source code.
Macro Definition Documentation
#define CRC32_END |
Definition at line
50
of file
crc.h
.
#define CRC32_START |
Definition at line
49
of file
crc.h
.
#define INITIAL_CRC |
Definition at line
48
of file
crc.h
.
Function Documentation
uint16_t halCommonCrc16 | ( | uint8_t |
newByte,
|
uint16_t |
prevResult
|
||
) |
Calculates 16-bit cyclic redundancy code (CITT CRC 16).
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.
- Parameters
-
newByte
The new byte to be run through CRC. prevResult
The previous CRC result.
- Returns
- The new CRC result.
uint32_t halCommonCrc32 | ( | uint8_t |
newByte,
|
uint32_t |
prevResult
|
||
) |
Calculates 32-bit cyclic redundancy code.
- 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.
- Parameters
-
newByte
The new byte to be run through CRC. prevResult
The previous CRC result.
- Returns
- The new CRC result.