RTEMS 6.1-rc5
Loading...
Searching...
No Matches
stm32h7xx_ll_wwdg.h
Go to the documentation of this file.
1
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef STM32H7xx_LL_WWDG_H
21#define STM32H7xx_LL_WWDG_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* Includes ------------------------------------------------------------------*/
28#include "stm32h7xx.h"
29
34#if defined (WWDG1) || defined (WWDG2)
35
41/* Private types -------------------------------------------------------------*/
42/* Private variables ---------------------------------------------------------*/
43/* Private constants ---------------------------------------------------------*/
44/* Private macros ------------------------------------------------------------*/
45/* Exported types ------------------------------------------------------------*/
46/* Exported constants --------------------------------------------------------*/
57#define LL_WWDG_CFR_EWI WWDG_CFR_EWI
66#define LL_WWDG_PRESCALER_1 0x00000000u
67#define LL_WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0
68#define LL_WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1
69#define LL_WWDG_PRESCALER_8 (WWDG_CFR_WDGTB_0 | WWDG_CFR_WDGTB_1)
70#define LL_WWDG_PRESCALER_16 WWDG_CFR_WDGTB_2
71#define LL_WWDG_PRESCALER_32 (WWDG_CFR_WDGTB_2 | WWDG_CFR_WDGTB_0)
72#define LL_WWDG_PRESCALER_64 (WWDG_CFR_WDGTB_2 | WWDG_CFR_WDGTB_1)
73#define LL_WWDG_PRESCALER_128 (WWDG_CFR_WDGTB_2 | WWDG_CFR_WDGTB_1 | WWDG_CFR_WDGTB_0)
82/* Exported macro ------------------------------------------------------------*/
98#define LL_WWDG_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
99
106#define LL_WWDG_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
115/* Exported functions --------------------------------------------------------*/
135__STATIC_INLINE void LL_WWDG_Enable(WWDG_TypeDef *WWDGx)
136{
137 SET_BIT(WWDGx->CR, WWDG_CR_WDGA);
138}
139
146__STATIC_INLINE uint32_t LL_WWDG_IsEnabled(WWDG_TypeDef *WWDGx)
147{
148 return ((READ_BIT(WWDGx->CR, WWDG_CR_WDGA) == (WWDG_CR_WDGA)) ? 1UL : 0UL);
149}
150
162__STATIC_INLINE void LL_WWDG_SetCounter(WWDG_TypeDef *WWDGx, uint32_t Counter)
163{
164 MODIFY_REG(WWDGx->CR, WWDG_CR_T, Counter);
165}
166
173__STATIC_INLINE uint32_t LL_WWDG_GetCounter(WWDG_TypeDef *WWDGx)
174{
175 return (READ_BIT(WWDGx->CR, WWDG_CR_T));
176}
177
195__STATIC_INLINE void LL_WWDG_SetPrescaler(WWDG_TypeDef *WWDGx, uint32_t Prescaler)
196{
197 MODIFY_REG(WWDGx->CFR, WWDG_CFR_WDGTB, Prescaler);
198}
199
214__STATIC_INLINE uint32_t LL_WWDG_GetPrescaler(WWDG_TypeDef *WWDGx)
215{
216 return (READ_BIT(WWDGx->CFR, WWDG_CFR_WDGTB));
217}
218
235__STATIC_INLINE void LL_WWDG_SetWindow(WWDG_TypeDef *WWDGx, uint32_t Window)
236{
237 MODIFY_REG(WWDGx->CFR, WWDG_CFR_W, Window);
238}
239
246__STATIC_INLINE uint32_t LL_WWDG_GetWindow(WWDG_TypeDef *WWDGx)
247{
248 return (READ_BIT(WWDGx->CFR, WWDG_CFR_W));
249}
250
268__STATIC_INLINE uint32_t LL_WWDG_IsActiveFlag_EWKUP(WWDG_TypeDef *WWDGx)
269{
270 return ((READ_BIT(WWDGx->SR, WWDG_SR_EWIF) == (WWDG_SR_EWIF)) ? 1UL : 0UL);
271}
272
279__STATIC_INLINE void LL_WWDG_ClearFlag_EWKUP(WWDG_TypeDef *WWDGx)
280{
281 WRITE_REG(WWDGx->SR, ~WWDG_SR_EWIF);
282}
283
300__STATIC_INLINE void LL_WWDG_EnableIT_EWKUP(WWDG_TypeDef *WWDGx)
301{
302 SET_BIT(WWDGx->CFR, WWDG_CFR_EWI);
303}
304
311__STATIC_INLINE uint32_t LL_WWDG_IsEnabledIT_EWKUP(WWDG_TypeDef *WWDGx)
312{
313 return ((READ_BIT(WWDGx->CFR, WWDG_CFR_EWI) == (WWDG_CFR_EWI)) ? 1UL : 0UL);
314}
315
328#endif /* WWDG1 || WWDG2 */
329
334#ifdef __cplusplus
335}
336#endif
337
338#endif /* STM32H7xx_LL_WWDG_H */
#define WWDG_CFR_WDGTB
Definition: stm32h723xx.h:21536
#define WWDG_CR_T
Definition: stm32h723xx.h:21505
#define WWDG_CFR_EWI
Definition: stm32h723xx.h:21532
#define WWDG_SR_EWIF
Definition: stm32h723xx.h:21544
#define WWDG_CR_WDGA
Definition: stm32h723xx.h:21516
#define WWDG_CFR_W
Definition: stm32h723xx.h:21521
CMSIS STM32H7xx Device Peripheral Access Layer Header File.
Window WATCHDOG.
Definition: stm32h723xx.h:1633
__IO uint32_t SR
Definition: stm32h723xx.h:1636
__IO uint32_t CR
Definition: stm32h723xx.h:1634
__IO uint32_t CFR
Definition: stm32h723xx.h:1635