pub struct Rtc<'d> {
pub rwdt: Rwdt,
pub swd: Swd,
/* private fields */
}Expand description
Low-power Management
Fields§
§rwdt: RwdtReset Watchdog Timer.
swd: SwdSuper 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) -> 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
Auto Trait Implementations§
impl<'d> Freeze for Rtc<'d>
impl<'d> RefUnwindSafe for Rtc<'d>
impl<'d> Send for Rtc<'d>
impl<'d> Sync for Rtc<'d>
impl<'d> Unpin for Rtc<'d>
impl<'d> !UnwindSafe for Rtc<'d>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more