CC3200 Peripheral Driver Library User's Guide  1.2.0
CRC_Cyclic_Redundancy_Check_api

Functions

void CRCConfigSet (uint32_t ui32Base, uint32_t ui32CRCConfig)
 
void CRCSeedSet (uint32_t ui32Base, uint32_t ui32Seed)
 
void CRCDataWrite (uint32_t ui32Base, uint32_t ui32Data)
 
uint32_t CRCResultRead (uint32_t ui32Base)
 
uint32_t CRCDataProcess (uint32_t ui32Base, void *puiDataIn, uint32_t ui32DataLength, uint32_t ui32Config)
 

Detailed Description

Function Documentation

void CRCConfigSet ( uint32_t  ui32Base,
uint32_t  ui32CRCConfig 
)

Set the configuration of CRC functionality with the EC module.

Parameters
ui32Baseis the base address of the EC module.
ui32CRCConfigis the configuration of the CRC engine.

This function configures the operation of the CRC engine within the EC module. The configuration is specified with the ui32CRCConfig argument. It is the logical OR of any of the following options:

CRC Initialization Value

  • EC_CRC_CFG_INIT_SEED - Initialize with seed value
  • EC_CRC_CFG_INIT_0 - Initialize to all '0s'
  • EC_CRC_CFG_INIT_1 - Initialize to all '1s'

Input Data Size

  • EC_CRC_CFG_SIZE_8BIT - Input data size of 8 bits
  • EC_CRC_CFG_SIZE_32BIT - Input data size of 32 bits

Post Process Reverse/Inverse

  • EC_CRC_CFG_RESINV - Result inverse enable
  • EC_CRC_CFG_OBR - Output reverse enable

Input Bit Reverse

  • EC_CRC_CFG_IBR - Bit reverse enable

Endian Control

  • EC_CRC_CFG_ENDIAN_SBHW - Swap byte in half-word
  • EC_CRC_CFG_ENDIAN_SHW - Swap half-word

Operation Type

  • EC_CRC_CFG_TYPE_P8005 - Polynomial 0x8005
  • EC_CRC_CFG_TYPE_P1021 - Polynomial 0x1021
  • EC_CRC_CFG_TYPE_P4C11DB7 - Polynomial 0x4C11DB7
  • EC_CRC_CFG_TYPE_P1EDC6F41 - Polynomial 0x1EDC6F41
  • EC_CRC_CFG_TYPE_TCPCHKSUM - TCP checksum
Returns
None.
uint32_t CRCDataProcess ( uint32_t  ui32Base,
void *  puiDataIn,
uint32_t  ui32DataLength,
uint32_t  ui32Config 
)

Process data to generate a CRC with the EC module.

Parameters
ui32Baseis the base address of the EC module.
puiDataInis a pointer to an array of data that is processed.
ui32DataLengthis the number of data items that are processed to produce the CRC.
ui32Configthe config parameter to determine the CRC mode

This function processes an array of data to produce a CRC result. This function takes the CRC mode as the parameter.

The data in the array pointed to be pui32DataIn is either an array of bytes or an array or words depending on the selection of the input data size options EC_CRC_CFG_SIZE_8BIT and EC_CRC_CFG_SIZE_32BIT.

This function returns either the unmodified CRC result or the post- processed CRC result from the EC module. The post-processing options are selectable through EC_CRC_CFG_RESINV and EC_CRC_CFG_OBR parameters.

Returns
The CRC result.
void CRCDataWrite ( uint32_t  ui32Base,
uint32_t  ui32Data 
)

Write data into the EC module for CRC operations.

Parameters
ui32Baseis the base address of the EC module.
ui32Datais the data to be written.

This function writes either 8 or 32 bits of data into the EC module for CRC operations. The distinction between 8 and 32 bits of data is made when the EC_CRC_CFG_SIZE_8BIT or EC_CRC_CFG_SIZE_32BIT flag is set using the CRCConfigSet() function.

When writing 8 bits of data, ensure the data is in the least signficant byte position. The remaining bytes should be written with zero. For example, when writing 0xAB, ui32Data should be 0x000000AB.

Returns
None
uint32_t CRCResultRead ( uint32_t  ui32Base)

Reads the result of a CRC operation in the EC module.

Parameters
ui32Baseis the base address of the EC module.

This function reads either the unmodified CRC result or the post processed CRC result from the EC module. The post-processing options are selectable through EC_CRC_CFG_RESINV and EC_CRC_CFG_OBR parameters in the CRCConfigSet() function.

Returns
The CRC result.
void CRCSeedSet ( uint32_t  ui32Base,
uint32_t  ui32Seed 
)

Write the seed value for CRC operations in the EC module.

Parameters
ui32Baseis the base address of the EC module.
ui32Seedis the seed value.

This function writes the seed value for use with CRC operations in the EC module. This value is the start value for CRC operations. If this value is not written, then the residual seed from the previous operation is used as the starting value.

Note
The seed must be written only if EC_CRC_CFG_INIT_SEED is set with the CRCConfigSet() function.