Go to the documentation of this file.
21 #ifndef STM32H7xx_HAL_CRC_H
22 #define STM32H7xx_HAL_CRC_H
134 #define DEFAULT_CRC32_POLY 0x04C11DB7U
142 #define DEFAULT_CRC_INITVALUE 0xFFFFFFFFU
150 #define DEFAULT_POLYNOMIAL_ENABLE ((uint8_t)0x00U)
151 #define DEFAULT_POLYNOMIAL_DISABLE ((uint8_t)0x01U)
159 #define DEFAULT_INIT_VALUE_ENABLE ((uint8_t)0x00U)
160 #define DEFAULT_INIT_VALUE_DISABLE ((uint8_t)0x01U)
168 #define CRC_POLYLENGTH_32B 0x00000000U
169 #define CRC_POLYLENGTH_16B CRC_CR_POLYSIZE_0
170 #define CRC_POLYLENGTH_8B CRC_CR_POLYSIZE_1
171 #define CRC_POLYLENGTH_7B CRC_CR_POLYSIZE
179 #define HAL_CRC_LENGTH_32B 32U
180 #define HAL_CRC_LENGTH_16B 16U
181 #define HAL_CRC_LENGTH_8B 8U
182 #define HAL_CRC_LENGTH_7B 7U
194 #define CRC_INPUTDATA_FORMAT_UNDEFINED 0x00000000U
195 #define CRC_INPUTDATA_FORMAT_BYTES 0x00000001U
196 #define CRC_INPUTDATA_FORMAT_HALFWORDS 0x00000002U
197 #define CRC_INPUTDATA_FORMAT_WORDS 0x00000003U
205 #define HAL_CRC_Input_Data_Reverse HAL_CRCEx_Input_Data_Reverse
206 #define HAL_CRC_Output_Data_Reverse HAL_CRCEx_Output_Data_Reverse
224 #define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET)
231 #define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET)
239 #define __HAL_CRC_INITIALCRCVALUE_CONFIG(__HANDLE__, __INIT__) ((__HANDLE__)->Instance->INIT = (__INIT__))
248 #define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (WRITE_REG((__HANDLE__)->Instance->IDR, (__VALUE__)))
256 #define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR)
267 #define IS_DEFAULT_POLYNOMIAL(DEFAULT) (((DEFAULT) == DEFAULT_POLYNOMIAL_ENABLE) || \
268 ((DEFAULT) == DEFAULT_POLYNOMIAL_DISABLE))
270 #define IS_DEFAULT_INIT_VALUE(VALUE) (((VALUE) == DEFAULT_INIT_VALUE_ENABLE) || \
271 ((VALUE) == DEFAULT_INIT_VALUE_DISABLE))
273 #define IS_CRC_POL_LENGTH(LENGTH) (((LENGTH) == CRC_POLYLENGTH_32B) || \
274 ((LENGTH) == CRC_POLYLENGTH_16B) || \
275 ((LENGTH) == CRC_POLYLENGTH_8B) || \
276 ((LENGTH) == CRC_POLYLENGTH_7B))
278 #define IS_CRC_INPUTDATA_FORMAT(FORMAT) (((FORMAT) == CRC_INPUTDATA_FORMAT_BYTES) || \
279 ((FORMAT) == CRC_INPUTDATA_FORMAT_HALFWORDS) || \
280 ((FORMAT) == CRC_INPUTDATA_FORMAT_WORDS))
uint32_t InputDataInversionMode
HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc)
HAL_StatusTypeDef
HAL Status structures definition
uint8_t DefaultInitValueUse
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_LockTypeDef
HAL Lock structures definition
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
__IO HAL_CRC_StateTypeDef State
uint32_t GeneratingPolynomial
CRC Handle Structure definition.
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
Header file of CRC HAL extended module.
HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc)
HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc)
uint8_t DefaultPolynomialUse
uint32_t OutputDataInversionMode
CRC Init Structure definition.
void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc)
CRC MSP Initialization This function configures the hardware resources used in this example.
HAL_CRC_StateTypeDef
CRC HAL State Structure definition.
void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc)
CRC MSP De-Initialization This function freeze the hardware resources used in this example.