pub struct SystemTimer<'d> {
    pub alarm0: Alarm<'d>,
    pub alarm1: Alarm<'d>,
    pub alarm2: Alarm<'d>,
}Expand description
System Timer driver.
Fields§
§alarm0: Alarm<'d>Alarm 0.
alarm1: Alarm<'d>Alarm 1.
alarm2: Alarm<'d>Alarm 2.
Implementations§
Source§impl<'d> SystemTimer<'d>
 
impl<'d> SystemTimer<'d>
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 UnitwhilstAlarms are using it will affect theAlarms 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 Alarms are using it may cause unexpected behaviour
- Any modification of the unit0 count will affect Instant::now