Channel

Struct Channel 

Source
pub struct Channel<T: Reg>(/* private fields */);
Expand description

Represents a MRT0 channel

§embedded-hal traits

Implementations§

Source§

impl<T> Channel<T>
where T: Trait,

Source

pub fn start(&mut self, reload: Ticks)

Start the timer

The reload argument must be smaller than or equal to MAX_VALUE.

Source

pub fn is_running(&self) -> bool

Indicates whether the timer is running

Source

pub fn value(&self) -> u32

Returns the current timer value

Source

pub fn reload_value(&self) -> u32

Returns the reload value of the timer

Trait Implementations§

Source§

impl<T> Clock for Channel<T>
where T: Trait,

Source§

const SCALING_FACTOR: Fraction

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

type T = u32

The type to hold the tick count
Source§

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

Get the current Instant Read more
Source§

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

Spawn a new, OneShot Timer from this clock
Source§

impl<T> CountDown for Channel<T>
where T: Trait,

Source§

type Time = Ticks

The timer operates in clock ticks from the system clock, that means it runs at 12_000_000 ticks per second if you haven’t changed it.

It can also only use values smaller than 0x7FFFFFFF.

Source§

type Error = Void

An enumeration of CountDown errors. Read more
Source§

fn start<Time>(&mut self, count: Time) -> Result<(), Self::Error>
where Time: Into<Self::Time>,

Starts a new count down
Source§

fn wait(&mut self) -> Result<(), Self::Error>

Non-blockingly “waits” until the count down finishes Read more
Source§

impl<T> CountDown for Channel<T>
where T: Trait,

Source§

type Time = Ticks

The timer operates in clock ticks from the system clock, that means it runs at 12_000_000 ticks per second if you haven’t changed it.

It can also only use values smaller than 0x7FFFFFFF.

Source§

fn start<Time>(&mut self, count: Time)
where Time: Into<Self::Time>,

Starts a new count down
Source§

fn wait(&mut self) -> Result<(), Void>

Non-blockingly “waits” until the count down finishes Read more
Source§

impl<T> Periodic for Channel<T>
where T: Trait,

Source§

impl<T> Periodic for Channel<T>
where T: Trait,

Auto Trait Implementations§

§

impl<T> Freeze for Channel<T>

§

impl<T> RefUnwindSafe for Channel<T>
where T: RefUnwindSafe,

§

impl<T> Send for Channel<T>

§

impl<T> !Sync for Channel<T>

§

impl<T> Unpin for Channel<T>

§

impl<T> UnwindSafe for Channel<T>
where T: RefUnwindSafe,

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.