Timer

Struct Timer 

Source
pub struct Timer<TIM> { /* private fields */ }

Implementations§

Source§

impl Timer<SYST>

Source

pub fn syst<T>(syst: SYST, timeout: T, clocks: Clocks) -> Timer<SYST>
where T: Into<Hertz>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an event

Source

pub fn unlisten(&mut self, event: Event)

Stops listening for an event

Source

pub fn stop(&mut self)

Stops the timer

Source

pub fn release(self) -> SYST

Releases the SYST

Source§

impl Timer<TIM1>

Source

pub fn tim1<T>( tim: TIM1, timeout: T, clocks: Clocks, apb1: &mut APB2, ) -> Timer<TIM1>
where T: Into<Hertz>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an event

Source

pub fn unlisten(&mut self, event: Event)

Stops listening for an event

Source

pub fn stop(&mut self)

Stops the timer

Source

pub fn clear_update_interrupt_flag(&mut self)

Clears Update Interrupt Flag

Source

pub fn release(self) -> TIM1

Releases the TIM Peripheral

Source§

impl Timer<TIM2>

Source

pub fn tim2<T>( tim: TIM2, timeout: T, clocks: Clocks, apb1: &mut APB1, ) -> Timer<TIM2>
where T: Into<Hertz>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an event

Source

pub fn unlisten(&mut self, event: Event)

Stops listening for an event

Source

pub fn stop(&mut self)

Stops the timer

Source

pub fn clear_update_interrupt_flag(&mut self)

Clears Update Interrupt Flag

Source

pub fn release(self) -> TIM2

Releases the TIM Peripheral

Source§

impl Timer<TIM3>

Source

pub fn tim3<T>( tim: TIM3, timeout: T, clocks: Clocks, apb1: &mut APB1, ) -> Timer<TIM3>
where T: Into<Hertz>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an event

Source

pub fn unlisten(&mut self, event: Event)

Stops listening for an event

Source

pub fn stop(&mut self)

Stops the timer

Source

pub fn clear_update_interrupt_flag(&mut self)

Clears Update Interrupt Flag

Source

pub fn release(self) -> TIM3

Releases the TIM Peripheral

Source§

impl Timer<TIM4>

Source

pub fn tim4<T>( tim: TIM4, timeout: T, clocks: Clocks, apb1: &mut APB1, ) -> Timer<TIM4>
where T: Into<Hertz>,

Source

pub fn listen(&mut self, event: Event)

Starts listening for an event

Source

pub fn unlisten(&mut self, event: Event)

Stops listening for an event

Source

pub fn stop(&mut self)

Stops the timer

Source

pub fn clear_update_interrupt_flag(&mut self)

Clears Update Interrupt Flag

Source

pub fn release(self) -> TIM4

Releases the TIM Peripheral

Trait Implementations§

Source§

impl CountDown for Timer<SYST>

Source§

type Time = Hertz

The unit of time used by this timer
Source§

fn start<T>(&mut self, timeout: T)
where T: Into<Hertz>,

Starts a new count down
Source§

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

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

impl CountDown for Timer<TIM1>

Source§

type Time = Hertz

The unit of time used by this timer
Source§

fn start<T>(&mut self, timeout: T)
where T: Into<Hertz>,

Starts a new count down
Source§

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

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

impl CountDown for Timer<TIM2>

Source§

type Time = Hertz

The unit of time used by this timer
Source§

fn start<T>(&mut self, timeout: T)
where T: Into<Hertz>,

Starts a new count down
Source§

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

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

impl CountDown for Timer<TIM3>

Source§

type Time = Hertz

The unit of time used by this timer
Source§

fn start<T>(&mut self, timeout: T)
where T: Into<Hertz>,

Starts a new count down
Source§

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

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

impl CountDown for Timer<TIM4>

Source§

type Time = Hertz

The unit of time used by this timer
Source§

fn start<T>(&mut self, timeout: T)
where T: Into<Hertz>,

Starts a new count down
Source§

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

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

impl Periodic for Timer<SYST>

Source§

impl Periodic for Timer<TIM1>

Source§

impl Periodic for Timer<TIM2>

Source§

impl Periodic for Timer<TIM3>

Source§

impl Periodic for Timer<TIM4>

Auto Trait Implementations§

§

impl<TIM> Freeze for Timer<TIM>
where TIM: Freeze,

§

impl<TIM> RefUnwindSafe for Timer<TIM>
where TIM: RefUnwindSafe,

§

impl<TIM> Send for Timer<TIM>
where TIM: Send,

§

impl<TIM> Sync for Timer<TIM>
where TIM: Sync,

§

impl<TIM> Unpin for Timer<TIM>
where TIM: Unpin,

§

impl<TIM> UnwindSafe for Timer<TIM>
where TIM: 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<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> Same for T

Source§

type Output = T

Should always be Self
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.