Cyclic redundancy check unit (CRC) HW driver header file.
More...
#include <stdint.h>
Go to the source code of this file.
Cyclic redundancy check unit (CRC) HW driver header file.
- Note
- These functions should only be used if the CRC unit was synthesized (IO_CRC_EN = true).
- See also
- https://stnolting.github.io/neorv32/sw/files.html
◆ NEORV32_CRC
◆ NEORV32_CRC_MODE_enum
CRC mode select
Enumerator |
---|
CRC_MODE8 | (0) crc8
|
CRC_MODE16 | (1) crc16
|
CRC_MODE32 | (3) crc32
|
◆ neorv32_crc_available()
int neorv32_crc_available |
( |
void | | ) |
|
Check if CRC unit was synthesized.
- Returns
- 0 if CRC was not synthesized, 1 if CRC is available.
◆ neorv32_crc_block()
uint32_t neorv32_crc_block |
( |
uint8_t * | byte, |
|
|
int | length ) |
Compute pre-configured CRC for entire data block.
- Parameters
-
[in] | byte | Pointer to byte (uint8_t) source data array. |
[in] | length | Length of source data array. |
- Returns
- 32-bit CRC result.
◆ neorv32_crc_get()
uint32_t neorv32_crc_get |
( |
void | | ) |
|
Get current CRC shift register data.
- Returns
- 32-bit CRC result.
◆ neorv32_crc_setup()
void neorv32_crc_setup |
( |
uint32_t | mode, |
|
|
uint32_t | poly, |
|
|
uint32_t | start ) |
Setup CRC unit.
- Parameters
-
[in] | mode | Operation mode (NEORV32_CRC_MODE_enum). |
[in] | poly | CRC polynomial. |
[in] | start | CRC shift register start value. |
◆ neorv32_crc_single()
void neorv32_crc_single |
( |
uint8_t | byte | ) |
|
Compute pre-configured CRC for single data byte.
- Parameters
-
[in] | byte | Data byte (uint8_t). |