Struct nrf51_hal::wdt::Watchdog[][src]

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

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 occurring.

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Az for T[src]

pub fn az<Dst>(self) -> Dst where
    T: Cast<Dst>, 
[src]

Casts the value.

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CheckedAs for T[src]

pub fn checked_as<Dst>(self) -> Option<Dst> where
    T: CheckedCast<Dst>, 
[src]

Casts the value.

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

pub fn lossless_try_into(self) -> Option<Dst>[src]

Performs the conversion.

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

pub fn lossy_into(self) -> Dst[src]

Performs the conversion.

impl<T> OverflowingAs for T[src]

pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
    T: OverflowingCast<Dst>, 
[src]

Casts the value.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatingAs for T[src]

pub fn saturating_as<Dst>(self) -> Dst where
    T: SaturatingCast<Dst>, 
[src]

Casts the value.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> UnwrappedAs for T[src]

pub fn unwrapped_as<Dst>(self) -> Dst where
    T: UnwrappedCast<Dst>, 
[src]

Casts the value.

impl<T> WrappingAs for T[src]

pub fn wrapping_as<Dst>(self) -> Dst where
    T: WrappingCast<Dst>, 
[src]

Casts the value.