Struct systick_monotonic::Systick
source · [−]pub struct Systick<const TIMER_HZ: u32> { /* private fields */ }
Expand description
Systick implementing rtic_monotonic::Monotonic
which runs at a
settable rate using the TIMER_HZ
parameter.
Implementations
sourceimpl<const TIMER_HZ: u32> Systick<TIMER_HZ>
impl<const TIMER_HZ: u32> Systick<TIMER_HZ>
sourcepub fn new(systick: SYST, sysclk: u32) -> Self
pub fn new(systick: SYST, sysclk: u32) -> Self
Provide a new Monotonic
based on SysTick.
The sysclk
parameter is the speed at which SysTick runs at. This value should come from
the clock generation function of the used HAL.
Notice that the actual rate of the timer is a best approximation based on the given
sysclk
and TIMER_HZ
.
Trait Implementations
sourceimpl<const TIMER_HZ: u32> Monotonic for Systick<TIMER_HZ>
impl<const TIMER_HZ: u32> Monotonic for Systick<TIMER_HZ>
sourceconst DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = false
const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = false
This tells RTIC if it should disable the interrupt bound to the monotonic if there are no
scheduled tasks. One may want to set this to
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 moretype Instant = Instant<u64, 1, TIMER_HZ>
type Instant = Instant<u64, 1, TIMER_HZ>
The type for instant, defining an instant in time. Read more
type Duration = Duration<u64, 1, TIMER_HZ>
type Duration = Duration<u64, 1, TIMER_HZ>
The type for duration, defining an duration of time. Read more
sourceunsafe fn reset(&mut self)
unsafe fn reset(&mut self)
Optionally resets the counter to zero for a fixed baseline in a system. Read more
sourcefn set_compare(&mut self, _val: Self::Instant)
fn set_compare(&mut self, _val: Self::Instant)
Set the compare value of the timer interrupt. Read more
sourcefn clear_compare_flag(&mut self)
fn clear_compare_flag(&mut self)
Clear the compare interrupt flag.
sourcefn zero() -> Self::Instant
fn zero() -> Self::Instant
The time at time zero. Used by RTIC before the monotonic has been initialized.
sourcefn on_interrupt(&mut self)
fn on_interrupt(&mut self)
Optional. Commonly used for performing housekeeping of a timer when it has been extended,
e.g. a 16 bit timer extended to 32/64 bits. This will be called at the end of the interrupt
handler after all other operations have finished. Read more
sourcefn enable_timer(&mut self)
fn enable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
enabled. Read more
sourcefn disable_timer(&mut self)
fn disable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
disabled. Read more
Auto Trait Implementations
impl<const TIMER_HZ: u32> RefUnwindSafe for Systick<TIMER_HZ>
impl<const TIMER_HZ: u32> Send for Systick<TIMER_HZ>
impl<const TIMER_HZ: u32> !Sync for Systick<TIMER_HZ>
impl<const TIMER_HZ: u32> Unpin for Systick<TIMER_HZ>
impl<const TIMER_HZ: u32> UnwindSafe for Systick<TIMER_HZ>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more