pub struct WwdgtRunning { /* private fields */ }Expand description
The watchdog once it is counting down.
No way out: WDGTEN ignores a written zero and only a hardware reset clears
it, so neither the peripheral nor the period comes back.
Implementations§
Source§impl WwdgtRunning
impl WwdgtRunning
Sourcepub fn feed(&mut self)
pub fn feed(&mut self)
Reloads the counter, which must happen inside the window: too early resets the chip exactly as too late does.
Sourcepub fn set_period(&mut self, cnt: u8, win: u8)
pub fn set_period(&mut self, cnt: u8, win: u8)
Changes the period and the window, taking effect at the next
feed.
The new window applies at once, so the next feed is already judged by it.
§Panics
On the same three conditions as Wwdgt::start.
Sourcepub fn listen(&mut self)
pub fn listen(&mut self)
Lets the counter reaching 0x40 raise an interrupt — one tick before
the reset, the last moment anything can still run.
Irreversible, like the watchdog itself: EWIE ignores a written zero, so
there is no unlisten. Unmasking the line in the NVIC is the caller’s.
Sourcepub fn is_listening(&self) -> bool
pub fn is_listening(&self) -> bool
Whether the early wakeup interrupt is enabled.
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Whether the counter has reached 0x40.
Hardware sets the flag whether or not listen was
called, so this doubles as a plain poll for “one tick left”.
Sourcepub fn clear_interrupt(&mut self)
pub fn clear_interrupt(&mut self)
Clears the flag, which a handler must do before returning — the flag is the request, and hardware never drops it.
The flag rises again for as long as the counter sits at 0x40, so a
handler that only clears it is entered over and over until the reset.
For exactly one entry, mask the line in the NVIC inside the handler.