pub struct Delay<TIMERX> { /* private fields */ }Expand description
A timer given over to blocking delays.
Unlike CountDownTimer it promises no interval: each call configures the
dividers, waits, and stops the counter again, so any length can be asked for
at any time.
Implementations§
Source§impl<TIMERX: Instance> Delay<TIMERX>
impl<TIMERX: Instance> Delay<TIMERX>
Sourcepub fn delay<const NOM: u64, const DENOM: u64>(
&mut self,
interval: Duration<u32, NOM, DENOM>,
)
pub fn delay<const NOM: u64, const DENOM: u64>( &mut self, interval: Duration<u32, NOM, DENOM>, )
Blocks for interval, in whatever scale the caller wrote it in.
Rounding and the saturation ceiling are the same as in
Timer::start_interval, the dividers being derived the same way.
Sourcepub fn into_timer(self) -> Timer<TIMERX>
pub fn into_timer(self) -> Timer<TIMERX>
Takes the timer back out of delay duty, stopped and ready to be started.
Trait Implementations§
Source§impl<TIMERX: Instance> DelayNs for Delay<TIMERX>
Blocking delays for portable drivers, delegating to Delay::delay.
impl<TIMERX: Instance> DelayNs for Delay<TIMERX>
Blocking delays for portable drivers, delegating to Delay::delay.
Resolution is one timer tick — around 20 ns at 48 MHz — so a finer request is
served as a single tick. delay_us/delay_ms are the trait’s own defaults,
splitting long waits into chunks of at most u32::MAX nanoseconds, well
inside what the dividers span.
Source§fn delay_ns(&mut self, ns: u32)
fn delay_ns(&mut self, ns: u32)
ns nanoseconds. Pause can be longer
if the implementation requires it due to precision/timing issues.