![]() |
RAFW Flexible Software Package Documentation
Release v2.0.1
|
|
Functions | |
| fsp_err_t | R_CRC_W_Open (crc_ctrl_t *const p_ctrl, crc_cfg_t const *const p_cfg) |
| fsp_err_t | R_CRC_W_Close (crc_ctrl_t *const p_ctrl) |
| fsp_err_t | R_CRC_W_Calculate (crc_ctrl_t *const p_ctrl, crc_input_t *const p_crc_input, uint32_t *p_calculatedValue) |
| fsp_err_t | R_CRC_W_CalculatedValueGet (crc_ctrl_t *const p_ctrl, uint32_t *p_calculatedValue) |
| fsp_err_t | R_CRC_W_SnoopEnable (crc_ctrl_t *const p_ctrl, uint32_t crc_seed) |
| fsp_err_t | R_CRC_W_SnoopDisable (crc_ctrl_t *const p_ctrl) |
Driver for the CRC peripheral on RA6W1/RA6W2 MCUs. This module implements the CRC Interface.
The CRC module provides an API to calculate 16 and 32-bit CRC values on a block of data in memory or a data being transferred by the bus master (DMA) using industry-standard polynomials.
| Configuration | Options | Default | Description |
|---|---|---|---|
| Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
| DMAC Support |
| Disabled | If enabled, DMAC instance will be included in the build. |
| Configuration | Options | Default | Description |
|---|---|---|---|
| Name | Name must be a valid C symbol | g_crc0 | Module name. |
| Channel | Value must be a non-negative integer | 0 | Specifies the CRC calculation channel. |
| CRC Polynomial |
| CRC-32 | Select the CRC polynomial. |
| Input Data Swap Enable |
| Normal | Input data swap enable. |
| Bit Endian Type |
| Big Endian | Bit endian type. |
| Parallel Type |
| 8 bits | Parallel type of CRC calculation. |
| Access Type |
| Read access | Access type of CRC calculation. |
There is no clock configuration for the CRC module.
This module does not use I/O pins.
When using CRC32 polynomial functions the CRC module produces the same results as popular online CRC32 calculators, but it is important to remember a few important points.
This is a basic example of minimal use of the CRC module in an application.
This example demonstrates CRC DMA operation.
Data Structures | |
| struct | crc_w_instance_ctrl_t |
| struct | crc_w_extended_cfg_t |
Enumerations | |
| enum | crc_w_channel_t |
| enum | crc_w_polynomial_t |
| enum | crc_w_path_selection_t |
| enum | crc_w_swap_enable_t |
| enum | crc_w_endian_type_t |
| enum | crc_w_parallel_type_t |
| enum | crc_w_access_type_t |
| enum | crc_w_calculation_status_t |
| enum | crc_w_remap_address_0_t |
| struct crc_w_instance_ctrl_t |
Driver instance control structure.
| Data Fields | ||
|---|---|---|
| uint32_t | open | Whether or not driver is open. |
| const crc_cfg_t * | p_cfg | Pointer to initial configuration. |
| struct crc_w_extended_cfg_t |
Extended configuration.
| Data Fields | ||
|---|---|---|
| crc_w_channel_t | channel | CRC channel. |
| crc_w_polynomial_t | polynomial | CRC Generating Polynomial. |
| crc_w_swap_enable_t | swap_enable | Input Data Swap Enable. |
| crc_w_endian_type_t | endian_type | Bit Endian Type. |
| crc_w_parallel_type_t | parallel_type | Parallel Type of CRC Calculation. |
| crc_w_access_type_t | access_type | Access Type of CRC Calculation. |
| crc_w_path_selection_t | path_selection | Path Selection of CRC Calculation. |
| transfer_instance_t const * | p_transfer | DMAC instance. Set to NULL if unused. |
| enum crc_w_channel_t |
| enum crc_w_polynomial_t |
CRC Generating Polynomial.
| enum crc_w_swap_enable_t |
| enum crc_w_endian_type_t |
| enum crc_w_access_type_t |
| fsp_err_t R_CRC_W_Open | ( | crc_ctrl_t *const | p_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.
| FSP_SUCCESS | Configuration was successful. |
| FSP_ERR_ASSERTION | p_ctrl or p_cfg is NULL. |
| FSP_ERR_ALREADY_OPEN | Module already open |
| FSP_ERR_TIMEOUT | CRC is busy. |
| fsp_err_t R_CRC_W_Close | ( | crc_ctrl_t *const | p_ctrl | ) |
Close the CRC module driver.
Implements crc_api_t::close
| FSP_SUCCESS | Configuration was successful. |
| FSP_ERR_ASSERTION | p_ctrl is NULL. Status of CRC calculation is ERROR. |
| FSP_ERR_NOT_OPEN | The driver is not opened. |
| FSP_ERR_TIMEOUT | CRC is not stopped. |
| fsp_err_t R_CRC_W_Calculate | ( | crc_ctrl_t *const | p_ctrl, |
| crc_input_t *const | p_crc_input, | ||
| uint32_t * | p_calculatedValue | ||
| ) |
Perform a CRC calculation on a block of data.
Implements crc_api_t::calculate
If not using DMA, returns the calculated CRC value. If using DMA, use R_CRC_W_CalculatedValueGet to get the calculated value.
| FSP_SUCCESS | Calculation successful. |
| FSP_ERR_ASSERTION | Either p_ctrl, inputBuffer, or p_calculatedValue is NULL. Status of CRC calculation is ERROR. |
| FSP_ERR_INVALID_ARGUMENT | length value is NULL. |
| FSP_ERR_NOT_OPEN | The driver is not opened. |
| FSP_ERR_TIMEOUT | CRC is not stopped. CRC is busy. |
| fsp_err_t R_CRC_W_CalculatedValueGet | ( | crc_ctrl_t *const | p_ctrl, |
| uint32_t * | p_calculatedValue | ||
| ) |
Return the calculated value.
Implements crc_api_t::crcResultGet
CRC calculation operates on a running value. This function returns the current calculated value.
| FSP_SUCCESS | Return of calculated value successful. |
| FSP_ERR_ASSERTION | Either p_ctrl or p_calculatedValue is NULL. |
| FSP_ERR_NOT_OPEN | The driver is not opened. |
| FSP_ERR_TIMEOUT | CRC calculation is not stopped. |
| fsp_err_t R_CRC_W_SnoopEnable | ( | crc_ctrl_t *const | p_ctrl, |
| uint32_t | crc_seed | ||
| ) |
Configure the snoop channel and set the CRC seed.
Implements crc_api_t::snoopEnable
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.
| FSP_ERR_UNSUPPORTED | SNOOP operation is not supported. |
| fsp_err_t R_CRC_W_SnoopDisable | ( | crc_ctrl_t *const | p_ctrl | ) |
Disable snooping.
Implements crc_api_t::snoopDisable
| FSP_ERR_UNSUPPORTED | SNOOP operation is not supported. |