Struct FTimer

Source
pub struct FTimer<TIM, const FREQ: u32> { /* private fields */ }
Expand description

Timer wrapper for fixed precision timers.

Uses fugit::TimerDurationU32 for most of operations

Implementations§

Source§

impl<TIM: Instance + WithPwm + Split, const FREQ: u32> FTimer<TIM, FREQ>

Source

pub fn pwm( self, time: TimerDurationU32<FREQ>, ) -> (PwmManager<TIM, FREQ>, TIM::Channels)

Source§

impl<TIM, const FREQ: u32> FTimer<TIM, FREQ>
where TIM: Instance + General<Width = u32> + WithPwm,

Source

pub fn monotonic(self) -> MonoTimer<TIM, FREQ>

Source§

impl<TIM, const FREQ: u32> FTimer<TIM, FREQ>
where TIM: Instance + General + WithPwm,

Source

pub fn monotonic64(self) -> MonoTimer64<TIM, FREQ>

Source§

impl<TIM: Instance, const FREQ: u32> FTimer<TIM, FREQ>

Source

pub fn new(tim: TIM, clocks: &Clocks) -> Self

Initialize timer

Source

pub fn configure(&mut self, clocks: &Clocks)

Calculate prescaler depending on Clocks state

Source

pub fn counter(self) -> Counter<TIM, FREQ>

Creates Counter that implements embedded_hal_02::timer::CountDown

Source

pub fn delay(self) -> Delay<TIM, FREQ>

Creates Delay that implements embedded_hal_02::blocking::delay traits

Source

pub fn release(self) -> TIM

Releases the TIM peripheral

Source§

impl<TIM: Instance + MasterTimer, const FREQ: u32> FTimer<TIM, FREQ>

Source

pub fn set_master_mode(&mut self, mode: TIM::Mms)

Trait Implementations§

Source§

impl<TIM: Instance, const FREQ: u32> ClearFlags for FTimer<TIM, FREQ>

Source§

type Flag = Flag

Enum of manually clearable flags
Source§

fn clear_flags(&mut self, event: impl Into<BitFlags<Flag>>)

Clear interrupts flags with Self::Flagss Read more
Source§

fn clear_all_flags(&mut self)

Clears all interrupts flags
Source§

impl<TIM: Instance, const FREQ: u32> Listen for FTimer<TIM, FREQ>

Source§

type Event = Event

Enum of bit flags associated with events
Source§

fn listen(&mut self, event: impl Into<BitFlags<Event>>)

Start listening for Events Read more
Source§

fn listen_only(&mut self, event: impl Into<BitFlags<Event>>)

Start listening for Events, stop all other Read more
Source§

fn unlisten(&mut self, event: impl Into<BitFlags<Event>>)

Stop listening for Events
Source§

fn listen_all(&mut self)

Start listening all Events
Source§

fn unlisten_all(&mut self)

Stop listening all Events
Source§

impl<TIM: Instance, const FREQ: u32> ReadFlags for FTimer<TIM, FREQ>

Source§

type Flag = Flag

Enum of bit flags
Source§

fn flags(&self) -> BitFlags<Flag>

Get all interrupts flags a once.

Auto Trait Implementations§

§

impl<TIM, const FREQ: u32> Freeze for FTimer<TIM, FREQ>
where TIM: Freeze,

§

impl<TIM, const FREQ: u32> RefUnwindSafe for FTimer<TIM, FREQ>
where TIM: RefUnwindSafe,

§

impl<TIM, const FREQ: u32> Send for FTimer<TIM, FREQ>
where TIM: Send,

§

impl<TIM, const FREQ: u32> Sync for FTimer<TIM, FREQ>
where TIM: Sync,

§

impl<TIM, const FREQ: u32> Unpin for FTimer<TIM, FREQ>
where TIM: Unpin,

§

impl<TIM, const FREQ: u32> UnwindSafe for FTimer<TIM, FREQ>
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.