Struct nrf52833_hal::wdt::Watchdog[][src]

pub struct Watchdog<T> where
    T: WdMode, 
{ /* fields omitted */ }

An interface to the Watchdog.

Implementations

impl Watchdog<Inactive>[src]

pub fn try_new(wdt: WDT) -> Result<Watchdog<Inactive>, WDT>[src]

Try to create a new watchdog instance from the peripheral.

This function will return an error if the watchdog has already been activated, which may happen on a (non-watchdog) soft reset. In this case, it may be possible to still obtain the handles with the Watchdog::try_recover() method.

If the watchdog has already started, configuration is no longer possible.

pub fn release(self) -> WDT[src]

Release the peripheral.

Note: The peripheral cannot be released after activation.

pub fn activate<H>(self) -> Parts<<H as Handles>::Handles> where
    H: Handles, 
[src]

Activate the watchdog with the given number of handles.

The watchdog cannot be deactivated after starting.

NOTE: All activated handles must be pet within the configured time interval to prevent a reset from occuring.

pub fn enable_interrupt(&mut self)[src]

Enable the watchdog interrupt.

NOTE: Although the interrupt will occur, there is no way to prevent the reset from occuring. From the time the event was fired, the system will reset two LFCLK ticks later (61 microseconds) if the interrupt has been enabled.

pub fn disable_interrupt(&mut self)[src]

Disable the watchdog interrupt.

NOTE: This has no effect on the reset caused by the Watchdog.

pub fn set_lfosc_ticks(&mut self, ticks: u32)[src]

Set the number of 32.768kHz ticks in each watchdog period.

This value defaults to 0xFFFF_FFFF (1.5 days) on reset.

Note: there is a minimum of 15 ticks (458 microseconds). If a lower number is provided, 15 ticks will be used as the configured value.

pub fn run_during_sleep(&self, setting: bool)[src]

Should the watchdog continue to count during sleep modes?

This value defaults to ENABLED on reset.

pub fn run_during_debug_halt(&self, setting: bool)[src]

Should the watchdog continue to count when the CPU is halted for debug?

This value defaults to DISABLED on reset.

impl Watchdog<Active>[src]

pub fn awaiting_pets(&self) -> bool[src]

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.

pub fn try_recover<H>(wdt: WDT) -> Result<Parts<<H as Handles>::Handles>, WDT> where
    H: Handles, 
[src]

Try to recover a handle to an already running watchdog. If the number of requested handles matches the activated number of handles, an activated handle will be returned. Otherwise the peripheral will be returned.

NOTE: Since the watchdog is already counting, you want to pet these dogs as soon as possible!

impl<T> Watchdog<T> where
    T: WdMode, 
[src]

pub fn is_active(&self) -> bool[src]

Is the watchdog active?

Auto Trait Implementations

impl<T> Send for Watchdog<T> where
    T: Send

impl<T> !Sync for Watchdog<T>

impl<T> Unpin for Watchdog<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.