Struct dwt_systick_monotonic::DwtSystick
source · [−]pub struct DwtSystick<const TIMER_HZ: u32> { /* private fields */ }
Expand description
DWT and Systick combination implementing rtic_monotonic::Monotonic
.
This implementation is tickless. It does not use periodic interrupts to count
“ticks” (like systick-monotonic
) but only to obtain actual desired compare
events and to manage overflows.
The frequency of the DWT and SysTick is encoded using the parameter TIMER_HZ
.
They must be equal.
Note that the SysTick interrupt must not be disabled longer than half the cycle counter overflow period (typically a couple seconds).
When the extend
feature is enabled, the cycle counter width is extended to
u64
by detecting and counting overflows.
Implementations
sourceimpl<const TIMER_HZ: u32> DwtSystick<TIMER_HZ>
impl<const TIMER_HZ: u32> DwtSystick<TIMER_HZ>
sourcepub fn new(dcb: &mut DCB, dwt: DWT, systick: SYST, sysclk: u32) -> Self
pub fn new(dcb: &mut DCB, dwt: DWT, systick: SYST, sysclk: u32) -> Self
Enable the DWT and provide a new Monotonic
based on DWT and SysTick.
Note that the sysclk
parameter should come from e.g. the HAL’s clock generation function
so the speed calculated at runtime and the declared speed (generic parameter
TIMER_HZ
) can be compared.
Trait Implementations
sourceimpl<const TIMER_HZ: u32> Monotonic for DwtSystick<TIMER_HZ>
impl<const TIMER_HZ: u32> Monotonic for DwtSystick<TIMER_HZ>
sourceconst DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
false
if one is using the on_interrupt
method to perform housekeeping and need overflow interrupts to happen, such as when
extending a 16 bit timer to 32/64 bits, even if there are no scheduled tasks. Read more