Trait rtic_time::timer_queue::TimerQueueBackend
source · pub trait TimerQueueBackend: 'static + Sized {
type Ticks: TimerQueueTicks;
// Required methods
fn now() -> Self::Ticks;
fn set_compare(instant: Self::Ticks);
fn clear_compare_flag();
fn pend_interrupt();
fn timer_queue() -> &'static TimerQueue<Self>;
// Provided methods
fn on_interrupt() { ... }
fn enable_timer() { ... }
fn disable_timer() { ... }
}
Expand description
A backend definition for a monotonic clock/counter.
Required Associated Types§
sourcetype Ticks: TimerQueueTicks
type Ticks: TimerQueueTicks
The type for ticks.
Required Methods§
sourcefn set_compare(instant: Self::Ticks)
fn set_compare(instant: Self::Ticks)
Set the compare value of the timer interrupt.
Note: This method does not need to handle race conditions of the monotonic, the timer queue in RTIC checks this.
sourcefn clear_compare_flag()
fn clear_compare_flag()
Clear the compare interrupt flag.
sourcefn pend_interrupt()
fn pend_interrupt()
Pend the timer’s interrupt.
sourcefn timer_queue() -> &'static TimerQueue<Self>
fn timer_queue() -> &'static TimerQueue<Self>
Returns a reference to the underlying timer queue.
Provided Methods§
sourcefn on_interrupt()
fn on_interrupt()
Optional. Runs on interrupt before any timer queue handling.
sourcefn enable_timer()
fn enable_timer()
Optional. This is used to save power, this is called when the timer queue is not empty.
Enabling and disabling the monotonic needs to propagate to now
so that an instant
based of now()
is still valid.
NOTE: This may be called more than once.
sourcefn disable_timer()
fn disable_timer()
Optional. This is used to save power, this is called when the timer queue is empty.
Enabling and disabling the monotonic needs to propagate to now
so that an instant
based of now()
is still valid.
NOTE: This may be called more than once.