Interface for cyclic redundancy checking.
Summary
The CRC (Cyclic Redundancy Check) calculator generates CRC codes using five different polynomials including 8 bit, 16 bit, and 32 bit variations. Calculation can be performed by sending data to the block using the CPU or by snooping on read or write activity on one of SCI channels.
◆ crc_input_t
Data Fields |
uint32_t |
num_bytes |
Length of input buffer. It must be 4-byte aligned when a 32-bit CRC polynomial function is used. |
uint32_t |
crc_seed |
CRC seed value. |
const void * |
p_input_buffer |
Pointer to input buffer. |
◆ crc_cfg_t
User configuration structure, used in open function
Data Fields |
uint8_t |
channel |
Channel number. |
crc_polynomial_t |
polynomial |
CRC Generating Polynomial Switching (GPS) |
crc_bit_order_t |
bit_order |
CRC Calculation Switching (LMS) |
uint32_t |
snoop_address |
Register Snoop Address (CRCSA) |
void const * |
p_extend |
CRC Hardware Dependent Configuration. |
◆ crc_api_t
CRC driver structure. General CRC functions implemented at the HAL layer will follow this API.
◆ open
Open the CRC driver module.
- Parameters
-
[in] | p_ctrl | Pointer to CRC device handle. |
[in] | p_cfg | Pointer to a configuration structure. |
◆ close
Close the CRC module driver
- Parameters
-
[in] | p_ctrl | Pointer to CRC device handle |
- Return values
-
FSP_SUCCESS | Configuration was successful. |
◆ crcResultGet
Return the current calculated value.
- Parameters
-
[in] | p_ctrl | Pointer to CRC device handle. |
[out] | crc_result | The calculated value from the last CRC calculation. |
◆ snoopEnable
Configure and Enable snooping.
- Parameters
-
[in] | p_ctrl | Pointer to CRC device handle. |
[in] | crc_seed | CRC seed. |
◆ snoopDisable
Disable snooping.
- Parameters
-
[in] | p_ctrl | Pointer to CRC device handle. |
◆ calculate
Perform a CRC calculation on a block of data.
- Parameters
-
[in] | p_ctrl | Pointer to CRC device handle. |
[in] | p_crc_input | A pointer to structure for CRC inputs |
[out] | crc_result | The calculated value of the CRC calculation. |
◆ crc_instance_t
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields |
crc_ctrl_t * |
p_ctrl |
Pointer to the control structure for this instance. |
crc_cfg_t const * |
p_cfg |
Pointer to the configuration structure for this instance. |
crc_api_t const * |
p_api |
Pointer to the API structure for this instance. |
◆ crc_ctrl_t
CRC control block. Allocate an instance specific control block to pass into the CRC API calls.
◆ crc_polynomial_t
CRC Generating Polynomial Switching (GPS).
Enumerator |
---|
CRC_POLYNOMIAL_CRC_8 | 8-bit CRC-8 (X^8 + X^2 + X + 1)
|
CRC_POLYNOMIAL_CRC_16 | 16-bit CRC-16 (X^16 + X^15 + X^2 + 1)
|
CRC_POLYNOMIAL_CRC_CCITT | 16-bit CRC-CCITT (X^16 + X^12 + X^5 + 1)
|
CRC_POLYNOMIAL_CRC_32 | 32-bit CRC-32 (X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 + X^8 + X^7 + X^5 + X^4 + X^2 + X + 1)
|
CRC_POLYNOMIAL_CRC_32C | 32-bit CRC-32C (X^32 + X^28 + X^27 + X^26 + X^25 + X^23 + X^22 + X^20 + X^19 + X^18 + X^14 + X^13 + X^11 + X^10 + X^9 + X^8 + X^6 + 1)
|
◆ crc_bit_order_t
CRC Calculation Switching (LMS)
Enumerator |
---|
CRC_BIT_ORDER_LMS_LSB | Generates CRC for LSB first communication.
|
CRC_BIT_ORDER_LMS_MSB | Generates CRC for MSB first communication.
|
◆ crc_snoop_direction_t
Snoop-On-Write/Read Switch (CRCSWR)
Enumerator |
---|
CRC_SNOOP_DIRECTION_RECEIVE | Snoop-on-read.
|
CRC_SNOOP_DIRECTION_TRANSMIT | Snoop-on-write.
|