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 = 4_503_599_627_370_495u64
pub const BIT_MASK: u64 = 4_503_599_627_370_495u64
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 configure_unit(unit: Unit, config: UnitConfig)
pub unsafe fn configure_unit(unit: Unit, 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.
§Safety
- Disabling a
Unit
whilstAlarm
s are using it will affect theAlarm
s operation. - Disabling Unit0 will affect
Instant::now
.
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