|
px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
|
32-bit CRC (Cyclic Redundancy Check) calculator for checksums.
File(s):
A CRC is an error-detecting code that is used for data integrity checks.
Note that the polynomial value is bit reversed and a right shift operator is used during the calculation.
Macros | |
| #define | PX_CRC32_POLYNOMIAL 0xedb88320 |
| The generator polynomial CRC32 (reversed representation): x^32 + x^26 + x^23 + x^22 + x^16. More... | |
| #define | PX_CRC32_INIT_VAL 0xffffffff |
| Initial CRC value. More... | |
| #define | PX_CRC32_RAM_TABLE 0 |
| Generate table in RAM to speed up CRC calculation. More... | |
| #define | PX_CRC32_ROM_TABLE 0 |
| Use table in ROM to speed up CRC calculation. More... | |
Functions | |
| void | px_crc32_init (void) |
| Initialise 32-bit CRC calculator. More... | |
| uint32_t | px_crc32_update_u8 (uint32_t crc, uint8_t data) |
| Calculate the 32-bit CRC over one byte. More... | |
| uint32_t | px_crc32_update_data (uint32_t crc, const void *data, size_t nr_of_bytes) |
| Calculate the 32-bit CRC over a number of bytes. More... | |
| #define PX_CRC32_POLYNOMIAL 0xedb88320 |
The generator polynomial CRC32 (reversed representation): x^32 + x^26 + x^23 + x^22 + x^16.
Definition at line 69 of file px_crc32.h.
| #define PX_CRC32_INIT_VAL 0xffffffff |
Initial CRC value.
Definition at line 71 of file px_crc32.h.
| #define PX_CRC32_RAM_TABLE 0 |
Generate table in RAM to speed up CRC calculation.
Definition at line 34 of file px_crc32_cfg_template.h.
| #define PX_CRC32_ROM_TABLE 0 |
Use table in ROM to speed up CRC calculation.
Definition at line 37 of file px_crc32_cfg_template.h.
| void px_crc32_init | ( | void | ) |
Initialise 32-bit CRC calculator.
This function will initialise the table in RAM with constants to speed up CRC calculation. For other options it does nothing.
Definition at line 89 of file px_crc32.c.
| uint32_t px_crc32_update_u8 | ( | uint32_t | crc, |
| uint8_t | data | ||
| ) |
Calculate the 32-bit CRC over one byte.
| crc | The initial CRC to start the calculation with |
| data | The value to calculate the CRC over |
Definition at line 117 of file px_crc32.c.
| uint32_t px_crc32_update_data | ( | uint32_t | crc, |
| const void * | data, | ||
| size_t | nr_of_bytes | ||
| ) |
Calculate the 32-bit CRC over a number of bytes.
| crc | The initial CRC to start the calculation with |
| data | Pointer to the data to calculate the CRC over |
| nr_of_bytes | The amount of bytes to calculate the CRC over |
Definition at line 141 of file px_crc32.c.