pub struct SysTickCalibration {
pub ticks_per_ms: u32,
}Expand description
Configuration information for setting the SysTick reload value.
Fields§
§ticks_per_ms: u32The 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.
Implementations§
Source§impl SysTickCalibration
impl SysTickCalibration
Sourcepub fn built_in() -> Option<SysTickCalibration>
pub fn built_in() -> Option<SysTickCalibration>
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.
Sourcepub fn from_clock_hz(hz: u32) -> SysTickCalibration
pub fn from_clock_hz(hz: u32) -> SysTickCalibration
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.