RZ Flexible Software Package Documentation  Release v4.0.0

 
CRC Interface

Detailed Description

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.

Classes

struct  st_crc_input_t
 
struct  st_crc_cfg
 
struct  st_crc_api
 
struct  st_crc_instance
 

Typedefs

typedef struct st_crc_input_t crc_input_t
 
typedef void crc_ctrl_t
 
typedef struct st_crc_cfg crc_cfg_t
 
typedef struct st_crc_api crc_api_t
 
typedef struct st_crc_instance crc_instance_t
 

Enumerations

enum  crc_polynomial_t
 
enum  crc_bit_order_t
 
enum  crc_snoop_direction_t
 

Class Documentation

◆ RZG::st_crc_input_t

struct RZG::st_crc_input_t

Structure for CRC inputs

Class Members
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.

◆ RZG::st_crc_cfg

struct RZG::st_crc_cfg

User configuration structure, used in open function

Class Members
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.

◆ RZG::st_crc_api

struct RZG::st_crc_api

CRC driver structure. General CRC functions implemented at the HAL layer will follow this API.

Public Attributes

fsp_err_t(* open )(crc_ctrl_t *const p_ctrl, crc_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(crc_ctrl_t *const p_ctrl)
 
fsp_err_t(* crcResultGet )(crc_ctrl_t *const p_ctrl, uint32_t *crc_result)
 
fsp_err_t(* snoopEnable )(crc_ctrl_t *const p_ctrl, uint32_t crc_seed)
 
fsp_err_t(* snoopDisable )(crc_ctrl_t *const p_ctrl)
 
fsp_err_t(* calculate )(crc_ctrl_t *const p_ctrl, crc_input_t *const p_crc_input, uint32_t *p_crc_result)
 

Member Data Documentation

◆ open

fsp_err_t(* open) (crc_ctrl_t *const p_ctrl, crc_cfg_t const *const p_cfg)

Open the CRC driver module.

Parameters
[in]p_ctrlPointer to CRC device handle.
[in]p_cfgPointer to a configuration structure.

◆ close

fsp_err_t(* close) (crc_ctrl_t *const p_ctrl)

Close the CRC module driver

Parameters
[in]p_ctrlPointer to CRC device handle
Return values
FSP_SUCCESSConfiguration was successful.

◆ crcResultGet

fsp_err_t(* crcResultGet) (crc_ctrl_t *const p_ctrl, uint32_t *crc_result)

Return the current calculated value.

Parameters
[in]p_ctrlPointer to CRC device handle.
[out]crc_resultThe calculated value from the last CRC calculation.

◆ snoopEnable

fsp_err_t(* snoopEnable) (crc_ctrl_t *const p_ctrl, uint32_t crc_seed)

Configure and Enable snooping.

Parameters
[in]p_ctrlPointer to CRC device handle.
[in]crc_seedCRC seed.

◆ snoopDisable

fsp_err_t(* snoopDisable) (crc_ctrl_t *const p_ctrl)

Disable snooping.

Parameters
[in]p_ctrlPointer to CRC device handle.

◆ calculate

fsp_err_t(* calculate) (crc_ctrl_t *const p_ctrl, crc_input_t *const p_crc_input, uint32_t *p_crc_result)

Perform a CRC calculation on a block of data.

Parameters
[in]p_ctrlPointer to CRC device handle.
[in]p_crc_inputA pointer to structure for CRC inputs
[out]crc_resultThe calculated value of the CRC calculation.

◆ RZG::st_crc_instance

struct RZG::st_crc_instance

This structure encompasses everything that is needed to use an instance of this interface.

Class Members
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.

Typedef Documentation

◆ crc_input_t

typedef struct st_crc_input_t crc_input_t

Structure for CRC inputs Please refer to the struct st_crc_input_t.

◆ crc_ctrl_t

typedef void crc_ctrl_t

CRC control block. Allocate an instance specific control block to pass into the CRC API calls.

◆ crc_cfg_t

typedef struct st_crc_cfg crc_cfg_t

User configuration structure, used in open function Please refer to the struct st_crc_cfg.

◆ crc_api_t

typedef struct st_crc_api crc_api_t

CRC driver structure. General CRC functions implemented at the HAL layer will follow this API. Please refer to the struct st_crc_api.

◆ crc_instance_t

This structure encompasses everything that is needed to use an instance of this interface. Please refer to the struct st_crc_instance.

Enumeration Type Documentation

◆ 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.