Struct dwt_systick_monotonic::DwtSystick[][src]

pub struct DwtSystick<const FREQ: u32> { /* fields omitted */ }
Expand description

DWT and Systick combination implementing embedded_time::Clock and rtic_monotonic::Monotonic

The frequency of the DWT and SysTick is encoded using the parameter FREQ.

Implementations

impl<const FREQ: u32> DwtSystick<FREQ>[src]

pub fn new(dcb: &mut DCB, dwt: DWT, systick: SYST, sysclk: u32) -> Self[src]

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 real speed and the declared speed can be compared.

Trait Implementations

impl<const FREQ: u32> Clock for DwtSystick<FREQ>[src]

type T = u32

The type to hold the tick count

const SCALING_FACTOR: Fraction[src]

The duration of one clock tick in seconds, AKA the clock precision.

fn try_now(&self) -> Result<Instant<Self>, Error>[src]

Get the current Instant Read more

fn new_timer<Dur>(&self, duration: Dur) -> Timer<'_, OneShot, Armed, Self, Dur> where
    Dur: Duration + FixedPoint
[src]

Spawn a new, OneShot Timer from this clock

impl<const FREQ: u32> Monotonic for DwtSystick<FREQ>[src]

const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool[src]

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 more

unsafe fn reset(&mut self)[src]

Optionally resets the counter to zero for a fixed baseline in a system. Read more

fn set_compare(&mut self, val: &Instant<Self>)[src]

Set the compare value of the timer interrupt.

fn clear_compare_flag(&mut self)[src]

Clear the compare interrupt flag.

fn on_interrupt(&mut self)[src]

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

fn enable_timer(&mut self)[src]

Optional. This is used to save power, this is called when the Monotonic interrupt is enabled. Read more

fn disable_timer(&mut self)[src]

Optional. This is used to save power, this is called when the Monotonic interrupt is disabled. Read more

Auto Trait Implementations

impl<const FREQ: u32> Send for DwtSystick<FREQ>

impl<const FREQ: u32> !Sync for DwtSystick<FREQ>

impl<const FREQ: u32> Unpin for DwtSystick<FREQ>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.