STM32F37 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
stm32f37x_crc.h
Go to the documentation of this file.
1 
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F37X_CRC_H
31 #define __STM32F37X_CRC_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
38 #include "stm32f37x.h"
39 
48 /* Exported types ------------------------------------------------------------*/
49 /* Exported constants --------------------------------------------------------*/
50 
54 #define CRC_ReverseInputData_No ((uint32_t)0x00000000)
55 #define CRC_ReverseInputData_8bits CRC_CR_REV_IN_0
56 #define CRC_ReverseInputData_16bits CRC_CR_REV_IN_1
57 #define CRC_ReverseInputData_32bits CRC_CR_REV_IN
59 #define IS_CRC_REVERSE_INPUT_DATA(DATA) (((DATA) == CRC_ReverseInputData_No) || \
60  ((DATA) == CRC_ReverseInputData_8bits) || \
61  ((DATA) == CRC_ReverseInputData_16bits) || \
62  ((DATA) == CRC_ReverseInputData_32bits))
63 
71 #define CRC_PolSize_7 CRC_CR_POLSIZE
72 #define CRC_PolSize_8 CRC_CR_POLSIZE_1
73 #define CRC_PolSize_16 CRC_CR_POLSIZE_0
74 #define CRC_PolSize_32 ((uint32_t)0x00000000)
76 #define IS_CRC_POL_SIZE(SIZE) (((SIZE) == CRC_PolSize_7) || \
77  ((SIZE) == CRC_PolSize_8) || \
78  ((SIZE) == CRC_PolSize_16) || \
79  ((SIZE) == CRC_PolSize_32))
80 
85 /* Exported macro ------------------------------------------------------------*/
86 /* Exported functions ------------------------------------------------------- */
87 /* Configuration of the CRC computation unit **********************************/
88 void CRC_DeInit(void);
89 void CRC_ResetDR(void);
90 void CRC_PolynomialSizeSelect(uint32_t CRC_PolSize);
91 void CRC_ReverseInputDataSelect(uint32_t CRC_ReverseInputData);
92 void CRC_ReverseOutputDataCmd(FunctionalState NewState);
93 void CRC_SetInitRegister(uint32_t CRC_InitValue);
94 void CRC_SetPolynomial(uint32_t CRC_Pol);
95 
96 /* CRC computation ************************************************************/
97 uint32_t CRC_CalcCRC(uint32_t CRC_Data);
98 uint32_t CRC_CalcCRC16bits(uint16_t CRC_Data);
99 uint32_t CRC_CalcCRC8bits(uint8_t CRC_Data);
100 uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength);
101 uint32_t CRC_GetCRC(void);
102 
103 /* Independent register (IDR) access (write/read) *****************************/
104 void CRC_SetIDRegister(uint8_t CRC_IDValue);
105 uint8_t CRC_GetIDRegister(void);
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif /* __STM32F37X_CRC_H */
112 
121 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/