Struct stm32l4xx_hal::rtc::WakeupTimer
source · [−]pub struct WakeupTimer<'r> { /* private fields */ }
Expand description
The RTC wakeup timer
This timer can be used in two ways:
- Continually call
wait
until it returnsOk(())
. - Set up the RTC interrupt.
If you use an interrupt, you should still call wait
once, after the
interrupt fired. This should return Ok(())
immediately. Doing this will
reset the timer flag. If you don’t do this, the interrupt will not fire
again, if you go to sleep.
You don’t need to call wait
, if you call cancel
, as that also resets the
flag. Restarting the timer by calling start
will also reset the flag.
Trait Implementations
sourceimpl Cancel for WakeupTimer<'_>
impl Cancel for WakeupTimer<'_>
sourceimpl CountDown for WakeupTimer<'_>
impl CountDown for WakeupTimer<'_>
sourcefn start<T>(&mut self, delay: T) where
T: Into<Self::Time>,
fn start<T>(&mut self, delay: T) where
T: Into<Self::Time>,
Starts the wakeup timer
The delay
argument specifies the timer delay. If the wakeup_clock_config is set to
CkSpre, the value is in seconds and up to 17 bits
of delay are supported, giving us a range of over 36 hours.
Otherwise, the timeunit depends on the RTCCLK and the configured wakeup_clock_config value.
Panics
The delay
argument must be in the range 1 <= delay <= 2^17
.
Panics, if delay
is outside of that range.
impl Periodic for WakeupTimer<'_>
Auto Trait Implementations
impl<'r> RefUnwindSafe for WakeupTimer<'r>
impl<'r> Send for WakeupTimer<'r>
impl<'r> !Sync for WakeupTimer<'r>
impl<'r> Unpin for WakeupTimer<'r>
impl<'r> !UnwindSafe for WakeupTimer<'r>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more