pub struct Watchdog { /* private fields */ }
Expand description
Watchdog driver.
Implementations§
Source§impl Watchdog
impl Watchdog
Sourcepub fn try_new<const N: usize>(
wdt: WDT,
config: Config,
) -> Result<(Self, [WatchdogHandle; N]), WDT>
pub fn try_new<const N: usize>( wdt: WDT, config: Config, ) -> Result<(Self, [WatchdogHandle; N]), WDT>
Try to create a new watchdog driver.
This function will return an error if the watchdog is already active
with a config
different to the requested one, or a different number of
enabled handles.
N
must be between 1 and 8, inclusive.
Sourcepub fn enable_interrupt(&mut self)
pub fn enable_interrupt(&mut self)
Enable the watchdog interrupt.
NOTE: Although the interrupt will occur, there is no way to prevent the reset from occurring. From the time the event was fired, the system will reset two LFCLK ticks later (61 microseconds) if the interrupt has been enabled.
Sourcepub fn disable_interrupt(&mut self)
pub fn disable_interrupt(&mut self)
Disable the watchdog interrupt.
NOTE: This has no effect on the reset caused by the Watchdog.
Sourcepub fn awaiting_pets(&self) -> bool
pub fn awaiting_pets(&self) -> bool
Is the watchdog still awaiting pets from any handle?
This reports whether sufficient pets have been received from all handles to prevent a reset this time period.