pub struct Rtc<Mode: RtcMode> { /* private fields */ }
Expand description
Rtc 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>
Reonfigures the peripheral for 32bit counter mode.
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.
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<<Self as CountDown>::Time>>(
&mut self,
timeout: T,
) -> &Self
pub fn reset_and_compute_prescaler<T: Into<<Self as CountDown>::Time>>( &mut self, timeout: T, ) -> &Self
This resets the internal counter and sets the prescaler to match the provided timeout. You should configure the prescaler using the longest timeout you plan to measure.
Trait Implementations§
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 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.