pub struct SysTick { /* private fields */ }
Expand description
The ARM Cortex-M SysTick peripheral
Documented in the Cortex-MX Devices Generic User Guide, Chapter 4.4
Implementations§
Source§impl SysTick
impl SysTick
Sourcepub unsafe fn new() -> SysTick
pub unsafe fn new() -> SysTick
Initialize the SysTick
with default values
Use this constructor if the core implementation has a pre-calibration value in hardware.
Sourcepub unsafe fn new_with_calibration(clock_speed: u32) -> SysTick
pub unsafe fn new_with_calibration(clock_speed: u32) -> SysTick
Initialize the SysTick
with an explicit clock speed
Use this constructor if the core implementation does not have a pre-calibration value.
clock_speed
- the frequency of SysTick tics in Hertz. For example, if the SysTick is driven by the CPU clock, it is simply the CPU speed.
Sourcepub unsafe fn new_with_calibration_and_external_clock(
clock_speed: u32,
) -> SysTick
pub unsafe fn new_with_calibration_and_external_clock( clock_speed: u32, ) -> SysTick
Initialize the SysTick
with an explicit clock speed and external source
Use this constructor if the core implementation does not have a pre-calibration value and you need an external clock source for the Systick.
clock_speed
- the frequency of SysTick tics in Hertz. For example, if the SysTick is driven by the CPU clock, it is simply the CPU speed.
Sourcepub fn set_hertz(
&self,
clock_speed: u32,
_capability: &dyn SysTickFrequencyCapability,
)
pub fn set_hertz( &self, clock_speed: u32, _capability: &dyn SysTickFrequencyCapability, )
Modifies the locally stored frequncy
§Important
This function does not change the actual systick frequency. This function must be called only while the clock is not armed. When changing the hardware systick frequency, the reload value register should be updated and the current value register should be reset, in order for the tick count to match the current frequency.
Trait Implementations§
Source§impl SchedulerTimer for SysTick
impl SchedulerTimer for SysTick
Source§fn start(&self, us: NonZero<u32>)
fn start(&self, us: NonZero<u32>)
us
argument is the length
of the timeslice in microseconds. Read more