20#ifndef STM32H7xx_HAL_CRC_H
21#define STM32H7xx_HAL_CRC_H
147#define DEFAULT_CRC32_POLY 0x04C11DB7U
156#define DEFAULT_CRC_INITVALUE 0xFFFFFFFFU
165#define DEFAULT_POLYNOMIAL_ENABLE ((uint8_t)0x00U)
166#define DEFAULT_POLYNOMIAL_DISABLE ((uint8_t)0x01U)
175#define DEFAULT_INIT_VALUE_ENABLE ((uint8_t)0x00U)
176#define DEFAULT_INIT_VALUE_DISABLE ((uint8_t)0x01U)
185#define CRC_POLYLENGTH_32B 0x00000000U
186#define CRC_POLYLENGTH_16B CRC_CR_POLYSIZE_0
187#define CRC_POLYLENGTH_8B CRC_CR_POLYSIZE_1
188#define CRC_POLYLENGTH_7B CRC_CR_POLYSIZE
197#define HAL_CRC_LENGTH_32B 32U
198#define HAL_CRC_LENGTH_16B 16U
199#define HAL_CRC_LENGTH_8B 8U
200#define HAL_CRC_LENGTH_7B 7U
213#define CRC_INPUTDATA_FORMAT_UNDEFINED 0x00000000U
214#define CRC_INPUTDATA_FORMAT_BYTES 0x00000001U
215#define CRC_INPUTDATA_FORMAT_HALFWORDS 0x00000002U
216#define CRC_INPUTDATA_FORMAT_WORDS 0x00000003U
235#define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET)
242#define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET)
250#define __HAL_CRC_INITIALCRCVALUE_CONFIG(__HANDLE__, __INIT__) ((__HANDLE__)->Instance->INIT = (__INIT__))
259#define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (WRITE_REG((__HANDLE__)->Instance->IDR, (__VALUE__)))
267#define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR)
279#define IS_DEFAULT_POLYNOMIAL(DEFAULT) (((DEFAULT) == DEFAULT_POLYNOMIAL_ENABLE) || \
280 ((DEFAULT) == DEFAULT_POLYNOMIAL_DISABLE))
282#define IS_DEFAULT_INIT_VALUE(VALUE) (((VALUE) == DEFAULT_INIT_VALUE_ENABLE) || \
283 ((VALUE) == DEFAULT_INIT_VALUE_DISABLE))
285#define IS_CRC_POL_LENGTH(LENGTH) (((LENGTH) == CRC_POLYLENGTH_32B) || \
286 ((LENGTH) == CRC_POLYLENGTH_16B) || \
287 ((LENGTH) == CRC_POLYLENGTH_8B) || \
288 ((LENGTH) == CRC_POLYLENGTH_7B))
290#define IS_CRC_INPUTDATA_FORMAT(FORMAT) (((FORMAT) == CRC_INPUTDATA_FORMAT_BYTES) || \
291 ((FORMAT) == CRC_INPUTDATA_FORMAT_HALFWORDS) || \
292 ((FORMAT) == CRC_INPUTDATA_FORMAT_WORDS))
325uint32_t HAL_CRC_Accumulate(
CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
326uint32_t HAL_CRC_Calculate(
CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
#define __IO
Definition: core_cm4.h:239
HAL_CRC_StateTypeDef
CRC HAL State Structure definition.
Definition: stm32h7xx_hal_crc.h:48
@ HAL_CRC_STATE_RESET
Definition: stm32h7xx_hal_crc.h:49
@ HAL_CRC_STATE_TIMEOUT
Definition: stm32h7xx_hal_crc.h:52
@ HAL_CRC_STATE_BUSY
Definition: stm32h7xx_hal_crc.h:51
@ HAL_CRC_STATE_READY
Definition: stm32h7xx_hal_crc.h:50
@ HAL_CRC_STATE_ERROR
Definition: stm32h7xx_hal_crc.h:53
Header file of CRC HAL extended module.
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
HAL_LockTypeDef
HAL Lock structures definition.
Definition: stm32h7xx_hal_def.h:58
CRC Handle Structure definition.
Definition: stm32h7xx_hal_crc.h:111
__IO HAL_CRC_StateTypeDef State
Definition: stm32h7xx_hal_crc.h:118
uint32_t InputDataFormat
Definition: stm32h7xx_hal_crc.h:120
CRC_TypeDef * Instance
Definition: stm32h7xx_hal_crc.h:112
HAL_LockTypeDef Lock
Definition: stm32h7xx_hal_crc.h:116
CRC_InitTypeDef Init
Definition: stm32h7xx_hal_crc.h:114
CRC Init Structure definition.
Definition: stm32h7xx_hal_crc.h:60
uint32_t GeneratingPolynomial
Definition: stm32h7xx_hal_crc.h:74
uint32_t OutputDataInversionMode
Definition: stm32h7xx_hal_crc.h:100
uint8_t DefaultPolynomialUse
Definition: stm32h7xx_hal_crc.h:61
uint32_t InputDataInversionMode
Definition: stm32h7xx_hal_crc.h:90
uint32_t InitValue
Definition: stm32h7xx_hal_crc.h:87
uint32_t CRCLength
Definition: stm32h7xx_hal_crc.h:80
uint8_t DefaultInitValueUse
Definition: stm32h7xx_hal_crc.h:69
CRC calculation unit.
Definition: stm32h723xx.h:442