[][src]Trait stspin220::embedded_time::Clock

pub trait Clock {
    type T: TimeInt + Hash;

    pub const SCALING_FACTOR: Fraction;

    pub fn try_now(&self) -> Result<Instant<Self>, Error>;

    pub fn new_timer<Dur>(
        &self,
        duration: Dur
    ) -> Timer<'_, OneShot, Armed, Self, Dur>
    where
        Dur: Duration + FixedPoint
, { ... } }

The Clock trait provides an abstraction for hardware-specific timer peripherals, external timer devices, RTCs, etc.

The Clock is characterized by an inner unsigned integer storage type (either u32 or u64), a u32/u32 Fraction defining the duration (in seconds) of one count of the Clock, and a custom error type representing errors that may be generated by the implementation.

In addition to the Clock::try_now() method which returns an Instant, software Timers can be spawned from a Clock object.

Associated Types

type T: TimeInt + Hash[src]

The type to hold the tick count

Loading content...

Associated Constants

pub const SCALING_FACTOR: Fraction[src]

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

Loading content...

Required methods

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

Loading content...

Provided methods

pub 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

Loading content...

Implementors

Loading content...