pub struct Rtc<'d> {
pub rwdt: Rwdt,
/* private fields */
}
Available on crate feature
unstable
only.Expand description
Low-power Management
Fields§
§rwdt: Rwdt
Reset Watchdog Timer.
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) -> MicrosDurationU64
pub fn time_since_boot(&self) -> MicrosDurationU64
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
.
Trait Implementations§
Source§impl InterruptConfigurable for Rtc<'_>
impl InterruptConfigurable for Rtc<'_>
Source§fn set_interrupt_handler(&mut self, handler: InterruptHandler)
fn set_interrupt_handler(&mut self, handler: InterruptHandler)
Set the interrupt handler Read more