Struct rp2040_hal::timer::monotonic::Monotonic

source ·
pub struct Monotonic<A>(pub Timer, _);
Expand description

RTIC Monotonic Implementation

Tuple Fields§

§0: Timer

Implementations§

source§

impl<A: Alarm> Monotonic<A>

source

pub const fn new(timer: Timer, alarm: A) -> Self

Creates a new monotonic.

Trait Implementations§

source§

impl<A: Alarm> Monotonic for Monotonic<A>

§

type Instant = Instant<u64, 1, 1000000>

The type for instant, defining an instant in time. Read more
§

type Duration = Duration<u64, 1, 1000000>

The type for duration, defining an duration of time. Read more
source§

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.
source§

fn now(&mut self) -> Instant

Get the current time.
source§

fn set_compare(&mut self, instant: Instant)

Set the compare value of the timer interrupt. Read more
source§

fn clear_compare_flag(&mut self)

Clear the compare interrupt flag.
source§

fn zero() -> Self::Instant

The time at time zero. Used by RTIC before the monotonic has been initialized.
source§

unsafe fn reset(&mut self)

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

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.
source§

fn enable_timer(&mut self)

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

fn disable_timer(&mut self)

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

Auto Trait Implementations§

§

impl<A> Freeze for Monotonic<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for Monotonic<A>
where A: RefUnwindSafe,

§

impl<A> Send for Monotonic<A>
where A: Send,

§

impl<A> Sync for Monotonic<A>
where A: Sync,

§

impl<A> Unpin for Monotonic<A>
where A: Unpin,

§

impl<A> UnwindSafe for Monotonic<A>
where A: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

§

type Remainder = Choices

source§

fn subset( self ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

source§

fn lift_into(self) -> U

Performs the indexed conversion.
source§

impl<Source> Sculptor<HNil, HNil> for Source

§

type Remainder = Source

source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.