Struct Timer

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

Hardware timers

Implementations§

Source§

impl Timer<SYST>

Source

pub fn syst<T>(syst: SYST, timeout: T, rcc: &mut Rcc) -> Self
where T: Into<Hertz>,

Configures the SYST clock as a periodic count down timer

Source

pub fn listen(&mut self)

Starts listening

Source

pub fn unlisten(&mut self)

Stops listening

Source§

impl Timer<TIM2>

Source

pub fn tim2<T>(tim: TIM2, timeout: T, rcc: &mut Rcc) -> Self
where T: Into<Hertz>,

Configures a TIM peripheral as a periodic count down timer

Source

pub fn listen(&mut self)

Starts listening

Source

pub fn unlisten(&mut self)

Stops listening

Source

pub fn clear_irq(&mut self)

Clears 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, rcc: &mut Rcc) -> Self
where T: Into<Hertz>,

Configures a TIM peripheral as a periodic count down timer

Source

pub fn listen(&mut self)

Starts listening

Source

pub fn unlisten(&mut self)

Stops listening

Source

pub fn clear_irq(&mut self)

Clears 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, rcc: &mut Rcc) -> Self
where T: Into<Hertz>,

Configures a TIM peripheral as a periodic count down timer

Source

pub fn listen(&mut self)

Starts listening

Source

pub fn unlisten(&mut self)

Stops listening

Source

pub fn clear_irq(&mut self)

Clears interrupt flag

Source

pub fn release(self) -> TIM4

Releases the TIM peripheral

Source§

impl Timer<TIM5>

Source

pub fn tim5<T>(tim: TIM5, timeout: T, rcc: &mut Rcc) -> Self
where T: Into<Hertz>,

Configures a TIM peripheral as a periodic count down timer

Source

pub fn listen(&mut self)

Starts listening

Source

pub fn unlisten(&mut self)

Stops listening

Source

pub fn clear_irq(&mut self)

Clears interrupt flag

Source

pub fn release(self) -> TIM5

Releases the TIM peripheral

Source§

impl Timer<TIM6>

Source

pub fn tim6<T>(tim: TIM6, timeout: T, rcc: &mut Rcc) -> Self
where T: Into<Hertz>,

Configures a TIM peripheral as a periodic count down timer

Source

pub fn listen(&mut self)

Starts listening

Source

pub fn unlisten(&mut self)

Stops listening

Source

pub fn clear_irq(&mut self)

Clears interrupt flag

Source

pub fn release(self) -> TIM6

Releases the TIM peripheral

Source§

impl Timer<TIM7>

Source

pub fn tim7<T>(tim: TIM7, timeout: T, rcc: &mut Rcc) -> Self
where T: Into<Hertz>,

Configures a TIM peripheral as a periodic count down timer

Source

pub fn listen(&mut self)

Starts listening

Source

pub fn unlisten(&mut self)

Stops listening

Source

pub fn clear_irq(&mut self)

Clears interrupt flag

Source

pub fn release(self) -> TIM7

Releases the TIM peripheral

Source§

impl Timer<TIM9>

Source

pub fn tim9<T>(tim: TIM9, timeout: T, rcc: &mut Rcc) -> Self
where T: Into<Hertz>,

Configures a TIM peripheral as a periodic count down timer

Source

pub fn listen(&mut self)

Starts listening

Source

pub fn unlisten(&mut self)

Stops listening

Source

pub fn clear_irq(&mut self)

Clears interrupt flag

Source

pub fn release(self) -> TIM9

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<(), 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<(), 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<(), 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<(), Void>

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

impl CountDown for Timer<TIM5>

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<(), Void>

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

impl CountDown for Timer<TIM6>

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<(), Void>

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

impl CountDown for Timer<TIM7>

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<(), Void>

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

impl CountDown for Timer<TIM9>

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<(), Void>

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

impl Periodic for Timer<SYST>

Source§

impl Periodic for Timer<TIM2>

Source§

impl Periodic for Timer<TIM3>

Source§

impl Periodic for Timer<TIM4>

Source§

impl Periodic for Timer<TIM5>

Source§

impl Periodic for Timer<TIM6>

Source§

impl Periodic for Timer<TIM7>

Source§

impl Periodic for Timer<TIM9>

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