NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_crc.c File Reference

Cyclic redundancy check unit (CRC) HW driver source file. More...

#include <neorv32.h>

Functions

int neorv32_crc_available (void)
 
void neorv32_crc_setup (uint32_t mode, uint32_t poly, uint32_t start)
 
uint32_t neorv32_crc_block (uint8_t *byte, int length)
 
void neorv32_crc_single (uint8_t byte)
 
uint32_t neorv32_crc_get (void)
 

Detailed Description

Cyclic redundancy check unit (CRC) HW driver source 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

Function Documentation

◆ 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]bytePointer to byte (uint8_t) source data array.
[in]lengthLength 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]modeOperation mode (NEORV32_CRC_MODE_enum).
[in]polyCRC polynomial.
[in]startCRC shift register start value.

◆ neorv32_crc_single()

void neorv32_crc_single ( uint8_t byte)

Compute pre-configured CRC for single data byte.

Parameters
[in]byteData byte (uint8_t).