FD32M0P Microcontroller SDK
|
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. |
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 |
#define CRC_CFG_DEFAULT |
Default Initializer for CRC Configuration Struct.
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.
crc_regs | : pointer to the CRC register space |
crc_cfg_struct | : pointer to the CRC Configuration Struct |
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.
void crc_set_seed | ( | CRC_REGS_s * | regs, |
uint32_t | seed ) |
This function sets the CRC seed value.
crc_regs | : pointer to the CRC register space |
seed | : seed value |
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().
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.
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 |
void |
References CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_w.
Referenced by crc_compute_32bit_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.
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 |
void |
References CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_hw.
Referenced by crc_compute_16bit_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.
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 |
void |
References CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_byte.
Referenced by crc_compute_8bit_block().
uint32_t crc_get_result | ( | CRC_REGS_s * | regs | ) |
This function returns the crc result.
crc_regs | : pointer to the CRC register space |
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().
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.
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 |
crc_result |
References crc_feed_32bit_data(), crc_get_result(), and crc_set_seed().
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.
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 |
crc_result |
References crc_feed_16bit_data(), crc_get_result(), and crc_set_seed().
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.
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 |
crc_result |
References crc_feed_8bit_data(), crc_get_result(), and crc_set_seed().
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.
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 |
crc_result |
References crc_get_result(), crc_set_seed(), CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_w.
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.
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 |
crc_result |
References crc_get_result(), crc_set_seed(), CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_hw.
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.
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 |
crc_result |
References crc_get_result(), crc_set_seed(), CRC_REGS_s::CRCINPUT, and CRC_CRCINPUT_u::packed_byte.
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.
crc_regs | : pointer to the CRC register space |
crc_cfg_struct | : pointer to a crc configuration struct |
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.