Struct Timer

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

Hardware timers

Implementations§

Source§

impl Timer<SYST>

System timer

Source

pub fn syst(syst: SYST, rcc: &mut Rcc) -> Self

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

pub fn get_current(&self) -> u32

Source§

impl Timer<SYST>

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source§

impl Timer<TIM1>

Source

pub fn use_external_clock<C: ExternalClock>(&mut self, clk: C, freq: Hertz)

Source§

impl Timer<TIM3>

Source

pub fn use_external_clock<C: ExternalClock>(&mut self, clk: C, freq: Hertz)

Source§

impl Timer<TIM2>

Source

pub fn use_external_clock<C: ExternalClock>(&mut self, clk: C, freq: Hertz)

Source§

impl Timer<TIM1>

Source

pub fn tim1(tim: TIM1, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM1

Releases the TIM peripheral

Source§

impl Timer<TIM3>

Source

pub fn tim3(tim: TIM3, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM3

Releases the TIM peripheral

Source§

impl Timer<TIM14>

Source

pub fn tim14(tim: TIM14, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM14

Releases the TIM peripheral

Source§

impl Timer<TIM16>

Source

pub fn tim16(tim: TIM16, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM16

Releases the TIM peripheral

Source§

impl Timer<TIM17>

Source

pub fn tim17(tim: TIM17, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM17

Releases the TIM peripheral

Source§

impl Timer<TIM2>

Source

pub fn tim2(tim: TIM2, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM2

Releases the TIM peripheral

Source§

impl Timer<TIM6>

Source

pub fn tim6(tim: TIM6, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM6

Releases the TIM peripheral

Source§

impl Timer<TIM7>

Source

pub fn tim7(tim: TIM7, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM7

Releases the TIM peripheral

Source§

impl Timer<TIM15>

Source

pub fn tim15(tim: TIM15, rcc: &mut Rcc) -> Self

Configures a TIM peripheral as a periodic count down timer

Source

pub fn pause(&mut self)

Pauses timer

Source

pub fn resume(&mut self)

Resumes 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 reset(&mut self)

Resets counter value

Source

pub fn get_current(&self) -> u32

Gets timer counter current value

Source

pub fn start(&mut self, timeout: MicroSecond)

Source

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

Source

pub fn release(self) -> TIM15

Releases the TIM peripheral

Trait Implementations§

Source§

impl CountDown for Timer<SYST>

Source§

type Time = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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

Source§

type Time = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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

Source§

type Time = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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

Source§

type Time = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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

Source§

type Time = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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

Source§

type Time = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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 = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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 = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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 = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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 = Duration<u32, 1, 1000000>

The unit of time used by this timer
Source§

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

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

Source§

impl Periodic for Timer<TIM14>

Source§

impl Periodic for Timer<TIM15>

Source§

impl Periodic for Timer<TIM16>

Source§

impl Periodic for Timer<TIM17>

Source§

impl Periodic for Timer<TIM2>

Source§

impl Periodic for Timer<TIM3>

Source§

impl Periodic for Timer<TIM6>

Source§

impl Periodic for Timer<TIM7>

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.