esp_hal::timer::systimer

Trait Unit

Source
pub trait Unit {
    // Required method
    fn channel(&self) -> u8;

    // Provided methods
    fn configure(&self, config: UnitConfig) { ... }
    fn set_count(&self, value: u64) { ... }
    fn read_count(&self) -> u64 { ... }
}
Expand description

A 52-bit counter.

Required Methods§

Source

fn channel(&self) -> u8

Returns the unit number.

Provided Methods§

Source

fn configure(&self, config: UnitConfig)

Configures when this counter can run. It can be configured to stall or continue running when CPU stalls or enters on-chip-debugging mode

Source

fn set_count(&self, value: u64)

Set the value of the counter immediately. If the unit is at work, the counter will continue to count up from the new reloaded value.

This can be used to load back the sleep time recorded by RTC timer via software after Light-sleep

Source

fn read_count(&self) -> u64

Reads the current counter value.

Implementors§

Source§

impl Unit for AnyUnit<'_>

Source§

impl<const CHANNEL: u8> Unit for SpecificUnit<'_, CHANNEL>