STM32L4xx_HAL_Driver  1.14.0

Functions

__STATIC_INLINE void LL_WWDG_Enable (WWDG_TypeDef *WWDGx)
 Enable Window Watchdog. The watchdog is always disabled after a reset. More...
 
__STATIC_INLINE uint32_t LL_WWDG_IsEnabled (WWDG_TypeDef *WWDGx)
 Checks if Window Watchdog is enabled CR WDGA LL_WWDG_IsEnabled. More...
 
__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]) More...
 
__STATIC_INLINE uint32_t LL_WWDG_GetCounter (WWDG_TypeDef *WWDGx)
 Return current Watchdog Counter Value (7 bits counter value) CR T LL_WWDG_GetCounter. More...
 
__STATIC_INLINE void LL_WWDG_SetPrescaler (WWDG_TypeDef *WWDGx, uint32_t Prescaler)
 Set the time base of the prescaler (WDGTB). More...
 
__STATIC_INLINE uint32_t LL_WWDG_GetPrescaler (WWDG_TypeDef *WWDGx)
 Return current Watchdog Prescaler Value CFR WDGTB LL_WWDG_GetPrescaler. More...
 
__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]). More...
 
__STATIC_INLINE uint32_t LL_WWDG_GetWindow (WWDG_TypeDef *WWDGx)
 Return current Watchdog Window Value (7 bits value) CFR W LL_WWDG_GetWindow. More...
 

Detailed Description

Function Documentation

◆ LL_WWDG_Enable()

__STATIC_INLINE void LL_WWDG_Enable ( WWDG_TypeDef *  WWDGx)

Enable Window Watchdog. The watchdog is always disabled after a reset.

Note
It is enabled by setting the WDGA bit in the WWDG_CR register, then it cannot be disabled again except by a reset. This bit is set by software and only cleared by hardware after a reset. When WDGA = 1, the watchdog can generate a reset. CR WDGA LL_WWDG_Enable
Parameters
WWDGxWWDG Instance
Return values
None

Definition at line 123 of file stm32l4xx_ll_wwdg.h.

124 {
125  SET_BIT(WWDGx->CR, WWDG_CR_WDGA);
126 }

◆ LL_WWDG_GetCounter()

__STATIC_INLINE uint32_t LL_WWDG_GetCounter ( WWDG_TypeDef *  WWDGx)

Return current Watchdog Counter Value (7 bits counter value) CR T LL_WWDG_GetCounter.

Parameters
WWDGxWWDG Instance
Return values
7bit Watchdog Counter value

Definition at line 161 of file stm32l4xx_ll_wwdg.h.

162 {
163  return (READ_BIT(WWDGx->CR, WWDG_CR_T));
164 }

◆ LL_WWDG_GetPrescaler()

__STATIC_INLINE uint32_t LL_WWDG_GetPrescaler ( WWDG_TypeDef *  WWDGx)

Return current Watchdog Prescaler Value CFR WDGTB LL_WWDG_GetPrescaler.

Parameters
WWDGxWWDG Instance
Return values
Returnedvalue can be one of the following values:
  • LL_WWDG_PRESCALER_1
  • LL_WWDG_PRESCALER_2
  • LL_WWDG_PRESCALER_4
  • LL_WWDG_PRESCALER_8

Definition at line 194 of file stm32l4xx_ll_wwdg.h.

195 {
196  return (READ_BIT(WWDGx->CFR, WWDG_CFR_WDGTB));
197 }

◆ LL_WWDG_GetWindow()

__STATIC_INLINE uint32_t LL_WWDG_GetWindow ( WWDG_TypeDef *  WWDGx)

Return current Watchdog Window Value (7 bits value) CFR W LL_WWDG_GetWindow.

Parameters
WWDGxWWDG Instance
Return values
7bit Watchdog Window value

Definition at line 226 of file stm32l4xx_ll_wwdg.h.

227 {
228  return (READ_BIT(WWDGx->CFR, WWDG_CFR_W));
229 }

◆ LL_WWDG_IsEnabled()

__STATIC_INLINE uint32_t LL_WWDG_IsEnabled ( WWDG_TypeDef *  WWDGx)

Checks if Window Watchdog is enabled CR WDGA LL_WWDG_IsEnabled.

Parameters
WWDGxWWDG Instance
Return values
Stateof bit (1 or 0).

Definition at line 134 of file stm32l4xx_ll_wwdg.h.

135 {
136  return ((READ_BIT(WWDGx->CR, WWDG_CR_WDGA) == (WWDG_CR_WDGA)) ? 1UL : 0UL);
137 }

◆ LL_WWDG_SetCounter()

__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])

Note
When writing to the WWDG_CR register, always write 1 in the MSB b6 to avoid generating an immediate reset This counter is decremented every (4096 x 2expWDGTB) PCLK cycles A reset is produced when it rolls over from 0x40 to 0x3F (bit T6 becomes cleared) Setting the counter lower then 0x40 causes an immediate reset (if WWDG enabled) CR T LL_WWDG_SetCounter
Parameters
WWDGxWWDG Instance
Counter0..0x7F (7 bit counter value)
Return values
None

Definition at line 150 of file stm32l4xx_ll_wwdg.h.

151 {
152  MODIFY_REG(WWDGx->CR, WWDG_CR_T, Counter);
153 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_WWDG_SetPrescaler()

__STATIC_INLINE void LL_WWDG_SetPrescaler ( WWDG_TypeDef *  WWDGx,
uint32_t  Prescaler 
)

Set the time base of the prescaler (WDGTB).

Note
Prescaler is used to apply ratio on PCLK clock, so that Watchdog counter is decremented every (4096 x 2expWDGTB) PCLK cycles CFR WDGTB LL_WWDG_SetPrescaler
Parameters
WWDGxWWDG Instance
PrescalerThis parameter can be one of the following values:
  • LL_WWDG_PRESCALER_1
  • LL_WWDG_PRESCALER_2
  • LL_WWDG_PRESCALER_4
  • LL_WWDG_PRESCALER_8
Return values
None

Definition at line 179 of file stm32l4xx_ll_wwdg.h.

180 {
181  MODIFY_REG(WWDGx->CFR, WWDG_CFR_WDGTB, Prescaler);
182 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_WWDG_SetWindow()

__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]).

Note
This window value defines when write in the WWDG_CR register to program Watchdog counter is allowed. Watchdog counter value update must occur only when the counter value is lower than the Watchdog window register value. Otherwise, a MCU reset is generated if the 7-bit Watchdog counter value (in the control register) is refreshed before the downcounter has reached the watchdog window register value. Physically is possible to set the Window lower then 0x40 but it is not recommended. To generate an immediate reset, it is possible to set the Counter lower than 0x40. CFR W LL_WWDG_SetWindow
Parameters
WWDGxWWDG Instance
Window0x00..0x7F (7 bit Window value)
Return values
None

Definition at line 215 of file stm32l4xx_ll_wwdg.h.

216 {
217  MODIFY_REG(WWDGx->CFR, WWDG_CFR_W, Window);
218 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)