Struct esp_hal::timer::Wdt

source ·
pub struct Wdt<TG, DM> { /* private fields */ }
Expand description

Watchdog timer

Implementations§

source§

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

Watchdog driver

source

pub fn new() -> Self

Create a new watchdog timer instance

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

source

pub fn set_timeout(&mut self, timeout: MicrosDurationU64)

Trait Implementations§

source§

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

source§

fn default() -> Self

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

impl<TG, DM> Watchdog for Wdt<TG, DM>
where TG: TimerGroupInstance, DM: Mode,

source§

fn feed(&mut self)

Triggers the watchdog. This must be done once the watchdog is started to prevent the processor being reset.
source§

impl<TG, DM> WatchdogDisable for Wdt<TG, DM>
where TG: TimerGroupInstance, DM: Mode,

source§

fn disable(&mut self)

Disables the watchdog
source§

impl<TG, DM> WatchdogEnable for Wdt<TG, DM>
where TG: TimerGroupInstance, DM: Mode,

§

type Time = Duration<u64, 1, 1000000>

Unit of time used by the watchdog
source§

fn start<T>(&mut self, period: T)
where T: Into<Self::Time>,

Starts the watchdog with a given period, typically once this is done the watchdog needs to be kicked periodically or the processor is reset.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<TG, DM> UnwindSafe for Wdt<TG, DM>
where DM: UnwindSafe, 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.