[][src]Struct cortex_m_systick_countdown::SysTickCalibration

pub struct SysTickCalibration {
    pub ticks_per_ms: u32,
}

Configuration information for setting the SysTick reload value.

Fields

ticks_per_ms: u32

The number of ticks of the SysTick’s clock source to get to 1ms.

Note that reload values should typically be one fewer than the number of clock cycles, since an extra one is always needed to detect the rollover and reload the counter.

Methods

impl SysTickCalibration[src]

pub fn built_in() -> Option<SysTickCalibration>[src]

Gets the calibration from the chip’s built-in "ticks per 10ms" value.

Returns an Option because this value is is not present on all devices (SAMD51 for example seems to not have it, since its processor speed is configurable). In those cases, use from_clock_hz instead.

pub fn from_clock_hz(hz: u32) -> SysTickCalibration[src]

Creates a calibration from the underlying frequency of the clock that drives SysTick. This typically seems to be the same frequency that the processor is currently running at.

For SAMD51 processors, if you don’t want to hard-code a known size, you can get this from the gclck0 frequency.

Auto Trait Implementations

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self