pub struct Delay { /* private fields */ }Expand description
System timer (SysTick) as a delay provider
Implementations§
Source§impl Delay
impl Delay
Sourcepub fn new(syst: SYST, clocks: Clocks) -> Self
pub fn new(syst: SYST, clocks: Clocks) -> Self
Configures the system timer (SysTick) as a delay provider
§Limitations
Depending on the core clock, this delay provider can delay between 1 minute (for 72 Mhz) up to almost 9 minutes (for 8 Mhz). Higher input values will be capped to these limits.
For accuracy purposes and because this is a blocking, busy-waiting function, if delays in the second to minute range are needed, use timers instead.
Sourcepub unsafe fn peripheral(&mut self) -> &mut SYST
pub unsafe fn peripheral(&mut self) -> &mut SYST
Get access to the underlying register block.
§Safety
This function is not memory unsafe per se, but does not guarantee anything about assumptions of invariants made in this implementation.
Changing specific options can lead to un-expected behavior and nothing is guaranteed.
Trait Implementations§
Source§impl DelayMs<Milliseconds> for Delay
impl DelayMs<Milliseconds> for Delay
Source§fn delay_ms(&mut self, ms: Milliseconds)
fn delay_ms(&mut self, ms: Milliseconds)
Pauses execution for
ms millisecondsSource§impl DelayUs<Microseconds> for Delay
impl DelayUs<Microseconds> for Delay
Source§fn delay_us(&mut self, us: Microseconds)
fn delay_us(&mut self, us: Microseconds)
Pauses execution for
us microsecondsAuto Trait Implementations§
impl Freeze for Delay
impl RefUnwindSafe for Delay
impl Send for Delay
impl !Sync for Delay
impl Unpin for Delay
impl UnwindSafe for Delay
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