NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
Data Structures
neorv32_crc.h File Reference

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

Go to the source code of this file.

Data Structures

struct  neorv32_crc_t
 

Functions

Prototypes
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)
 

IO Device: Cyclic Redundancy Check Unit (CRC)

#define NEORV32_CRC   ((neorv32_crc_t*) (NEORV32_CRC_BASE))
 
enum  NEORV32_CRC_MODE_enum { CRC_MODE8 = 0b00 , CRC_MODE16 = 0b01 , CRC_MODE32 = 0b10 }
 

Detailed Description

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).

Macro Definition Documentation

◆ NEORV32_CRC

#define NEORV32_CRC   ((neorv32_crc_t*) (NEORV32_CRC_BASE))

CRC module hardware access (neorv32_crc_t)

Enumeration Type Documentation

◆ NEORV32_CRC_MODE_enum

CRC mode select

Enumerator
CRC_MODE8 

(0) crc8

CRC_MODE16 

(1) crc16

CRC_MODE32 

(3) crc32

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).