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§
Provided Methods§
Sourcefn configure(&self, config: UnitConfig)
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
Sourcefn set_count(&self, value: u64)
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
Sourcefn read_count(&self) -> u64
fn read_count(&self) -> u64
Reads the current counter value.