rp-pac

Crates

git

Versions

rp235x

Flavors

Struct rp_pac::powman::regs::Timer

source ·
#[repr(transparent)]
pub struct Timer(pub u32);

Tuple Fields§

§0: u32

Implementations§

source§

impl Timer

source

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.

source

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.

source

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

source

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

source

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.

source

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.

source

pub const fn alarm_enab(&self) -> bool

Enables the alarm. The alarm must be disabled while writing the alarm time.

source

pub fn set_alarm_enab(&mut self, val: bool)

Enables the alarm. The alarm must be disabled while writing the alarm time.

source

pub const fn pwrup_on_alarm(&self) -> bool

Alarm wakes the chip from low power mode

source

pub fn set_pwrup_on_alarm(&mut self, val: bool)

Alarm wakes the chip from low power mode

source

pub const fn alarm(&self) -> bool

Alarm has fired. Write to 1 to clear the alarm.

source

pub fn set_alarm(&mut self, val: bool)

Alarm has fired. Write to 1 to clear the alarm.

source

pub const fn use_lposc(&self) -> bool

Switch to lposc as the source of the 1kHz timer tick

source

pub fn set_use_lposc(&mut self, val: bool)

Switch to lposc as the source of the 1kHz timer tick

source

pub const fn use_xosc(&self) -> bool

switch to xosc as the source of the 1kHz timer tick

source

pub fn set_use_xosc(&mut self, val: bool)

switch to xosc as the source of the 1kHz timer tick

source

pub const fn use_gpio_1khz(&self) -> bool

switch to gpio as the source of the 1kHz timer tick

source

pub fn set_use_gpio_1khz(&mut self, val: bool)

switch to gpio as the source of the 1kHz timer tick

source

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.

source

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.

source

pub const fn using_xosc(&self) -> bool

Timer is running from xosc

source

pub fn set_using_xosc(&mut self, val: bool)

Timer is running from xosc

source

pub const fn using_lposc(&self) -> bool

Timer is running from lposc

source

pub fn set_using_lposc(&mut self, val: bool)

Timer is running from lposc

source

pub const fn using_gpio_1khz(&self) -> bool

Timer is running from a 1khz gpio source

source

pub fn set_using_gpio_1khz(&mut self, val: bool)

Timer is running from a 1khz gpio source

source

pub const fn using_gpio_1hz(&self) -> bool

Timer is synchronised to a 1hz gpio source

source

pub fn set_using_gpio_1hz(&mut self, val: bool)

Timer is synchronised to a 1hz gpio source

Trait Implementations§

source§

impl Clone for Timer

source§

fn clone(&self) -> Timer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Timer

source§

fn default() -> Timer

Returns the “default value” for a type. Read more
source§

impl PartialEq for Timer

source§

fn eq(&self, other: &Timer) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Timer

source§

impl Eq for Timer

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.