Trait kernel::platform::watchdog::WatchDog

source ·
pub trait WatchDog {
    // Provided methods
    fn setup(&self) { ... }
    fn tickle(&self) { ... }
    fn suspend(&self) { ... }
    fn resume(&self) { ... }
}
Expand description

A trait for implementing a watchdog in the kernel. This trait is called from the kernel_loop() code to setup and maintain the watchdog timer. It is up to the specific Chip how it will handle watchdog interrupts.

Provided Methods§

source

fn setup(&self)

This function must enable the watchdog timer and configure it to trigger regulary. The period of the timer is left to the implementation to decide. The implementation must ensure that it doesn’t trigger too early (when we haven’t hung for example) or too late as to not catch faults. After calling this function the watchdog must be running.

source

fn tickle(&self)

This function must tickle the watchdog to reset the timer. If the watchdog was previously suspended then this should also resume the timer.

source

fn suspend(&self)

Suspends the watchdog timer. After calling this the timer should not fire until after tickle() has been called. This function is called before sleeping.

source

fn resume(&self)

Resumes the watchdog timer. After calling this the timer should be running again. This is called after returning from sleep, after suspend() was called.

Implementations on Foreign Types§

source§

impl WatchDog for ()

Implement default WatchDog trait for unit.

Implementors§