This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.
This structure holds the configuration for the CRC required parameters.
Data Fields |
uint16_t | u16CrcSeedValue |
| Starting checksum value.
|
|
bool | bSetSeed |
| Set the seed value to registers only when this value is true.
|
|
Enumerator |
---|
kCRC_Crc16Kermit |
CRC-16/KERMIT protocol.
|
kCRC_CrcA |
CRC/CRCA protocol.
|
kCRC_Crc16Riello |
CRC-16/RIELLO protocol.
|
kCRC_Crc16Tms37157 |
CRC-16/TMS37157 protocol.
|
kCRC_Crc16Mcrf4xx |
CRC-16-MCRF4XX protocol.
|
kCRC_Crc16CCITT |
CRC-16-CCITT protocol.
|
kCRC_Crc16Augccitt |
CRC-16/AUG-CCITT protocol.
|
kCRC_Crc16Xmodem |
CRC-16/XMODEM protocol.
|
void CRC_Init |
( |
CRC_Type * |
base, |
|
|
const crc_config_t * |
psConfig |
|
) |
| |
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.
- Parameters
-
base | CRC peripheral address. |
psConfig | CRC module configuration structure |
void CRC_Deinit |
( |
CRC_Type * |
base | ) |
|
This function disables the clock gate in the SIM module for the CRC peripheral
- Parameters
-
base | CRC peripheral address. |
The purpose of this API is to initialize the configuration structure to default value for CRC_Init to use. Provides the configuration of commonly used CRC seed values. refer to crc_seed_value_t.
- Parameters
-
psConfig | CRC parameters configuration structure. |
void CRC_SetSeedValue |
( |
CRC_Type * |
base, |
|
|
uint16_t |
u16CrcSeedValue |
|
) |
| |
This function is help to write a 16 bit CRC seed value.
- Parameters
-
base | CRC peripheral address. |
u16CrcSeedValue | The value of seed. |
void CRC_WriteData |
( |
CRC_Type * |
base, |
|
|
const uint8_t * |
pu8Data, |
|
|
uint16_t |
u16DataSize, |
|
|
bool |
bRefin |
|
) |
| |
Writes input data buffer bytes to the CRC data register. The configured type of transpose is applied.
- Parameters
-
base | CRC peripheral address. |
pu8Data | Input data stream, MSByte in data[0]. |
u16DataSize | Size in bytes of the input data buffer. |
bRefin | Invert when input calculations. |
uint16_t CRC_Get16bitResult |
( |
CRC_Type * |
base, |
|
|
bool |
bRefOut |
|
) |
| |
Reads the CRC data register (either an intermediate or the final checksum). The configured type of transpose and complement is applied.
- Parameters
-
base | CRC peripheral address. |
bRefOut | Invert the calculated CRC value as a whole. |
- Returns
- A 16-bit checksum with or without transposed configuration.
static uint8_t CRC_TransposeByte |
( |
CRC_Type * |
base, |
|
|
uint8_t |
u8Input |
|
) |
| |
|
inlinestatic |
The CRC module provides an additional feature to transpose data (invert bit order)
- Parameters
-
base | CRC peripheral address. |
u8Input | An 8-bit input data. |