![]() |
S32 SDK
|
This section describes the programming interface of the CRC driver.
Data Structures | |
struct | crc_user_config_t |
CRC configuration structure. Implements : crc_user_config_t_Class. More... | |
Macros | |
#define | CRC_DEFAULT_WRITE_TRANSPOSE CRC_TRANSPOSE_NONE |
#define | CRC_DEFAULT_SEED (0xFFFFU) |
Enumerations | |
enum | crc_transpose_t { CRC_TRANSPOSE_NONE = 0x00U, CRC_TRANSPOSE_BITS = 0x01U, CRC_TRANSPOSE_BITS_AND_BYTES = 0x02U, CRC_TRANSPOSE_BYTES = 0x03U } |
CRC type of transpose of read write data Implements : crc_transpose_t_Class. More... | |
CRC DRIVER API | |
status_t | CRC_DRV_Init (uint32_t instance, const crc_user_config_t *userConfigPtr) |
Initializes the CRC module. More... | |
status_t | CRC_DRV_Deinit (uint32_t instance) |
Sets the default configuration. More... | |
uint32_t | CRC_DRV_GetCrc32 (uint32_t instance, uint32_t data, bool newSeed, uint32_t seed) |
Appends 32-bit data to the current CRC calculation and returns new result. More... | |
uint32_t | CRC_DRV_GetCrc16 (uint32_t instance, uint16_t data, bool newSeed, uint32_t seed) |
Appends 16-bit data to the current CRC calculation and returns new result. More... | |
uint32_t | CRC_DRV_GetCrc8 (uint32_t instance, uint8_t data, bool newSeed, uint32_t seed) |
Appends 8-bit data to the current CRC calculation and returns new result. More... | |
void | CRC_DRV_WriteData (uint32_t instance, const uint8_t *data, uint32_t dataSize) |
Appends a block of bytes to the current CRC calculation. More... | |
uint32_t | CRC_DRV_GetCrcResult (uint32_t instance) |
Returns the current result of the CRC calculation. More... | |
status_t | CRC_DRV_Configure (uint32_t instance, const crc_user_config_t *userConfigPtr) |
Configures the CRC module from a user configuration structure. More... | |
status_t | CRC_DRV_GetConfig (uint32_t instance, crc_user_config_t *const userConfigPtr) |
Get configures of the CRC module currently. More... | |
status_t | CRC_DRV_GetDefaultConfig (crc_user_config_t *const userConfigPtr) |
Get default configures the CRC module for configuration structure. More... | |
#define CRC_DEFAULT_SEED (0xFFFFU) |
Definition at line 44 of file crc_driver.h.
#define CRC_DEFAULT_WRITE_TRANSPOSE CRC_TRANSPOSE_NONE |
Definition at line 42 of file crc_driver.h.
enum crc_transpose_t |
CRC type of transpose of read write data Implements : crc_transpose_t_Class.
Enumerator | |
---|---|
CRC_TRANSPOSE_NONE |
No transpose |
CRC_TRANSPOSE_BITS |
Transpose bits in bytes |
CRC_TRANSPOSE_BITS_AND_BYTES |
Transpose bytes and bits in bytes |
CRC_TRANSPOSE_BYTES |
Transpose bytes |
Definition at line 50 of file crc_driver.h.
status_t CRC_DRV_Configure | ( | uint32_t | instance, |
const crc_user_config_t * | userConfigPtr | ||
) |
Configures the CRC module from a user configuration structure.
This function configures the CRC module from a user configuration structure
[in] | instance | The CRC instance number |
[in] | userConfigPtr | Pointer to structure of initialization |
Definition at line 239 of file crc_driver.c.
status_t CRC_DRV_Deinit | ( | uint32_t | instance | ) |
Sets the default configuration.
This function sets the default configuration
[in] | instance | The CRC instance number |
Definition at line 91 of file crc_driver.c.
status_t CRC_DRV_GetConfig | ( | uint32_t | instance, |
crc_user_config_t *const | userConfigPtr | ||
) |
Get configures of the CRC module currently.
This function Get configures of the CRC module currently
[in] | instance | The CRC instance number |
[in] | userConfigPtr | Pointer to structure of initialization |
Definition at line 271 of file crc_driver.c.
uint32_t CRC_DRV_GetCrc16 | ( | uint32_t | instance, |
uint16_t | data, | ||
bool | newSeed, | ||
uint32_t | seed | ||
) |
Appends 16-bit data to the current CRC calculation and returns new result.
This function appends 16-bit data to the current CRC calculation and returns new result. If the newSeed is true, seed set and result are calculated from the seed new value (new CRC calculation)
[in] | instance | The CRC instance number |
[in] | data | Input data for CRC calculation |
[in] | newSeed | Sets new CRC calculation
|
[in] | seed | New seed if newSeed is true, else ignored |
Definition at line 142 of file crc_driver.c.
uint32_t CRC_DRV_GetCrc32 | ( | uint32_t | instance, |
uint32_t | data, | ||
bool | newSeed, | ||
uint32_t | seed | ||
) |
Appends 32-bit data to the current CRC calculation and returns new result.
This function appends 32-bit data to the current CRC calculation and returns new result. If the newSeed is true, seed set and result are calculated from the seed new value (new CRC calculation)
[in] | instance | The CRC instance number |
[in] | data | Input data for CRC calculation |
[in] | newSeed | Sets new CRC calculation
|
[in] | seed | New seed if newSeed is true, else ignored |
Definition at line 111 of file crc_driver.c.
uint32_t CRC_DRV_GetCrc8 | ( | uint32_t | instance, |
uint8_t | data, | ||
bool | newSeed, | ||
uint32_t | seed | ||
) |
Appends 8-bit data to the current CRC calculation and returns new result.
This function appends 8-bit data to the current CRC calculation and returns new result. If the newSeed is true, seed set and result are calculated from the seed new value (new CRC calculation)
[in] | instance | The CRC instance number |
[in] | data | Input data for CRC calculation |
[in] | newSeed | Sets new CRC calculation
|
[in] | seed | New seed if newSeed is true, else ignored |
Definition at line 172 of file crc_driver.c.
uint32_t CRC_DRV_GetCrcResult | ( | uint32_t | instance | ) |
Returns the current result of the CRC calculation.
This function returns the current result of the CRC calculation
[in] | instance | The CRC instance number |
Definition at line 223 of file crc_driver.c.
status_t CRC_DRV_GetDefaultConfig | ( | crc_user_config_t *const | userConfigPtr | ) |
Get default configures the CRC module for configuration structure.
This function Get default configures the CRC module for user configuration structure
[in] | userConfigPtr | Pointer to structure of initialization |
Definition at line 303 of file crc_driver.c.
status_t CRC_DRV_Init | ( | uint32_t | instance, |
const crc_user_config_t * | userConfigPtr | ||
) |
Initializes the CRC module.
This function initializes CRC driver based on user configuration input. The user must make sure that the clock is enabled
[in] | instance | The CRC instance number |
[in] | userConfigPtr | Pointer to structure of initialization |
Definition at line 68 of file crc_driver.c.
void CRC_DRV_WriteData | ( | uint32_t | instance, |
const uint8_t * | data, | ||
uint32_t | dataSize | ||
) |
Appends a block of bytes to the current CRC calculation.
This function appends a block of bytes to the current CRC calculation
[in] | instance | The CRC instance number |
[in] | data | Data for current CRC calculation |
[in] | dataSize | Length of data to be calculated |
Definition at line 200 of file crc_driver.c.