Skip to main content

Wdt

Struct Wdt 

Source
pub struct Wdt<TG> { /* private fields */ }
Expand description

Watchdog timer

Implementations§

Source§

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

Watchdog driver

Source

pub fn new() -> Self

Creates a new instance of Wdt.

Source

pub fn enable(&mut self)

Enables the watchdog timer instance.

Source

pub fn disable(&mut self)

Disables 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)

Feeds the watchdog timer.

Source

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

Sets the timeout, in microseconds, of the watchdog timer.

Source

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

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

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,

Available on crate feature unstable only.
Source§

fn default() -> Self

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

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

Available on crate feature unstable only.
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>
where PhantomData<TG>: Freeze,

§

impl<TG> RefUnwindSafe for Wdt<TG>

§

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

§

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

§

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

§

impl<TG> UnsafeUnpin for Wdt<TG>

§

impl<TG> UnwindSafe for Wdt<TG>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.