embassy-stm32

Crates

git

Versions

stm32h743ii

Flavors

Skip to main content

TimingUnit

Struct TimingUnit 

Source
pub struct TimingUnit<'d, T: Instance> { /* private fields */ }
Expand description

Advanced timing unit

Implementations§

Source§

impl<'d, T: Instance> TimingUnit<'d, T>

Source

pub fn new<C: TimingUnitInstance>( _tim: SubTimer<'d, T, C>, pin1: Option<HrPin1<'d, T, C>>, pin2: Option<HrPin2<'d, T, C>>, config: Config, ) -> Self

Create a new HRTIM timing unit driver.

Source

pub fn index(&self) -> usize

Timing unit index

Source

pub fn set_prescaler(&mut self, ckpsc: Prescaler)

Set timing unit prescaler

Source

pub fn set_period(&mut self, per: u16)

Set timing unit period

Source

pub fn set_frequency(&mut self, frequency: Hertz)

Set frequency

Dont use after timer has been started

Source

pub fn set_dead_time(&mut self, dead_time: u16)

Set the dead time as a proportion of max_duty

Source

pub fn enable_set_src(&mut self, output: Output, src: TriggerSource)

Enable set source for output

The output will be set to active level if the source triggers

Source

pub fn enable_rst_src(&mut self, output: Output, src: TriggerSource)

Enable reset source for output

The output will be set to inactive level if the source triggers

Source

pub fn set_compare(&mut self, cmp_idx: CompareRegister, value: u16)

Set compare register value

Source

pub fn get_max_compare_value(&mut self) -> u16

Get the maximum compare value of a duty cycle

Source

pub fn start(&self, _common: &mut Common)

Start timer

NOTE: prescaler can not be changes once the timer has been started

Source

pub fn enable_output(&self, output: Output)

Enable output

Trait Implementations§

Source§

impl<'d, T: Instance> Drop for TimingUnit<'d, T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'d, T> !UnwindSafe for TimingUnit<'d, T>

§

impl<'d, T> Forget for TimingUnit<'d, T>

§

impl<'d, T> Freeze for TimingUnit<'d, T>

§

impl<'d, T> Move for TimingUnit<'d, T>

§

impl<'d, T> RefUnwindSafe for TimingUnit<'d, T>

§

impl<'d, T> Send for TimingUnit<'d, T>

§

impl<'d, T> Sync for TimingUnit<'d, T>

§

impl<'d, T> Unpin for TimingUnit<'d, T>

§

impl<'d, T> UnsafeUnpin for TimingUnit<'d, T>

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.