STM32F4xx_HAL_Driver  1.8.3
stm32f4xx_ll_wwdg.h
Go to the documentation of this file.
1 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32F4xx_LL_WWDG_H
21 #define STM32F4xx_LL_WWDG_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32f4xx.h"
29 
34 #if defined (WWDG)
35 
40 /* Private types -------------------------------------------------------------*/
41 /* Private variables ---------------------------------------------------------*/
42 /* Private constants ---------------------------------------------------------*/
43 /* Private macros ------------------------------------------------------------*/
44 /* Exported types ------------------------------------------------------------*/
45 /* Exported constants --------------------------------------------------------*/
54 #define LL_WWDG_CFR_EWI WWDG_CFR_EWI
62 #define LL_WWDG_PRESCALER_1 0x00000000u
63 #define LL_WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0
64 #define LL_WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1
65 #define LL_WWDG_PRESCALER_8 (WWDG_CFR_WDGTB_0 | WWDG_CFR_WDGTB_1)
74 /* Exported macro ------------------------------------------------------------*/
88 #define LL_WWDG_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
89 
96 #define LL_WWDG_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
105 /* Exported functions --------------------------------------------------------*/
123 __STATIC_INLINE void LL_WWDG_Enable(WWDG_TypeDef *WWDGx)
124 {
125  SET_BIT(WWDGx->CR, WWDG_CR_WDGA);
126 }
127 
134 __STATIC_INLINE uint32_t LL_WWDG_IsEnabled(WWDG_TypeDef *WWDGx)
135 {
136  return ((READ_BIT(WWDGx->CR, WWDG_CR_WDGA) == (WWDG_CR_WDGA)) ? 1UL : 0UL);
137 }
138 
150 __STATIC_INLINE void LL_WWDG_SetCounter(WWDG_TypeDef *WWDGx, uint32_t Counter)
151 {
152  MODIFY_REG(WWDGx->CR, WWDG_CR_T, Counter);
153 }
154 
161 __STATIC_INLINE uint32_t LL_WWDG_GetCounter(WWDG_TypeDef *WWDGx)
162 {
163  return (READ_BIT(WWDGx->CR, WWDG_CR_T));
164 }
165 
179 __STATIC_INLINE void LL_WWDG_SetPrescaler(WWDG_TypeDef *WWDGx, uint32_t Prescaler)
180 {
181  MODIFY_REG(WWDGx->CFR, WWDG_CFR_WDGTB, Prescaler);
182 }
183 
194 __STATIC_INLINE uint32_t LL_WWDG_GetPrescaler(WWDG_TypeDef *WWDGx)
195 {
196  return (READ_BIT(WWDGx->CFR, WWDG_CFR_WDGTB));
197 }
198 
215 __STATIC_INLINE void LL_WWDG_SetWindow(WWDG_TypeDef *WWDGx, uint32_t Window)
216 {
217  MODIFY_REG(WWDGx->CFR, WWDG_CFR_W, Window);
218 }
219 
226 __STATIC_INLINE uint32_t LL_WWDG_GetWindow(WWDG_TypeDef *WWDGx)
227 {
228  return (READ_BIT(WWDGx->CFR, WWDG_CFR_W));
229 }
230 
247 __STATIC_INLINE uint32_t LL_WWDG_IsActiveFlag_EWKUP(WWDG_TypeDef *WWDGx)
248 {
249  return ((READ_BIT(WWDGx->SR, WWDG_SR_EWIF) == (WWDG_SR_EWIF)) ? 1UL : 0UL);
250 }
251 
258 __STATIC_INLINE void LL_WWDG_ClearFlag_EWKUP(WWDG_TypeDef *WWDGx)
259 {
260  WRITE_REG(WWDGx->SR, ~WWDG_SR_EWIF);
261 }
262 
278 __STATIC_INLINE void LL_WWDG_EnableIT_EWKUP(WWDG_TypeDef *WWDGx)
279 {
280  SET_BIT(WWDGx->CFR, WWDG_CFR_EWI);
281 }
282 
289 __STATIC_INLINE uint32_t LL_WWDG_IsEnabledIT_EWKUP(WWDG_TypeDef *WWDGx)
290 {
291  return ((READ_BIT(WWDGx->CFR, WWDG_CFR_EWI) == (WWDG_CFR_EWI)) ? 1UL : 0UL);
292 }
293 
306 #endif /* WWDG */
307 
312 #ifdef __cplusplus
313 }
314 #endif
315 
316 #endif /* STM32F4xx_LL_WWDG_H */
__STATIC_INLINE void LL_WWDG_SetCounter(WWDG_TypeDef *WWDGx, uint32_t Counter)
Set the Watchdog counter value to provided value (7-bits T[6:0])
__STATIC_INLINE uint32_t LL_WWDG_GetCounter(WWDG_TypeDef *WWDGx)
Return current Watchdog Counter Value (7 bits counter value) @rmtoll CR T LL_WWDG_GetCounter.
__STATIC_INLINE void LL_WWDG_Enable(WWDG_TypeDef *WWDGx)
Enable Window Watchdog. The watchdog is always disabled after a reset.
__STATIC_INLINE void LL_WWDG_SetPrescaler(WWDG_TypeDef *WWDGx, uint32_t Prescaler)
Set the time base of the prescaler (WDGTB).
__STATIC_INLINE uint32_t LL_WWDG_GetWindow(WWDG_TypeDef *WWDGx)
Return current Watchdog Window Value (7 bits value) @rmtoll CFR W LL_WWDG_GetWindow.
__STATIC_INLINE void LL_WWDG_SetWindow(WWDG_TypeDef *WWDGx, uint32_t Window)
Set the Watchdog Window value to be compared to the downcounter (7-bits W[6:0]).
__STATIC_INLINE uint32_t LL_WWDG_GetPrescaler(WWDG_TypeDef *WWDGx)
Return current Watchdog Prescaler Value @rmtoll CFR WDGTB LL_WWDG_GetPrescaler.
__STATIC_INLINE uint32_t LL_WWDG_IsEnabled(WWDG_TypeDef *WWDGx)
Checks if Window Watchdog is enabled @rmtoll CR WDGA LL_WWDG_IsEnabled.
__STATIC_INLINE uint32_t LL_WWDG_IsActiveFlag_EWKUP(WWDG_TypeDef *WWDGx)
Indicates if the WWDG Early Wakeup Interrupt Flag is set or not.
__STATIC_INLINE void LL_WWDG_ClearFlag_EWKUP(WWDG_TypeDef *WWDGx)
Clear WWDG Early Wakeup Interrupt Flag (EWIF) @rmtoll SR EWIF LL_WWDG_ClearFlag_EWKUP.
__STATIC_INLINE uint32_t LL_WWDG_IsEnabledIT_EWKUP(WWDG_TypeDef *WWDGx)
Check if Early Wakeup Interrupt is enabled @rmtoll CFR EWI LL_WWDG_IsEnabledIT_EWKUP.
__STATIC_INLINE void LL_WWDG_EnableIT_EWKUP(WWDG_TypeDef *WWDGx)
Enable the Early Wakeup Interrupt.