RTEMS 6.1-rc4
Loading...
Searching...
No Matches
stm32h7xx_hal_iwdg.h
Go to the documentation of this file.
1
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef STM32H7xx_HAL_IWDG_H
21#define STM32H7xx_HAL_IWDG_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* Includes ------------------------------------------------------------------*/
28#include "stm32h7xx_hal_def.h"
29
39/* Exported types ------------------------------------------------------------*/
48typedef struct
49{
50 uint32_t Prescaler;
53 uint32_t Reload;
56 uint32_t Window;
60
64typedef struct
65{
70
71
76/* Exported constants --------------------------------------------------------*/
86#define IWDG_PRESCALER_4 0x00000000u
87#define IWDG_PRESCALER_8 IWDG_PR_PR_0
88#define IWDG_PRESCALER_16 IWDG_PR_PR_1
89#define IWDG_PRESCALER_32 (IWDG_PR_PR_1 | IWDG_PR_PR_0)
90#define IWDG_PRESCALER_64 IWDG_PR_PR_2
91#define IWDG_PRESCALER_128 (IWDG_PR_PR_2 | IWDG_PR_PR_0)
92#define IWDG_PRESCALER_256 (IWDG_PR_PR_2 | IWDG_PR_PR_1)
101#define IWDG_WINDOW_DISABLE IWDG_WINR_WIN
110/* Exported macros -----------------------------------------------------------*/
121#define __HAL_IWDG_START(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_ENABLE)
122
129#define __HAL_IWDG_RELOAD_COUNTER(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_RELOAD)
130
135/* Exported functions --------------------------------------------------------*/
145/* Initialization/Start functions ********************************************/
146HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg);
155/* I/O operation functions ****************************************************/
156HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg);
165/* Private constants ---------------------------------------------------------*/
174#define IWDG_KEY_RELOAD 0x0000AAAAu
175#define IWDG_KEY_ENABLE 0x0000CCCCu
176#define IWDG_KEY_WRITE_ACCESS_ENABLE 0x00005555u
177#define IWDG_KEY_WRITE_ACCESS_DISABLE 0x00000000u
183/* Private macros ------------------------------------------------------------*/
194#define IWDG_ENABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_ENABLE)
195
201#define IWDG_DISABLE_WRITE_ACCESS(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->KR, IWDG_KEY_WRITE_ACCESS_DISABLE)
202
208#define IS_IWDG_PRESCALER(__PRESCALER__) (((__PRESCALER__) == IWDG_PRESCALER_4) || \
209 ((__PRESCALER__) == IWDG_PRESCALER_8) || \
210 ((__PRESCALER__) == IWDG_PRESCALER_16) || \
211 ((__PRESCALER__) == IWDG_PRESCALER_32) || \
212 ((__PRESCALER__) == IWDG_PRESCALER_64) || \
213 ((__PRESCALER__) == IWDG_PRESCALER_128)|| \
214 ((__PRESCALER__) == IWDG_PRESCALER_256))
215
221#define IS_IWDG_RELOAD(__RELOAD__) ((__RELOAD__) <= IWDG_RLR_RL)
222
228#define IS_IWDG_WINDOW(__WINDOW__) ((__WINDOW__) <= IWDG_WINR_WIN)
229
230
244#ifdef __cplusplus
245}
246#endif
247
248#endif /* STM32H7xx_HAL_IWDG_H */
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
IWDG Handle Structure definition.
Definition: stm32h7xx_hal_iwdg.h:65
IWDG_TypeDef * Instance
Definition: stm32h7xx_hal_iwdg.h:66
IWDG_InitTypeDef Init
Definition: stm32h7xx_hal_iwdg.h:68
IWDG Init structure definition.
Definition: stm32h7xx_hal_iwdg.h:49
uint32_t Window
Definition: stm32h7xx_hal_iwdg.h:56
uint32_t Prescaler
Definition: stm32h7xx_hal_iwdg.h:50
uint32_t Reload
Definition: stm32h7xx_hal_iwdg.h:53
Independent WATCHDOG.
Definition: stm32h723xx.h:1152