M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
crc.h
Go to the documentation of this file.
1/**************************************************************************/
8#ifndef __CRC_H__
9#define __CRC_H__
10
11#ifdef __cplusplus
12extern "C"
13{
14#endif
15
16
28/*---------------------------------------------------------------------------------------------------------*/
29/* CRC Polynomial Mode Constant Definitions */
30/*---------------------------------------------------------------------------------------------------------*/
31#define CRC_CCITT 0x00000000UL
32#define CRC_8 0x40000000UL
33#define CRC_16 0x80000000UL
34#define CRC_32 0xC0000000UL
36/*---------------------------------------------------------------------------------------------------------*/
37/* Checksum, Write data Constant Definitions */
38/*---------------------------------------------------------------------------------------------------------*/
39#define CRC_CHECKSUM_COM 0x08000000UL
40#define CRC_CHECKSUM_RVS 0x02000000UL
41#define CRC_WDATA_COM 0x04000000UL
42#define CRC_WDATA_RVS 0x01000000UL
44/*---------------------------------------------------------------------------------------------------------*/
45/* CPU Write Data Length Constant Definitions */
46/*---------------------------------------------------------------------------------------------------------*/
47#define CRC_CPU_WDATA_8 0x00000000UL
48#define CRC_CPU_WDATA_16 0x10000000UL
49#define CRC_CPU_WDATA_32 0x20000000UL /* end of group CRC_EXPORTED_CONSTANTS */
52
53
70#define CRC_SET_SEED(u32Seed) { CRC->SEED = (u32Seed); CRC->CTL |= CRC_CTL_CRCRST_Msk; }
71
81#define CRC_GET_SEED() (CRC->SEED)
82
92#define CRC_WRITE_DATA(u32Data) (CRC->DAT = (u32Data))
93
94void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen);
95uint32_t CRC_GetChecksum(void);
96 /* end of group CRC_EXPORTED_FUNCTIONS */
98 /* end of group CRC_Driver */
100 /* end of group Standard_Driver */
102
103#ifdef __cplusplus
104}
105#endif
106
107#endif //__CRC_H__
void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen)
CRC Open.
Definition: crc.c:47
uint32_t CRC_GetChecksum(void)
Get CRC Checksum.
Definition: crc.c:65