pub struct SystemTimer {
pub alarm0: Alarm,
pub alarm1: Alarm,
pub alarm2: Alarm,
}
Available on crate feature
unstable
only.Expand description
System Timer driver.
Fields§
§alarm0: Alarm
Alarm 0.
alarm1: Alarm
Alarm 1.
alarm2: Alarm
Alarm 2.
Implementations§
Source§impl SystemTimer
impl SystemTimer
Sourcepub const BIT_MASK: u64 = 18_446_744_073_709_551_615u64
pub const BIT_MASK: u64 = 18_446_744_073_709_551_615u64
Bitmask to be applied to the raw register value.
Sourcepub fn ticks_per_second() -> u64
pub fn ticks_per_second() -> u64
Returns the tick frequency of the underlying timer unit.
Sourcepub fn unit_value(unit: Unit) -> u64
pub fn unit_value(unit: Unit) -> u64
Get the current count of the given unit in the System Timer.
Sourcepub unsafe fn set_unit_value(unit: Unit, value: u64)
pub unsafe fn set_unit_value(unit: Unit, 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
§Safety
- Modifying a unit’s count whilst
Alarm
s are using it may cause unexpected behaviour - Any modification of the unit0 count will affect
Instant::now