pub struct TimerWakeupSource { /* private fields */ }
Available on crate feature
unstable
only.Expand description
Represents a timer wake-up source, triggering an event after a specified duration.
let delay = Delay::new();
let mut rtc = Rtc::new(peripherals.LPWR);
let reason = reset_reason(Cpu::ProCpu);
let wake_reason = wakeup_cause();
println!("{:?} {?}", reason, wake_reason);
let timer = TimerWakeupSource::new(Duration::from_secs(5));
delay.delay_millis(100);
rtc.sleep_deep(&[&timer]);
Implementations§
Trait Implementations§
Source§impl Clone for TimerWakeupSource
impl Clone for TimerWakeupSource
Source§fn clone(&self) -> TimerWakeupSource
fn clone(&self) -> TimerWakeupSource
Returns a copy of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TimerWakeupSource
impl Debug for TimerWakeupSource
Source§impl Default for TimerWakeupSource
impl Default for TimerWakeupSource
Source§fn default() -> TimerWakeupSource
fn default() -> TimerWakeupSource
Returns the “default value” for a type. Read more
Source§impl WakeSource for TimerWakeupSource
impl WakeSource for TimerWakeupSource
Source§fn apply(
&self,
rtc: &Rtc<'_>,
triggers: &mut WakeTriggers,
_sleep_config: &mut RtcSleepConfig,
)
fn apply( &self, rtc: &Rtc<'_>, triggers: &mut WakeTriggers, _sleep_config: &mut RtcSleepConfig, )
Configures the RTC and applies the wakeup triggers.
impl Copy for TimerWakeupSource
Auto Trait Implementations§
impl Freeze for TimerWakeupSource
impl RefUnwindSafe for TimerWakeupSource
impl Send for TimerWakeupSource
impl Sync for TimerWakeupSource
impl Unpin for TimerWakeupSource
impl UnwindSafe for TimerWakeupSource
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut u8)
unsafe fn clone_to_uninit(&self, dst: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)