#[repr(transparent)]pub struct Timer(pub u32);
Tuple Fields§
§0: u32
Implementations§
source§impl Timer
impl Timer
sourcepub const fn nonsec_write(&self) -> bool
pub const fn nonsec_write(&self) -> bool
Control whether Non-secure software can write to the timer registers. All other registers are hardwired to be inaccessible to Non-secure.
sourcepub fn set_nonsec_write(&mut self, val: bool)
pub fn set_nonsec_write(&mut self, val: bool)
Control whether Non-secure software can write to the timer registers. All other registers are hardwired to be inaccessible to Non-secure.
sourcepub const fn run(&self) -> bool
pub const fn run(&self) -> bool
Timer enable. Setting this bit causes the timer to begin counting up from its current value. Clearing this bit stops the timer from counting. Before enabling the timer, set the POWMAN_LPOSC_FREQ* and POWMAN_XOSC_FREQ* registers to configure the count rate, and initialise the current time by writing to SET_TIME_63TO48 through SET_TIME_15TO0. You must not write to the SET_TIME_x registers when the timer is running. Once configured, start the timer by setting POWMAN_TIMER_RUN=1. This will start the timer running from the LPOSC. When the XOSC is available switch the reference clock to XOSC then select it as the timer clock by setting POWMAN_TIMER_USE_XOSC=1
sourcepub fn set_run(&mut self, val: bool)
pub fn set_run(&mut self, val: bool)
Timer enable. Setting this bit causes the timer to begin counting up from its current value. Clearing this bit stops the timer from counting. Before enabling the timer, set the POWMAN_LPOSC_FREQ* and POWMAN_XOSC_FREQ* registers to configure the count rate, and initialise the current time by writing to SET_TIME_63TO48 through SET_TIME_15TO0. You must not write to the SET_TIME_x registers when the timer is running. Once configured, start the timer by setting POWMAN_TIMER_RUN=1. This will start the timer running from the LPOSC. When the XOSC is available switch the reference clock to XOSC then select it as the timer clock by setting POWMAN_TIMER_USE_XOSC=1
sourcepub const fn clear(&self) -> bool
pub const fn clear(&self) -> bool
Clears the timer, does not disable the timer and does not affect the alarm. This control can be written at any time.
sourcepub fn set_clear(&mut self, val: bool)
pub fn set_clear(&mut self, val: bool)
Clears the timer, does not disable the timer and does not affect the alarm. This control can be written at any time.
sourcepub const fn alarm_enab(&self) -> bool
pub const fn alarm_enab(&self) -> bool
Enables the alarm. The alarm must be disabled while writing the alarm time.
sourcepub fn set_alarm_enab(&mut self, val: bool)
pub fn set_alarm_enab(&mut self, val: bool)
Enables the alarm. The alarm must be disabled while writing the alarm time.
sourcepub const fn pwrup_on_alarm(&self) -> bool
pub const fn pwrup_on_alarm(&self) -> bool
Alarm wakes the chip from low power mode
sourcepub fn set_pwrup_on_alarm(&mut self, val: bool)
pub fn set_pwrup_on_alarm(&mut self, val: bool)
Alarm wakes the chip from low power mode
sourcepub fn set_use_lposc(&mut self, val: bool)
pub fn set_use_lposc(&mut self, val: bool)
Switch to lposc as the source of the 1kHz timer tick
sourcepub fn set_use_xosc(&mut self, val: bool)
pub fn set_use_xosc(&mut self, val: bool)
switch to xosc as the source of the 1kHz timer tick
sourcepub const fn use_gpio_1khz(&self) -> bool
pub const fn use_gpio_1khz(&self) -> bool
switch to gpio as the source of the 1kHz timer tick
sourcepub fn set_use_gpio_1khz(&mut self, val: bool)
pub fn set_use_gpio_1khz(&mut self, val: bool)
switch to gpio as the source of the 1kHz timer tick
sourcepub const fn use_gpio_1hz(&self) -> bool
pub const fn use_gpio_1hz(&self) -> bool
Selects the gpio source as the reference for the sec counter. The msec counter will continue to use the lposc or xosc reference.
sourcepub fn set_use_gpio_1hz(&mut self, val: bool)
pub fn set_use_gpio_1hz(&mut self, val: bool)
Selects the gpio source as the reference for the sec counter. The msec counter will continue to use the lposc or xosc reference.
sourcepub const fn using_xosc(&self) -> bool
pub const fn using_xosc(&self) -> bool
Timer is running from xosc
sourcepub fn set_using_xosc(&mut self, val: bool)
pub fn set_using_xosc(&mut self, val: bool)
Timer is running from xosc
sourcepub const fn using_lposc(&self) -> bool
pub const fn using_lposc(&self) -> bool
Timer is running from lposc
sourcepub fn set_using_lposc(&mut self, val: bool)
pub fn set_using_lposc(&mut self, val: bool)
Timer is running from lposc
sourcepub const fn using_gpio_1khz(&self) -> bool
pub const fn using_gpio_1khz(&self) -> bool
Timer is running from a 1khz gpio source
sourcepub fn set_using_gpio_1khz(&mut self, val: bool)
pub fn set_using_gpio_1khz(&mut self, val: bool)
Timer is running from a 1khz gpio source
sourcepub const fn using_gpio_1hz(&self) -> bool
pub const fn using_gpio_1hz(&self) -> bool
Timer is synchronised to a 1hz gpio source
sourcepub fn set_using_gpio_1hz(&mut self, val: bool)
pub fn set_using_gpio_1hz(&mut self, val: bool)
Timer is synchronised to a 1hz gpio source
Trait Implementations§
impl Copy for Timer
impl Eq for Timer
impl StructuralPartialEq for Timer
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)