pub struct WakeupTimer<'r> { /* private fields */ }Expand description
The RTC wakeup timer
This timer can be used in two ways:
- Continually call
waituntil 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§
Source§impl Cancel for WakeupTimer<'_>
impl Cancel for WakeupTimer<'_>
Source§impl CountDown for WakeupTimer<'_>
impl CountDown for WakeupTimer<'_>
Source§fn start<T>(&mut self, delay: T)
fn start<T>(&mut self, delay: T)
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.