FD32M0P Microcontroller SDK
Loading...
Searching...
No Matches

Data Structures

struct  crc_cfg_s
 CRC Configuration Struct. More...

Macros

#define CRC_CFG_DEFAULT
 Default Initializer for CRC Configuration Struct.

Functions

void crc_cfg (CRC_REGS_s *regs, const crc_cfg_s *cfg)
 This function configures CRC peripheral with polynomial type input bit reveral, output bit reversal, input and output endianness.
void crc_set_seed (CRC_REGS_s *regs, uint32_t seed)
 This function sets the CRC seed value.
void crc_feed_32bit_data (CRC_REGS_s *regs, const uint32_t *buffer, uint32_t length)
 This function writes a sequence of 32-bit words from the input buffer into the CRC input register block.
void crc_feed_16bit_data (CRC_REGS_s *regs, const uint16_t *buffer, uint32_t length)
 This function writes a sequence of 16-bit words from the input buffer into the CRC input register block.
void crc_feed_8bit_data (CRC_REGS_s *regs, const uint8_t *buffer, uint32_t length)
 This function writes a sequence of 8-bit words from the input buffer into the CRC input register block.
uint32_t crc_get_result (CRC_REGS_s *regs)
 This function returns the crc result.
uint32_t crc_compute_32bit_block (CRC_REGS_s *regs, uint32_t length, const uint32_t *buffer, uint32_t seed)
 This function feeds a block of 32-bit data from the input buffer into the CRC input register, sets the seed and returns the calculated crc result.
uint32_t crc_compute_16bit_block (CRC_REGS_s *regs, uint32_t length, const uint16_t *buffer, uint32_t seed)
 This function feeds a block of 16-bit data from the input buffer into the CRC input register, sets the seed and returns the calculated crc result.
uint32_t crc_compute_8bit_block (CRC_REGS_s *regs, uint32_t length, const uint8_t *buffer, uint32_t seed)
 This function feeds a block of 8-bit data from the input buffer into the CRC input register, sets the seed and returns the calculated crc result.
uint32_t crc_compute_32bit_mem_range (CRC_REGS_s *regs, uint32_t length, uint32_t seed, const uint32_t *start_addr)
 This function computes CRC over a memory range of 32-bit words, sets seed, returns the crc result.
uint32_t crc_compute_16bit_mem_range (CRC_REGS_s *regs, uint32_t length, uint32_t seed, const uint16_t *start_addr)
 This function computes CRC over a memory range of 16-bit words, sets seed, returns the crc result.
uint32_t crc_compute_8bit_mem_range (CRC_REGS_s *regs, uint32_t length, uint32_t seed, const uint8_t *start_addr)
 This function computes CRC over a memory range of 8-bit words, sets seed, returns the crc result.
void crc_read_cfg (CRC_REGS_s *regs, crc_cfg_s *rd_cfg)
 This function reads the CRC configurations from the register space, puts them in the configuration struct provided in the input.

Detailed Description


Data Structure Documentation

◆ crc_cfg_s

struct crc_cfg_s

CRC Configuration Struct.

Data Fields
CRC_CRCCONFIG_POLY_TYPE_E poly_type
bool input_bit_rev
bool output_bit_rev
bool in_is_big_endian
bool out_is_big_endian

Macro Definition Documentation

◆ CRC_CFG_DEFAULT

#define CRC_CFG_DEFAULT
Value:
{ \
.input_bit_rev = 0, \
.output_bit_rev = 0, \
.in_is_big_endian = 0, \
.out_is_big_endian = 0, \
}
@ CRC_CRCCONFIG_POLY_TYPE_32_BIT
0x0
Definition CRC_REGS.h:176

Default Initializer for CRC Configuration Struct.

Function Documentation

◆ crc_cfg()

void crc_cfg ( CRC_REGS_s * regs,
const crc_cfg_s * cfg )

This function configures CRC peripheral with polynomial type input bit reveral, output bit reversal, input and output endianness.

Parameters
crc_regs: pointer to the CRC register space
crc_cfg_struct: pointer to the CRC Configuration Struct
Return values
void

References CRC_REGS_s::CRCCONFIG, crc_cfg_s::in_is_big_endian, crc_cfg_s::input_bit_rev, crc_cfg_s::out_is_big_endian, crc_cfg_s::output_bit_rev, and crc_cfg_s::poly_type.

◆ crc_set_seed()

void crc_set_seed ( CRC_REGS_s * regs,
uint32_t seed )

This function sets the CRC seed value.

Parameters
crc_regs: pointer to the CRC register space
seed: seed value
Return values
void

References CRC_REGS_s::CRCSEED, and CRC_CRCSEED_u::packed_w.

Referenced by crc_compute_16bit_block(), crc_compute_16bit_mem_range(), crc_compute_32bit_block(), crc_compute_32bit_mem_range(), crc_compute_8bit_block(), and crc_compute_8bit_mem_range().

Here is the caller graph for this function:

◆ crc_feed_32bit_data()

void crc_feed_32bit_data ( CRC_REGS_s * regs,
const uint32_t * buffer,
uint32_t length )

This function writes a sequence of 32-bit words from the input buffer into the CRC input register block.

Parameters
crc_regs: pointer to the CRC register space
buffer: pointer to the 32-bit data buffer
length: number of 32-bit words to feed into the CRC engine
Return values
void

References CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_w.

Referenced by crc_compute_32bit_block().

Here is the caller graph for this function:

◆ crc_feed_16bit_data()

void crc_feed_16bit_data ( CRC_REGS_s * regs,
const uint16_t * buffer,
uint32_t length )

This function writes a sequence of 16-bit words from the input buffer into the CRC input register block.

Parameters
crc_regs: pointer to the CRC register space
buffer: pointer to the 16-bit data buffer
length: number of 16-bit words to feed into the CRC engine
Return values
void

References CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_hw.

Referenced by crc_compute_16bit_block().

Here is the caller graph for this function:

◆ crc_feed_8bit_data()

void crc_feed_8bit_data ( CRC_REGS_s * regs,
const uint8_t * buffer,
uint32_t length )

This function writes a sequence of 8-bit words from the input buffer into the CRC input register block.

Parameters
crc_regs: pointer to the CRC register space
buffer: pointer to the 8-bit data buffer
length: number of 8-bit words to feed into the CRC engine
Return values
void

References CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_byte.

Referenced by crc_compute_8bit_block().

Here is the caller graph for this function:

◆ crc_get_result()

uint32_t crc_get_result ( CRC_REGS_s * regs)

This function returns the crc result.

Parameters
crc_regs: pointer to the CRC register space
Return values
crc_result

References CRC_REGS_s::CRCRESULT, and CRC_CRCRESULT_u::packed_w.

Referenced by crc_compute_16bit_block(), crc_compute_16bit_mem_range(), crc_compute_32bit_block(), crc_compute_32bit_mem_range(), crc_compute_8bit_block(), and crc_compute_8bit_mem_range().

Here is the caller graph for this function:

◆ crc_compute_32bit_block()

uint32_t crc_compute_32bit_block ( CRC_REGS_s * regs,
uint32_t length,
const uint32_t * buffer,
uint32_t seed )

This function feeds a block of 32-bit data from the input buffer into the CRC input register, sets the seed and returns the calculated crc result.

Parameters
crc_regs: pointer to the CRC register space
length: number of 32-bit words to feed into the CRC engine
buffer: pointer to the 32-bit data buffer
seed: seed value
Return values
crc_result

References crc_feed_32bit_data(), crc_get_result(), and crc_set_seed().

Here is the call graph for this function:

◆ crc_compute_16bit_block()

uint32_t crc_compute_16bit_block ( CRC_REGS_s * regs,
uint32_t length,
const uint16_t * buffer,
uint32_t seed )

This function feeds a block of 16-bit data from the input buffer into the CRC input register, sets the seed and returns the calculated crc result.

Parameters
crc_regs: pointer to the CRC register space
length: number of 16-bit words to feed into the CRC engine
buffer: pointer to the 16-bit data buffer
seed: seed value
Return values
crc_result

References crc_feed_16bit_data(), crc_get_result(), and crc_set_seed().

Here is the call graph for this function:

◆ crc_compute_8bit_block()

uint32_t crc_compute_8bit_block ( CRC_REGS_s * regs,
uint32_t length,
const uint8_t * buffer,
uint32_t seed )

This function feeds a block of 8-bit data from the input buffer into the CRC input register, sets the seed and returns the calculated crc result.

Parameters
crc_regs: pointer to the CRC register space
length: number of 8-bit words to feed into the CRC engine
buffer: pointer to the 8-bit data buffer
seed: seed value
Return values
crc_result

References crc_feed_8bit_data(), crc_get_result(), and crc_set_seed().

Here is the call graph for this function:

◆ crc_compute_32bit_mem_range()

uint32_t crc_compute_32bit_mem_range ( CRC_REGS_s * regs,
uint32_t length,
uint32_t seed,
const uint32_t * start_addr )

This function computes CRC over a memory range of 32-bit words, sets seed, returns the crc result.

Parameters
crc_regs: pointer to the CRC register space
length: number of 32-bit words to feed into the CRC engine
seed: seed value
start_addr: pointer to the start of the 32-bit word aligned memory region
Return values
crc_result

References crc_get_result(), crc_set_seed(), CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_w.

Here is the call graph for this function:

◆ crc_compute_16bit_mem_range()

uint32_t crc_compute_16bit_mem_range ( CRC_REGS_s * regs,
uint32_t length,
uint32_t seed,
const uint16_t * start_addr )

This function computes CRC over a memory range of 16-bit words, sets seed, returns the crc result.

Parameters
crc_regs: pointer to the CRC register space
length: number of 16-bit words to feed into the CRC engine
seed: seed value
start_addr: pointer to the start of the 16-bit word aligned memory region
Return values
crc_result

References crc_get_result(), crc_set_seed(), CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_hw.

Here is the call graph for this function:

◆ crc_compute_8bit_mem_range()

uint32_t crc_compute_8bit_mem_range ( CRC_REGS_s * regs,
uint32_t length,
uint32_t seed,
const uint8_t * start_addr )

This function computes CRC over a memory range of 8-bit words, sets seed, returns the crc result.

Parameters
crc_regs: pointer to the CRC register space
length: number of 8-bit words to feed into the CRC engine
seed: seed value
start_addr: pointer to the start of the 8-bit word aligned memory region
Return values
crc_result

References crc_get_result(), crc_set_seed(), CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_byte.

Here is the call graph for this function:

◆ crc_read_cfg()

void crc_read_cfg ( CRC_REGS_s * regs,
crc_cfg_s * rd_cfg )

This function reads the CRC configurations from the register space, puts them in the configuration struct provided in the input.

Parameters
crc_regs: pointer to the CRC register space
crc_cfg_struct: pointer to a crc configuration struct
Return values
void

References CRC_REGS_s::CRCCONFIG, crc_cfg_s::in_is_big_endian, crc_cfg_s::input_bit_rev, crc_cfg_s::out_is_big_endian, crc_cfg_s::output_bit_rev, and crc_cfg_s::poly_type.