kernel::hil::time

Trait ConvertTicks

Source
pub trait ConvertTicks<T: Ticks> {
    // Required methods
    fn ticks_from_seconds(&self, s: u32) -> T;
    fn ticks_from_ms(&self, ms: u32) -> T;
    fn ticks_from_us(&self, us: u32) -> T;
    fn ticks_to_seconds(&self, tick: T) -> u32;
    fn ticks_to_ms(&self, tick: T) -> u32;
    fn ticks_to_us(&self, tick: T) -> u32;
}

Required Methods§

Source

fn ticks_from_seconds(&self, s: u32) -> T

Returns the number of ticks in the provided number of seconds, rounding down any fractions. If the value overflows Ticks it returns Ticks::max_value().

Source

fn ticks_from_ms(&self, ms: u32) -> T

Returns the number of ticks in the provided number of milliseconds, rounding down any fractions. If the value overflows Ticks it returns Ticks::max_value().

Source

fn ticks_from_us(&self, us: u32) -> T

Returns the number of ticks in the provided number of microseconds, rounding down any fractions. If the value overflows Ticks it returns Ticks::max_value().

Source

fn ticks_to_seconds(&self, tick: T) -> u32

Returns the number of seconds in the provided number of ticks, rounding down any fractions. If the value overflows u32, u32::MAX is returned,

Source

fn ticks_to_ms(&self, tick: T) -> u32

Returns the number of milliseconds in the provided number of ticks, rounding down any fractions. If the value overflows u32, u32::MAX is returned,

Source

fn ticks_to_us(&self, tick: T) -> u32

Returns the number of microseconds in the provided number of ticks, rounding down any fractions. If the value overflows u32, u32::MAX is returned,

Implementors§

Source§

impl<T: Time + ?Sized> ConvertTicks<<T as Time>::Ticks> for T