![]() |
Synergy Software Package User's Manual
|
Driver for the CRC Calculator (CRC). More...
Data Structures | |
| struct | crc_instance_ctrl_t |
Functions | |
| ssp_err_t | R_CRC_Open (crc_ctrl_t *const p_api_ctrl, crc_cfg_t const *const p_cfg) |
| Open the CRC driver module. More... | |
| ssp_err_t | R_CRC_Close (crc_ctrl_t *const p_api_ctrl) |
| Close the CRC module driver. More... | |
| ssp_err_t | R_CRC_CalculatedValueGet (crc_ctrl_t *const p_api_ctrl, uint32_t *calculatedValue) |
| Return the current calculated value. More... | |
| ssp_err_t | R_CRC_SnoopEnable (crc_ctrl_t *const p_api_ctrl, uint32_t crc_seed) |
| Enable snooping. More... | |
| ssp_err_t | R_CRC_SnoopDisable (crc_ctrl_t *const p_api_ctrl) |
| Disable snooping. More... | |
| ssp_err_t | R_CRC_SnoopCfg (crc_ctrl_t *const p_api_ctrl, crc_snoop_cfg_t *const p_snoop_cfg) |
| Configure the snoop channel and direction. More... | |
| ssp_err_t | R_CRC_Calculate (crc_ctrl_t *const p_api_ctrl, void *inputBuffer, uint32_t length, uint32_t crc_seed, uint32_t *calculatedValue) |
| Perform a CRC calculation on a block of 8-bit/32-bit(for 32-bit polynomial) data. More... | |
| ssp_err_t | R_CRC_VersionGet (ssp_version_t *const p_version) |
| Get the driver version based on compile time macros. More... | |
Driver for the CRC Calculator (CRC).
This module supports the CRC Calculator (CRC). It implements the following interface:
| ssp_err_t R_CRC_Calculate | ( | crc_ctrl_t *const | p_api_ctrl, |
| void * | inputBuffer, | ||
| uint32_t | length, | ||
| uint32_t | crc_seed, | ||
| uint32_t * | calculatedValue | ||
| ) |
Perform a CRC calculation on a block of 8-bit/32-bit(for 32-bit polynomial) data.
Implements crc_api_t::calculate
This function performs a CRC calculation on an array of 8-bit/32-bit(for 32-bit polynomial) values and returns an 8-bit/32-bit(for 32-bit polynomial) calculated value
| SSP_SUCCESS | Calculation successful. |
| SSP_ERR_ASSERTION | Either p_ctrl, inputBuffer, or calculatedValue is NULL. |
| SSP_ERR_INVALID_ARGUMENT | length value is NULL. |
| SSP_ERR_NOT_OPEN | The driver is not opened. |
| SSP_ERR_IN_USE | CRC peripheral is currently in use by another instance of the driver. |
Lock the peripheral during calculation
Set the bit order
Set CRC polynomial
Calculate CRC value for the input buffer
Release the hardware lock
| ssp_err_t R_CRC_CalculatedValueGet | ( | crc_ctrl_t *const | p_api_ctrl, |
| uint32_t * | calculatedValue | ||
| ) |
Return the current calculated value.
Implements crc_api_t::crcResultGet
CRC calculation operates on a running value. This function returns the current calculated value.
| SSP_SUCCESS | Return of calculated value successful. |
| SSP_ERR_ASSERTION | Either p_ctrl or calculatedValue is NULL. |
| SSP_ERR_NOT_OPEN | The driver is not opened. |
Based on the selected polynomial, return the calculated CRC value
| ssp_err_t R_CRC_Close | ( | crc_ctrl_t *const | p_api_ctrl | ) |
Close the CRC module driver.
Implements crc_api_t::close
| SSP_SUCCESS | Configuration was successful. |
| SSP_ERR_ASSERTION | p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | The driver is not opened. |
Release the CRC Hardware Resource
Mark driver as closed
| ssp_err_t R_CRC_Open | ( | crc_ctrl_t *const | p_api_ctrl, |
| crc_cfg_t const *const | p_cfg | ||
| ) |
Open the CRC driver module.
Implements crc_api_t::open
Open the CRC driver module and initialize the driver control block according to the passed-in configuration structure.
| SSP_SUCCESS | Configuration was successful. |
| SSP_ERR_ASSERTION | p_ctrl or p_cfg is NULL. |
Mark driver as initialized by setting the open value to the ASCII equivalent of "CRC"
Enable clocks to the CRC peripheral.
| ssp_err_t R_CRC_SnoopCfg | ( | crc_ctrl_t *const | p_api_ctrl, |
| crc_snoop_cfg_t *const | p_snoop_cfg | ||
| ) |
Configure the snoop channel and direction.
Implements crc_api_t::snoopCfg
The CRC calculator can operate on reads and writes over any of the first ten SCI channels. For example, if set to channel 0, transmit, every byte written out SCI channel 0 is also sent to the CRC calculator as if the value was explicitly written directly to the CRC calculator.
| SSP_SUCCESS | Snoop configured successfully. |
| SSP_ERR_ASSERTION | - This is due to below conditions
|
| SSP_ERR_NOT_OPEN | The driver is not opened. |
Set the bit order
Set CRC polynomial
Set CRC snoop channel and direction
| ssp_err_t R_CRC_SnoopDisable | ( | crc_ctrl_t *const | p_api_ctrl | ) |
Disable snooping.
Implements crc_api_t::snoopDisable
| SSP_SUCCESS | Snoop disabled. |
| SSP_ERR_ASSERTION | p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | The driver is not opened. |
Disable the snoop operation
| ssp_err_t R_CRC_SnoopEnable | ( | crc_ctrl_t *const | p_api_ctrl, |
| uint32_t | crc_seed | ||
| ) |
Enable snooping.
Implements crc_api_t::snoopEnable
| SSP_SUCCESS | Snoop enabled. |
| SSP_ERR_ASSERTION | Either p_ctrl or crc_seed is NULL. |
| SSP_ERR_NOT_OPEN | The driver is not opened. |
Based on the selected polynomial, set the initial CRC seed value
Enable the snoop operation
| ssp_err_t R_CRC_VersionGet | ( | ssp_version_t *const | p_version | ) |
Get the driver version based on compile time macros.
Implements crc_api_t::versionGet
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | p_version is NULL. |