LL WWDG Functions

Configuration

group WWDG_LL_EF_Configuration

Functions

void LL_WWDG_Enable ( WWDG_TypeDef * wwdgx )

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

Reference Manual to LL API cross reference (Register Field Functions)

CR WDGA LL_WWDG_Enable

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.

Parameters :

wwdgx – WWDG Instance.

uint32_t LL_WWDG_IsEnabled ( const WWDG_TypeDef * wwdgx )

Checks if Window Watchdog is enabled.

Reference Manual to LL API cross reference (Register Field Functions)

CR WDGA LL_WWDG_IsEnabled

Parameters :

wwdgx – WWDG Instance

Return values :

State – of bit (1 or 0).

void LL_WWDG_SetCounter ( WWDG_TypeDef * wwdgx , uint32_t counter )

Set the Watchdog counter value to provided value (7-bits T[6:0]).

Reference Manual to LL API cross reference (Register Field Functions)

CR T LL_WWDG_SetCounter

Warning

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)

Parameters :
  • wwdgx – WWDG Instance

  • counter – 0..0x7F (7 bit counter value)

uint32_t LL_WWDG_GetCounter ( const WWDG_TypeDef * wwdgx )

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

Reference Manual to LL API cross reference (Register Field Functions)

CR T LL_WWDG_GetCounter

Parameters :

wwdgx – WWDG Instance

Return values :

7 – bit Watchdog Counter value

void LL_WWDG_SetPrescaler ( WWDG_TypeDef * wwdgx , uint32_t prescaler )

Set the time base of the prescaler (WDGTB).

Reference Manual to LL API cross reference (Register Field Functions)

CFR WDGTB LL_WWDG_SetPrescaler

Note

Prescaler is used to apply ratio on PCLK clock, so that Watchdog counter is decremented every (4096 x 2expWDGTB) PCLK cycles.

Parameters :
uint32_t LL_WWDG_GetPrescaler ( const WWDG_TypeDef * wwdgx )

Return current Watchdog Prescaler Value.

Reference Manual to LL API cross reference (Register Field Functions)

CFR WDGTB LL_WWDG_GetPrescaler

Parameters :

wwdgx – WWDG Instance.

Return values :

Returned – value can be one of the following values:

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

Reference Manual to LL API cross reference (Register Field Functions)

CFR W LL_WWDG_SetWindow

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.

Parameters :
  • wwdgx – WWDG Instance.

  • window – 0x00..0x7F (7 bit Window value)

uint32_t LL_WWDG_GetWindow ( const WWDG_TypeDef * wwdgx )

Return current Watchdog Window Value (7 bits value).

Reference Manual to LL API cross reference (Register Field Functions)

CFR W LL_WWDG_GetWindow

Parameters :

wwdgx – WWDG Instance.

Return values :

7 – bit Watchdog Window value.

FLAG_Management

group WWDG_LL_EF_FLAG_Management

Functions

uint32_t LL_WWDG_IsActiveFlag_EWKUP ( const WWDG_TypeDef * wwdgx )

Indicates if the WWDG Early Wakeup Interrupt Flag is set or not.

Reference Manual to LL API cross reference (Register Field Functions)

SR EWIF LL_WWDG_IsActiveFlag_EWKUP

Note

This bit is set by hardware when the counter has reached the value 0x40. It must be cleared by software by writing 0. A write of 1 has no effect. This bit is also set if the interrupt is not enabled.

Parameters :

wwdgx – WWDG Instance

Return values :

State – of bit (1 or 0).

void LL_WWDG_ClearFlag_EWKUP ( WWDG_TypeDef * wwdgx )

Clear WWDG Early Wakeup Interrupt Flag (EWIF).

Reference Manual to LL API cross reference (Register Field Functions)

SR EWIF LL_WWDG_ClearFlag_EWKUP

Parameters :

wwdgx – WWDG Instance

IT_Management

group WWDG_LL_EF_IT_Management

Functions

void LL_WWDG_EnableIT_EWKUP ( WWDG_TypeDef * wwdgx )

Enable the Early Wakeup Interrupt.

Reference Manual to LL API cross reference (Register Field Functions)

CFR EWI LL_WWDG_EnableIT_EWKUP

Note

When set, an interrupt occurs whenever the counter reaches value 0x40. This interrupt is only cleared by hardware after a reset

Parameters :

wwdgx – WWDG Instance

uint32_t LL_WWDG_IsEnabledIT_EWKUP ( const WWDG_TypeDef * wwdgx )

Check if Early Wakeup Interrupt is enabled.

Reference Manual to LL API cross reference (Register Field Functions)

CFR EWI LL_WWDG_IsEnabledIT_EWKUP

Parameters :

wwdgx – WWDG Instance

Return values :

State – of bit (1 or 0).

void LL_WWDG_SetControl ( WWDG_TypeDef * wwdgx , uint32_t counter )

Enable Window Watchdog and set the counter value to provided value (7-bits T[6:0]).

Reference Manual to LL API cross reference (Register Field Functions)

CR WDGA LL_WWDG_SetControl

CR T LL_WWDG_SetControl

Parameters :
  • wwdgx – WWDG Instance

  • counter – 0..0x7F (7 bit counter value)

void LL_WWDG_SetConfig ( WWDG_TypeDef * wwdgx , uint32_t prescaler , uint32_t window )

Set the time base of the prescaler (WDGTB) and the Watchdog Window value to be compared to the downcounter (7-bits W[6:0]).

Reference Manual to LL API cross reference (Register Field Functions)

CFR WDGTB LL_WWDG_SetConfig

CFR W LL_WWDG_SetConfig

Parameters :