stm32h7xx_hal_crc.h
Go to the documentation of this file.
1 
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32H7xx_HAL_CRC_H
22 #define STM32H7xx_HAL_CRC_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32h7xx_hal_def.h"
30 
39 /* Exported types ------------------------------------------------------------*/
47 typedef enum
48 {
55 
59 typedef struct
60 {
77  uint32_t CRCLength;
84  uint32_t InitValue;
99 
103 typedef struct
104 {
113  uint32_t InputDataFormat;
126 /* Exported constants --------------------------------------------------------*/
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
190 /* WARNING: CRC_INPUT_FORMAT_UNDEFINED is created for reference purposes but
191  * an error is triggered in HAL_CRC_Init() if InputDataFormat field is set
192  * to CRC_INPUT_FORMAT_UNDEFINED: the format MUST be defined by the user for
193  * the CRC APIs to provide a correct result */
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
215 /* Exported macros -----------------------------------------------------------*/
216 
224 #define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET)
225 
231 #define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET)
232 
239 #define __HAL_CRC_INITIALCRCVALUE_CONFIG(__HANDLE__, __INIT__) ((__HANDLE__)->Instance->INIT = (__INIT__))
240 
248 #define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (WRITE_REG((__HANDLE__)->Instance->IDR, (__VALUE__)))
249 
256 #define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR)
257 
262 /* Private macros --------------------------------------------------------*/
267 #define IS_DEFAULT_POLYNOMIAL(DEFAULT) (((DEFAULT) == DEFAULT_POLYNOMIAL_ENABLE) || \
268  ((DEFAULT) == DEFAULT_POLYNOMIAL_DISABLE))
269 
270 #define IS_DEFAULT_INIT_VALUE(VALUE) (((VALUE) == DEFAULT_INIT_VALUE_ENABLE) || \
271  ((VALUE) == DEFAULT_INIT_VALUE_DISABLE))
272 
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))
277 
278 #define IS_CRC_INPUTDATA_FORMAT(FORMAT) (((FORMAT) == CRC_INPUTDATA_FORMAT_BYTES) || \
279  ((FORMAT) == CRC_INPUTDATA_FORMAT_HALFWORDS) || \
280  ((FORMAT) == CRC_INPUTDATA_FORMAT_WORDS))
281 
286 /* Include CRC HAL Extended module */
287 #include "stm32h7xx_hal_crc_ex.h"
288 
289 /* Exported functions --------------------------------------------------------*/
294 /* Initialization and de-initialization functions ****************************/
306 /* Peripheral Control functions ***********************************************/
310 uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
311 uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);
316 /* Peripheral State and Error functions ***************************************/
337 #ifdef __cplusplus
338 }
339 #endif
340 
341 #endif /* STM32H7xx_HAL_CRC_H */
342 
343 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
CRC_InitTypeDef::InputDataInversionMode
uint32_t InputDataInversionMode
Definition: stm32h7xx_hal_crc.h:87
__IO
#define __IO
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:237
HAL_CRC_Init
HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc)
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
HAL_CRC_STATE_RESET
@ HAL_CRC_STATE_RESET
Definition: stm32h7xx_hal_crc.h:49
CRC_InitTypeDef::DefaultInitValueUse
uint8_t DefaultInitValueUse
Definition: stm32h7xx_hal_crc.h:67
stm32h7xx_hal_def.h
This file contains HAL common defines, enumeration, macros and structures definitions.
CRC_HandleTypeDef::InputDataFormat
uint32_t InputDataFormat
Definition: stm32h7xx_hal_crc.h:113
HAL_LockTypeDef
HAL_LockTypeDef
HAL Lock structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:51
HAL_CRC_STATE_TIMEOUT
@ HAL_CRC_STATE_TIMEOUT
Definition: stm32h7xx_hal_crc.h:52
HAL_CRC_STATE_BUSY
@ HAL_CRC_STATE_BUSY
Definition: stm32h7xx_hal_crc.h:51
HAL_CRC_STATE_ERROR
@ HAL_CRC_STATE_ERROR
Definition: stm32h7xx_hal_crc.h:53
HAL_CRC_Accumulate
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
CRC_TypeDef
CRC calculation unit.
Definition: stm32f407xx.h:280
CRC_HandleTypeDef::Lock
HAL_LockTypeDef Lock
Definition: stm32h7xx_hal_crc.h:109
CRC_HandleTypeDef::State
__IO HAL_CRC_StateTypeDef State
Definition: stm32h7xx_hal_crc.h:111
CRC_InitTypeDef::GeneratingPolynomial
uint32_t GeneratingPolynomial
Definition: stm32h7xx_hal_crc.h:72
CRC_InitTypeDef::InitValue
uint32_t InitValue
Definition: stm32h7xx_hal_crc.h:84
CRC_HandleTypeDef
CRC Handle Structure definition.
Definition: stm32h7xx_hal_crc.h:103
CRC_HandleTypeDef::Init
CRC_InitTypeDef Init
Definition: stm32h7xx_hal_crc.h:107
HAL_CRC_STATE_READY
@ HAL_CRC_STATE_READY
Definition: stm32h7xx_hal_crc.h:50
HAL_CRC_Calculate
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
stm32h7xx_hal_crc_ex.h
Header file of CRC HAL extended module.
CRC_InitTypeDef::CRCLength
uint32_t CRCLength
Definition: stm32h7xx_hal_crc.h:77
HAL_CRC_DeInit
HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc)
HAL_CRC_GetState
HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc)
CRC_HandleTypeDef::Instance
CRC_TypeDef * Instance
Definition: stm32h7xx_hal_crc.h:105
CRC_InitTypeDef::DefaultPolynomialUse
uint8_t DefaultPolynomialUse
Definition: stm32h7xx_hal_crc.h:61
CRC_InitTypeDef::OutputDataInversionMode
uint32_t OutputDataInversionMode
Definition: stm32h7xx_hal_crc.h:94
CRC_InitTypeDef
CRC Init Structure definition.
Definition: stm32h7xx_hal_crc.h:59
HAL_CRC_MspInit
void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc)
CRC MSP Initialization This function configures the hardware resources used in this example.
Definition: stm32h7xx_hal_msp.c:86
HAL_CRC_StateTypeDef
HAL_CRC_StateTypeDef
CRC HAL State Structure definition.
Definition: stm32h7xx_hal_crc.h:47
HAL_CRC_MspDeInit
void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc)
CRC MSP De-Initialization This function freeze the hardware resources used in this example.
Definition: stm32h7xx_hal_msp.c:108
hcrc
CRC_HandleTypeDef hcrc
Definition: stm32h735/stm32h735g-dk/Src/pv_audio_rec.c:36


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:54