M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
Macros | Functions
Collaboration diagram for CRC Exported Functions:

Macros

#define CRC_SET_SEED(u32Seed)   { CRC->SEED = (u32Seed); CRC->CTL |= CRC_CTL_CRCRST_Msk; }
 Set CRC Seed Value. More...
 
#define CRC_GET_SEED()   (CRC->SEED)
 Get CRC Seed Value. More...
 
#define CRC_WRITE_DATA(u32Data)   (CRC->DAT = (u32Data))
 CRC Write Data. More...
 

Functions

void CRC_Open (uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen)
 CRC Open. More...
 
uint32_t CRC_GetChecksum (void)
 Get CRC Checksum. More...
 

Detailed Description

Macro Definition Documentation

◆ CRC_GET_SEED

#define CRC_GET_SEED ( )    (CRC->SEED)

Get CRC Seed Value.

Parameters
None
Returns
CRC seed value

This macro gets the current CRC seed value.

Definition at line 81 of file crc.h.

◆ CRC_SET_SEED

#define CRC_SET_SEED (   u32Seed)    { CRC->SEED = (u32Seed); CRC->CTL |= CRC_CTL_CRCRST_Msk; }

Set CRC Seed Value.

Parameters
[in]u32SeedSeed value
Returns
None

This macro is used to set CRC seed value.

Note
User must to perform CRC_RST(CRC_CTL[1] CRC Engine Reset) to reload the new seed value to CRC controller.

Definition at line 70 of file crc.h.

◆ CRC_WRITE_DATA

#define CRC_WRITE_DATA (   u32Data)    (CRC->DAT = (u32Data))

CRC Write Data.

Parameters
[in]u32DataWrite data
Returns
None

User can write data directly to CRC Write Data Register(CRC_DAT) by this macro to perform CRC operation.

Definition at line 92 of file crc.h.

Function Documentation

◆ CRC_GetChecksum()

uint32_t CRC_GetChecksum ( void  )

Get CRC Checksum.

Parameters
[in]None
Returns
Checksum Result

This macro gets the CRC checksum result by current CRC polynomial mode.

Definition at line 65 of file crc.c.

◆ CRC_Open()

void CRC_Open ( uint32_t  u32Mode,
uint32_t  u32Attribute,
uint32_t  u32Seed,
uint32_t  u32DataLen 
)

CRC Open.

Parameters
[in]u32ModeCRC operation polynomial mode. Valid values are:
[in]u32AttributeCRC operation data attribute. Valid values are combined with:
[in]u32SeedSeed value.
[in]u32DataLenCPU Write Data Length. Valid values are:
Returns
None

This function will enable the CRC controller by specify CRC operation mode, attribute, initial seed and write data length.
After that, user can start to perform CRC calculate by calling CRC_WRITE_DATA macro or CRC_DAT register directly.

Definition at line 47 of file crc.c.