pub struct Rtc<'d> {
pub rwdt: Rwdt,
pub swd: Swd,
/* private fields */
}
unstable
only.Expand description
Low-power Management
Fields§
§rwdt: Rwdt
Reset Watchdog Timer.
swd: Swd
Super Watchdog
Implementations§
Source§impl<'d> Rtc<'d>
impl<'d> Rtc<'d>
Sourcepub fn new(rtc_cntl: impl Peripheral<P = LPWR> + 'd) -> Self
pub fn new(rtc_cntl: impl Peripheral<P = LPWR> + 'd) -> Self
Create a new instance in crate::Blocking mode.
Optionally an interrupt handler can be bound.
Sourcepub fn estimate_xtal_frequency(&mut self) -> u32
pub fn estimate_xtal_frequency(&mut self) -> u32
Return estimated XTAL frequency in MHz.
Sourcepub fn time_since_boot(&self) -> Duration
pub fn time_since_boot(&self) -> Duration
Get the time since boot.
Sourcepub fn current_time(&self) -> NaiveDateTime
pub fn current_time(&self) -> NaiveDateTime
Get the current time.
Sourcepub fn set_current_time(&self, current_time: NaiveDateTime)
pub fn set_current_time(&self, current_time: NaiveDateTime)
Set the current time.
§Panics
Panics if current_time
is before the Unix epoch (meaning the
underlying timestamp is negative).
Sourcepub fn sleep_deep(&mut self, wake_sources: &[&dyn WakeSource]) -> !
pub fn sleep_deep(&mut self, wake_sources: &[&dyn WakeSource]) -> !
Enter deep sleep and wake with the provided wake_sources
.
Sourcepub fn sleep_light(&mut self, wake_sources: &[&dyn WakeSource])
pub fn sleep_light(&mut self, wake_sources: &[&dyn WakeSource])
Enter light sleep and wake with the provided wake_sources
.
Sourcepub fn sleep(
&mut self,
config: &RtcSleepConfig,
wake_sources: &[&dyn WakeSource],
)
pub fn sleep( &mut self, config: &RtcSleepConfig, wake_sources: &[&dyn WakeSource], )
Enter sleep with the provided config
and wake with the provided
wake_sources
.
Sourcepub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Register an interrupt handler for the RTC.
Note that this will replace any previously registered interrupt handlers.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Trait Implementations§
Source§impl InterruptConfigurable for Rtc<'_>
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
impl InterruptConfigurable for Rtc<'_>
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.