A31G12x F/W Packages  2.5.0
ABOV Cortex-M0+ Core based MCUs Integrated Driver
A31G12x_hal_crc.h
Go to the documentation of this file.
1 /***************************************************************************//****************************************************************************/
34 
35 #ifndef _CRC_H_
36 #define _CRC_H_
37 
38 #include "A31G12x.h"
39 #include "A31G12x_hal_aa_types.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 //******************************************************************************
46 // Constant
47 //******************************************************************************
48 
49 // User/Auto Mode Selection Control
50 /*
51 #define CRC_USER_M (0x0uL << 7)
52 #define CRC_AUTO_M (0x1uL << 7)
53 */
54 #define MODS_UserMode (CRC_CR_MODS_UserMode << CRC_CR_MODS_Pos)
55 #define MODS_AutoMode (CRC_CR_MODS_AutoMode << CRC_CR_MODS_Pos)
56 
57 //---------- CRC/Checksum RLT Clear Constant Definition ----------
58 #define CRC_RLTCLR (0x1uL << 6)
59 
60 //---------- CRC/Checksum Selection Constant Definition ----------
61 #define CRC_CRC (0x0uL << 5)
62 #define CRC_CHECKSUM (0x1uL << 5)
63 
64 //---------- CRC Polynominal Constant Definition ----------
65 #define CRC_CCITT (0x0uL << 4)
66 #define CRC_16 (0x1uL << 4)
67 
68 //---------- CRC/Checksum Start Address Auto Increment Constant Definition ----------
69 #define CRC_NOINC (0x0uL << 3)
70 #define CRC_AUTOINC (0x1uL << 3)
71 
72 //---------- CRC/Checksum 1st Shifted-in Bit Constant Definition ----------
73 #define CRC_MSB (0x0uL << 1)
74 #define CRC_LSB (0x1uL << 1)
75 
76 //******************************************************************************
77 // Macro
78 //******************************************************************************
79 
80 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
86 #define CRC_InData( u32InData ) (CRC->IN = u32InData)
87 
88 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
92 #define CRCRun() { CRC->CR_b.CRCRUN = 1; NOP(); NOP(); NOP(); NOP(); }
93 
94 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
98 #define CRCStop() (CRC->CR_b.CRCRUN = 0)
99 
100 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
104 #define ChkCRCFinish() (CRC->CR_b.CRCRUN)
105 
106 //******************************************************************************
107 // Function
108 //******************************************************************************
109 
112 
113 HAL_Status_Type HAL_CRC_SetAddress( uint32_t u32SAdr, uint32_t u32EAdr, uint32_t u32IniD );
114 
115 uint32_t HAL_CRC_ConfigAutoMode( uint32_t u32SEL, uint32_t u32POLY, uint32_t u32FirstBit );
116 HAL_Status_Type HAL_CRC_ConfigUserMode( uint32_t u32SEL, uint32_t u32POLY, uint32_t u32AdrInc, uint32_t u32FirstBit );
117 uint32_t HAL_CRC_UserInput( uint32_t u32Input );
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /* _CRC_H_ */
124 
HAL_Status_Type HAL_CRC_Init(void)
Initialize CRC/Checksum peripheral.
HAL_Status_Type HAL_CRC_SetAddress(uint32_t u32SAdr, uint32_t u32EAdr, uint32_t u32IniD)
Set CRC/Checksum Address.
Contains the ABOV typedefs for C standard types. It is intended to be used in ISO C conforming develo...
HAL_Status_Type
uint32_t HAL_CRC_ConfigAutoMode(uint32_t u32SEL, uint32_t u32POLY, uint32_t u32FirstBit)
CRC/Checksum Auto Mode Start and Result.
HAL_Status_Type HAL_CRC_ConfigUserMode(uint32_t u32SEL, uint32_t u32POLY, uint32_t u32AdrInc, uint32_t u32FirstBit)
CRC/Checksum User Mode Start.
uint32_t HAL_CRC_UserInput(uint32_t u32Input)
CRC/Checksum Input on User Mode.
HAL_Status_Type HAL_CRC_DeInit(void)
DeInitialize CRC peripheral.