pub struct Rtc<Mode: RtcMode> { /* private fields */ }
Expand description
Represents the RTC peripheral for either clock/calendar or timer mode.
Implementations§
Source§impl<Mode: RtcMode> Rtc<Mode>
impl<Mode: RtcMode> Rtc<Mode>
Sourcepub fn into_count32_mode(self) -> Rtc<Count32Mode>
pub fn into_count32_mode(self) -> Rtc<Count32Mode>
Reconfigures the RTC for 32-bit counter mode with no prescaler (default state after reset) and the counter initialized to zero and started.
Sourcepub fn into_clock_mode(self) -> Rtc<ClockMode>
pub fn into_clock_mode(self) -> Rtc<ClockMode>
Reconfigures the peripheral for clock/calendar mode. Requires the source clock to be running at 1024 Hz.
Source§impl Rtc<Count32Mode>
impl Rtc<Count32Mode>
Sourcepub fn count32_mode(rtc: Rtc, rtc_clock_freq: Hertz, pm: &mut Pm) -> Self
pub fn count32_mode(rtc: Rtc, rtc_clock_freq: Hertz, pm: &mut Pm) -> Self
Configures the RTC in 32-bit counter mode with no prescaler (default state after reset) and the counter initialized to zero and started.
Sourcepub fn set_count32(&mut self, count: u32)
pub fn set_count32(&mut self, count: u32)
Sets the internal counter value.
Sourcepub fn reset_and_compute_prescaler<T: Into<Nanoseconds>>(
&mut self,
timeout: T,
) -> &Self
pub fn reset_and_compute_prescaler<T: Into<Nanoseconds>>( &mut self, timeout: T, ) -> &Self
This resets the internal counter, sets the prescaler to match the provided timeout, and starts the counter. You should configure the prescaler using the longest timeout you plan to measure.
Trait Implementations§
Source§impl DelayNs for Rtc<Count32Mode>
impl DelayNs for Rtc<Count32Mode>
Source§fn delay_ns(&mut self, ns: u32)
fn delay_ns(&mut self, ns: u32)
ns
nanoseconds. Pause can be longer
if the implementation requires it due to precision/timing issues.Source§impl InterruptDrivenTimer for Rtc<Count32Mode>
impl InterruptDrivenTimer for Rtc<Count32Mode>
Source§fn enable_interrupt(&mut self)
fn enable_interrupt(&mut self)
Enable the interrupt generation for this hardware timer. This method only sets the clock configuration to trigger the interrupt; it does not configure the interrupt controller or define an interrupt handler.
Source§fn start<T>(&mut self, timeout: T)where
T: Into<Nanoseconds>,
fn start<T>(&mut self, timeout: T)where
T: Into<Nanoseconds>,
Starts the timer and puts it in periodic mode in which the counter
counts up to the specified timeout
and then resets repeatedly back
to zero.
Source§fn disable_interrupt(&mut self)
fn disable_interrupt(&mut self)
Disables interrupt generation for this hardware timer. This method only sets the clock configuration to prevent triggering the interrupt; it does not configure the interrupt controller.