| NANO100_BSP V3.05.000 The Board Support Package for Nano100BN Series

Macros | Functions
CRC Exported Functions
NANO100 Device Driver » CRC Driver » CRC Exported Constants
Collaboration diagram for CRC Exported Functions:

## Macros
#define | CRC_ENABLE_INT(u32Mask) (PDMACRC->DMAIER |= (u32Mask))
| Enable CRC Interrupt. More...
#define | CRC_DISABLE_INT(u32Mask) (PDMACRC->DMAIER &= ~(u32Mask))
| Disable CRC Interrupt. More...
#define | CRC_GET_INT_FLAG() ((uint32_t)(PDMACRC->DMAISR))
| Get CRC Interrupt Flag. More...
#define | CRC_CLR_INT_FLAG(u32Mask) (PDMACRC->DMAISR |= (u32Mask))
| Clear CRC Interrupt Flag. More...
#define | CRC_SET_SEED(u32Seed) { PDMACRC->SEED = (u32Seed); PDMACRC->CTL |= DMA_CRC_CTL_CRC_RST_Msk; }
| Set CRC seed value. More...
#define | CRC_GET_SEED() ((uint32_t)(PDMACRC->SEED))
| Get CRC Seed value. More...
#define | CRC_WRITE_DATA(u32Data) (PDMACRC->WDATA = (u32Data))
| CRC write data. More...

## Functions
void | CRC_Open (uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen)
| CRC Open. More...
void | CRC_StartDMATransfer (uint32_t u32SrcAddr, uint32_t u32ByteCount)
| CRC Start DMA transfer. More...
uint32_t | CRC_GetChecksum (void)
| Get CRC Checksum. More...

## Detailed Description

## Macro Definition Documentation

## ◆ CRC_CLR_INT_FLAG

#define CRC_CLR_INT_FLAG | ( |  | u32Mask | ) | (PDMACRC->DMAISR |= (u32Mask))

Clear CRC Interrupt Flag.

Parameters

  [in] | u32Mask | Interrupt mask

Returns
  None

This macro clear the interrupt flag.

Definition at line 105 of file crc.h.

## ◆ CRC_DISABLE_INT

#define CRC_DISABLE_INT | ( |  | u32Mask | ) | (PDMACRC->DMAIER &= ~(u32Mask))

Disable CRC Interrupt.

Parameters

  [in] | u32Mask | Interrupt mask

Returns
  None

This macro disable the interrupts.

Definition at line 83 of file crc.h.

## ◆ CRC_ENABLE_INT

#define CRC_ENABLE_INT | ( |  | u32Mask | ) | (PDMACRC->DMAIER |= (u32Mask))

Enable CRC Interrupt.

Parameters

  [in] | u32Mask | Interrupt mask

Returns
  None

This macro enable the interrupts.

Definition at line 72 of file crc.h.

## ◆ CRC_GET_INT_FLAG

#define CRC_GET_INT_FLAG | ( |  | ) | ((uint32_t)(PDMACRC->DMAISR))

Get CRC Interrupt Flag.

Parameters

  [in] | None |

Returns
  Interrupt Flag

This macro gets the interrupt flag.

Definition at line 94 of file crc.h.

## ◆ CRC_GET_SEED

#define CRC_GET_SEED | ( |  | ) | ((uint32_t)(PDMACRC->SEED))

Get CRC Seed value.

Parameters

  [in] | None |

Returns
  Seed Value

This macro gets the seed value.

Definition at line 127 of file crc.h.

## ◆ CRC_SET_SEED

#define CRC_SET_SEED | ( |  | u32Seed | ) | { PDMACRC->SEED = (u32Seed); PDMACRC->CTL |= DMA_CRC_CTL_CRC_RST_Msk; }

Set CRC seed value.

Parameters

  [in] | u32Seed | Seed value

Returns
  None

This macro set seed value.

Definition at line 116 of file crc.h.

## ◆ CRC_WRITE_DATA

#define CRC_WRITE_DATA | ( |  | u32Data | ) | (PDMACRC->WDATA = (u32Data))

CRC write data.

Parameters

  [in] | u32Data | write data

Returns
  None

This macro write CRC data.

Definition at line 138 of file crc.h.

## Function Documentation

## ◆ CRC_GetChecksum()

uint32_t CRC_GetChecksum | ( | void |  | ) |

Get CRC Checksum.

Parameters

  [in] | None |

Returns
  Checksum

This macro get the CRC checksum

Definition at line 76 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 Polynomial Mode CRC_CCITT, CRC_8, CRC_16, CRC_32
  [in] | u32Attribute | Parameter attribute CRC_CHECKSUM_COM, CRC_CHECKSUM_RVS, CRC_WDATA_COM, CRC_WDATA_RVS
  [in] | u32Seed | Seed value
  [in] | u32DataLen | CPU Write Data Length CRC_CPU_WDATA_8, CRC_CPU_WDATA_16, CRC_CPU_WDATA_32

Returns
  None

This function enable the CRC channel.

Definition at line 41 of file crc.c.

## ◆ CRC_StartDMATransfer()

void CRC_StartDMATransfer | ( | uint32_t | u32SrcAddr,
|  | uint32_t | u32ByteCount
| ) |  |

CRC Start DMA transfer.

Parameters

  [in] | u32SrcAddr | Source address
  [in] | u32ByteCount | Calculate byte count

Returns
  None

This function start DMA transfer.

Definition at line 60 of file crc.c.