| NUC472_NUC442_BSP V3.03.003 The Board Support Package for NUC472/NUC442

Macros | Functions
CRC Exported Functions
NUC472/NUC442 Device Driver » CRC Driver » CRC Exported Constants
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 85 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] | u32Seed | Seed 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 74 of file crc.h.

## ◆ CRC_WRITE_DATA

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

CRC Write Data.

Parameters

  [in] | u32Data | Write 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 96 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 68 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] | u32Mode | CRC operation polynomial mode. Valid values are: CRC_CCITT CRC_8 CRC_16 CRC_32
  [in] | u32Attribute | CRC operation data attribute. Valid values are combined with: CRC_CHECKSUM_COM CRC_CHECKSUM_RVS CRC_WDATA_COM CRC_WDATA_RVS
  [in] | u32Seed | Seed value.
  [in] | u32DataLen | CPU Write Data Length. Valid values are: CRC_CPU_WDATA_8 CRC_CPU_WDATA_16 CRC_CPU_WDATA_32

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 50 of file crc.c.