![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Data Structures | |
struct | crc_config_t |
CRC protocol configuration. More... | |
Macros | |
#define | CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT 1 |
Default configuration structure filled by CRC_GetDefaultConfig(). More... | |
Enumerations | |
enum | crc_bits_t { kCrcBits16 = 0U, kCrcBits32 = 1U } |
CRC bit width. More... | |
enum | crc_result_t { kCrcFinalChecksum = 0U, kCrcIntermediateChecksum = 1U } |
CRC result type. More... | |
Functions | |
void | CRC_Init (CRC_Type *base, const crc_config_t *config) |
Enables and configures the CRC peripheral module. More... | |
static void | CRC_Deinit (CRC_Type *base) |
Disables the CRC peripheral module. More... | |
void | CRC_GetDefaultConfig (crc_config_t *config) |
Loads default values to the CRC protocol configuration structure. More... | |
void | CRC_WriteData (CRC_Type *base, const uint8_t *data, size_t dataSize) |
Writes data to the CRC module. More... | |
uint32_t | CRC_Get32bitResult (CRC_Type *base) |
Reads the 32-bit checksum from the CRC module. More... | |
uint16_t | CRC_Get16bitResult (CRC_Type *base) |
Reads a 16-bit checksum from the CRC module. More... | |
Driver version | |
#define | FSL_CRC_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
CRC driver version. More... | |
struct crc_config_t |
This structure holds the configuration for the CRC protocol.
Data Fields | |
uint32_t | polynomial |
CRC Polynomial, MSBit first. More... | |
uint32_t | seed |
Starting checksum value. | |
bool | reflectIn |
Reflect bits on input. More... | |
bool | reflectOut |
Reflect bits on output. More... | |
bool | complementChecksum |
True if the result shall be complement of the actual checksum. More... | |
crc_bits_t | crcBits |
Selects 16- or 32- bit CRC protocol. More... | |
crc_result_t | crcResult |
Selects final or intermediate checksum return from CRC_Get16bitResult() or CRC_Get32bitResult() | |
uint32_t crc_config_t::polynomial |
Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1
bool crc_config_t::reflectIn |
bool crc_config_t::reflectOut |
bool crc_config_t::complementChecksum |
crc_bits_t crc_config_t::crcBits |
#define FSL_CRC_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
Version 2.0.1.
Current version: 2.0.1
Change log:
#define CRC_DRIVER_USE_CRC16_CCIT_FALSE_AS_DEFAULT 1 |
Use CRC16-CCIT-FALSE as defeault.
enum crc_bits_t |
enum crc_result_t |
Enumerator | |
---|---|
kCrcFinalChecksum |
CRC data register read value is the final checksum. Reflect out and final xor protocol features are applied. |
kCrcIntermediateChecksum |
CRC data register read value is intermediate checksum (raw value). Reflect out and final xor protocol feature are not applied. Intermediate checksum can be used as a seed for CRC_Init() to continue adding data to this checksum. |
void CRC_Init | ( | CRC_Type * | base, |
const crc_config_t * | config | ||
) |
This function enables the clock gate in the SIM module for the CRC peripheral. It also configures the CRC module and starts a checksum computation by writing the seed.
base | CRC peripheral address. |
config | CRC module configuration structure. |
|
inlinestatic |
This function disables the clock gate in the SIM module for the CRC peripheral.
base | CRC peripheral address. |
void CRC_GetDefaultConfig | ( | crc_config_t * | config | ) |
Loads default values to the CRC protocol configuration structure. The default values are as follows.
config | CRC protocol configuration structure. |
void CRC_WriteData | ( | CRC_Type * | base, |
const uint8_t * | data, | ||
size_t | dataSize | ||
) |
Writes input data buffer bytes to the CRC data register. The configured type of transpose is applied.
base | CRC peripheral address. |
data | Input data stream, MSByte in data[0]. |
dataSize | Size in bytes of the input data buffer. |
uint32_t CRC_Get32bitResult | ( | CRC_Type * | base | ) |
Reads the CRC data register (either an intermediate or the final checksum). The configured type of transpose and complement is applied.
base | CRC peripheral address. |
uint16_t CRC_Get16bitResult | ( | CRC_Type * | base | ) |
Reads the CRC data register (either an intermediate or the final checksum). The configured type of transpose and complement is applied.
base | CRC peripheral address. |