embassy-stm32

Crates

git

Versions

stm32f437vi

Flavors

WindowWatchdog

Struct WindowWatchdog 

Source
pub struct WindowWatchdog<'d, T: WwdgInstance> { /* private fields */ }
Expand description

Window watchdog (WWDG) driver.

Once activated via WindowWatchdog::new, the WWDG cannot be stopped without a system reset.

The counter counts from T down to 0x3F (63), triggering a reset when it reaches 0x3F. Petting the watchdog while the counter is still above the window register W (the closed window) also causes an immediate reset.

T_initial ──count down──▶ W ──count down──▶ 0x40 ──▶ 0x3F (RESET)
|◄──── closed window ────►|◄──── open window ────►|

Implementations§

Source§

impl<'d, T: WwdgInstance> WindowWatchdog<'d, T>

Source

pub fn new(_instance: Peri<'d, T>, timeout_us: u32, window_us: u32) -> Self

Creates and immediately starts the window watchdog.

  • timeout_us: total watchdog period in microseconds (counter-to-reset time).
  • window_us: closed-window duration in microseconds. During this initial portion of the period, petting the watchdog causes a reset. Pass 0 to disable the window restriction (allow petting at any time within the period). Must be strictly less than timeout_us.
Source

pub fn pet(&mut self)

Pet (reload) the watchdog.

Must be called while the counter has fallen into the open window (counter ≤ W). Calling too early (counter > W) causes an immediate reset.

Auto Trait Implementations§

§

impl<'d, T> Freeze for WindowWatchdog<'d, T>

§

impl<'d, T> RefUnwindSafe for WindowWatchdog<'d, T>
where T: RefUnwindSafe,

§

impl<'d, T> Send for WindowWatchdog<'d, T>
where T: Send,

§

impl<'d, T> Sync for WindowWatchdog<'d, T>
where T: Sync,

§

impl<'d, T> Unpin for WindowWatchdog<'d, T>

§

impl<'d, T> !UnwindSafe for WindowWatchdog<'d, T>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

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

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.