pub struct WindowWatchdog<'d, T: WwdgInstance> { /* private fields */ }Expand description
Window watchdog (WWDG) driver.
The watchdog is running as soon as new returns; there is no
separate start step and no way to stop it short of a reset.
Implementations§
Source§impl<'d, T: WwdgInstance> WindowWatchdog<'d, T>
impl<'d, T: WwdgInstance> WindowWatchdog<'d, T>
Sourcepub fn new(peri: Peri<'d, T>, timeout_us: u32, window_us: u32) -> Self
pub fn new(peri: Peri<'d, T>, timeout_us: u32, window_us: u32) -> Self
Start the watchdog with a timeout_us period and a window_us closed
window.
A refresh during the closed window resets the chip; pass 0 to allow
a refresh at any time. Panics if window_us >= timeout_us or if the
timeout does not fit the 7-bit counter at any prescaler (the maximum
is PCLK1 / 4096 / 8 * 64 ticks).
Sourcepub fn pet(&mut self)
pub fn pet(&mut self)
Reload the counter.
Refreshing while the live counter is at or above window
resets the chip, so time the call for the open part of the period.
Sourcepub fn enable_early_wakeup_interrupt(&mut self)
pub fn enable_early_wakeup_interrupt(&mut self)
Enable the early-wakeup interrupt at counter value 0x40.
The caller must install and enable the WWDG interrupt handler; this bit is only cleared by a peripheral reset.
Sourcepub fn early_wakeup_pending(&self) -> bool
pub fn early_wakeup_pending(&self) -> bool
Whether the counter has reached 0x40 since EWIF was last cleared. The flag is raised even with the early-wakeup interrupt disabled.
Sourcepub fn clear_early_wakeup(&mut self)
pub fn clear_early_wakeup(&mut self)
Clear the early-wakeup flag (write zero to clear).