Struct Delay

Source
pub struct Delay { /* private fields */ }
Expand description

System timer (SysTick) as a delay provider

Implementations§

Source§

impl Delay

Source

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.

Source

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.

Source

pub fn free(self) -> SYST

Releases the system timer (SysTick) resource

Trait Implementations§

Source§

impl Debug for Delay

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DelayMs<Milliseconds> for Delay

Source§

fn delay_ms(&mut self, ms: Milliseconds)

Pauses execution for ms milliseconds
Source§

impl DelayMs<u16> for Delay

Source§

fn delay_ms(&mut self, ms: u16)

Pauses execution for ms milliseconds
Source§

impl DelayMs<u32> for Delay

Source§

fn delay_ms(&mut self, ms: u32)

Pauses execution for ms milliseconds
Source§

impl DelayMs<u8> for Delay

Source§

fn delay_ms(&mut self, ms: u8)

Pauses execution for ms milliseconds
Source§

impl DelayUs<Microseconds> for Delay

Source§

fn delay_us(&mut self, us: Microseconds)

Pauses execution for us microseconds
Source§

impl DelayUs<u16> for Delay

Source§

fn delay_us(&mut self, us: u16)

Pauses execution for us microseconds
Source§

impl DelayUs<u32> for Delay

Source§

fn delay_us(&mut self, us: u32)

Pauses execution for us microseconds
Source§

impl DelayUs<u8> for Delay

Source§

fn delay_us(&mut self, us: u8)

Pauses execution for us microseconds

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.