[][src]Struct ticklock::clock::Frequency

pub struct Frequency { /* fields omitted */ }

Frequency abstraction

Using the frequency we can calculate duration

Methods

impl Frequency[src]

pub const fn tick(&self) -> Duration[src]

Return the duration of single clock pulse.

pub const fn ticks_in(&self, d: Duration) -> u64[src]

Return the number of entire clock pulse within a duration

pub fn into_hertz(&self) -> Frequency[src]

Change the frequency range in Hz. This is useful only for printing.

pub fn into_kilo(&self) -> Frequency[src]

Change the frequency range in KHz. This is useful only for printing.

pub fn into_mega(&self) -> Frequency[src]

Change the frequency range in MHz. This is useful only for printing.

pub fn into_milli(&self) -> Frequency[src]

Change the frequency range in mhz. This is useful only for printing.

Trait Implementations

impl Clone for Frequency[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq<Frequency> for Frequency[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Eq for Frequency[src]

impl Ord for Frequency[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

impl PartialOrd<Frequency> for Frequency[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Copy for Frequency[src]

impl Debug for Frequency[src]

impl Div<u32> for Frequency[src]

type Output = Frequency

The resulting type after applying the / operator.

fn div(self, rhs: u32) -> Frequency[src]

Allow to scale down a frequency

impl Div<Frequency> for Frequency[src]

type Output = u32

The resulting type after applying the / operator.

fn div(self, rhs: Frequency) -> u32[src]

Give the scale between 2 frequency. Particularly useful for selecting pre-scale value on MCU.

Auto Trait Implementations

impl Send for Frequency

impl Sync for Frequency

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

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