AM64x MCU+ SDK  07.03.00
CRC

CRC (Cyclic Redundancy Check) driver provide API to perform CRC operation

Features Supported

  • Four channels
  • 8, 16, 32 and 64 bit data size
  • CPU mode of operations

SysConfig Features

Note
It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
  • SysConfig is not yet supported for CRC driver

Features NOT Supported

  • DMA mode of operation

Important Usage Guidelines

  • None

Example Usage

Include the below file to access the APIs

#include <drivers/crc.h>

CRC Module Initialization Example

int32_t status;
crcChannel_t crcChNumber = CRC_CHANNEL_1;
status = CRCChannelReset(gCrcBaseAddr, crcChNumber);
status = CRCInitialize(gCrcBaseAddr, crcChNumber, 0, 0);

CRC Module Configuration Example

int32_t status;
uint32_t patternCnt, sectCnt, mode;
crcChannel_t crcChNumber = CRC_CHANNEL_1;
patternCnt = 100; /* Calculate CRC for 100 words */
sectCnt = 1;
mode = CRC_OPERATION_MODE_FULLCPU; /* CPU mode */
status = CRCConfigure(gCrcBaseAddr, crcChNumber, patternCnt, sectCnt, mode);

CRC Operation Example

int32_t status;
crcSignatureRegAddr_t psaSignRegAddr;
crcSignature_t sectSignVal;
uint32_t patternCnt;
uint32_t loopCnt, data = 0xAA55AA55;
crcChannel_t crcChNumber = CRC_CHANNEL_1;
/* Get CRC PSA signature register address */
status = CRCGetPSASigRegAddr(gCrcBaseAddr, crcChNumber, &psaSignRegAddr);
/* Perform CRC operation - write data to PSA signature register */
patternCnt = 100; /* Calculate CRC for 100 words */
for(loopCnt = 0; loopCnt < patternCnt; loopCnt++)
{
HW_WR_REG32(psaSignRegAddr.regL, data); /* 32-bit mode */
}
/* Get the calculated CRC signature value */
status = CRCGetPSASectorSig(gCrcBaseAddr, crcChNumber, &sectSignVal);

API

APIs for CRC

CRC_OPERATION_MODE_FULLCPU
#define CRC_OPERATION_MODE_FULLCPU
Definition: crc/v0/crc.h:136
crcSignatureRegAddr_t
Structure for accessing CRC registers address which are 64 bit wide.
Definition: crc/v0/crc.h:258
crcSignatureRegAddr_t::regL
uint32_t regL
Definition: crc/v0/crc.h:259
crc.h
CRCConfigure
int32_t CRCConfigure(uint32_t baseAddr, crcChannel_t channel, uint32_t crcPatternCount, uint32_t crcSectorCount, crcOperationMode_t crcMode)
This API will configure CRC mode, pattern and sector count for given channel.
data
uint32_t data
Definition: tisci_rm_psil.h:1
crcChannel_t
uint32_t crcChannel_t
CRC channel supported.
Definition: crc/v0/crc.h:148
SystemP_SUCCESS
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
CRCChannelReset
int32_t CRCChannelReset(uint32_t baseAddr, crcChannel_t channel)
This API is used to reset the CRC channel.
crcSignature_t
Structure for accessing CRC register data which are 64 bit wide.
Definition: crc/v0/crc.h:247
CRCGetPSASectorSig
int32_t CRCGetPSASectorSig(uint32_t baseAddr, crcChannel_t channel, crcSignature_t *pCRCSectorSign)
This API is used to get sector signature Value/ CRC value for given channel.
mode
char mode[32]
Definition: tisci_pm_core.h:1
CRCGetPSASigRegAddr
int32_t CRCGetPSASigRegAddr(uint32_t baseAddr, crcChannel_t channel, crcSignatureRegAddr_t *pCRCRegAddr)
This API is used to get the PSA register address for given Channel.
CRCInitialize
int32_t CRCInitialize(uint32_t baseAddr, crcChannel_t channel, uint32_t crcWatchdogPreload, uint32_t crcBlockPreload)
Initialize CRC channel and will configure watchdog and block preload value for given channel.
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:154
CRC_CHANNEL_1
#define CRC_CHANNEL_1
Definition: crc/v0/crc.h:150