Struct Wdt

Source
pub struct Wdt<TG> { /* private fields */ }
Available on crate feature unstable only.
Expand description

Watchdog timer

Implementations§

Source§

impl<TG> Wdt<TG>
where TG: TimerGroupInstance,

Watchdog driver

Source

pub fn new() -> Self

Construct a new instance of Wdt

Source

pub fn enable(&mut self)

Enable the watchdog timer instance

Source

pub fn disable(&mut self)

Disable the watchdog timer instance

Source

pub unsafe fn set_wdt_enabled(&mut self, enabled: bool)

Forcibly enable or disable the watchdog timer

§Safety

This bypasses the usual ownership rules for the peripheral, so users must take care to ensure that no driver instance is active for the timer.

Source

pub fn feed(&mut self)

Feed the watchdog timer

Source

pub fn set_timeout(&mut self, stage: MwdtStage, timeout: Duration)

Set the timeout, in microseconds, of the watchdog timer

Source

pub fn set_stage_action(&mut self, stage: MwdtStage, action: MwdtStageAction)

Set the stage action of the MWDT for a specific stage.

This function modifies MWDT behavior only if a custom bootloader with the following modifications is used:

  • ESP_TASK_WDT_EN parameter disabled
  • ESP_INT_WDT parameter disabled

Trait Implementations§

Source§

impl<TG> Default for Wdt<TG>
where TG: TimerGroupInstance,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<TG> InterruptConfigurable for Wdt<TG>
where TG: TimerGroupInstance,

Source§

fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the peripheral. Read more

Auto Trait Implementations§

§

impl<TG> Freeze for Wdt<TG>

§

impl<TG> RefUnwindSafe for Wdt<TG>
where TG: RefUnwindSafe,

§

impl<TG> Send for Wdt<TG>
where TG: Send,

§

impl<TG> Sync for Wdt<TG>
where TG: Sync,

§

impl<TG> Unpin for Wdt<TG>
where TG: Unpin,

§

impl<TG> UnwindSafe for Wdt<TG>
where TG: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

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

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

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

Performs the conversion.