Struct PwmManager

Source
pub struct PwmManager<TIM, const FREQ: u32>
where TIM: Instance + WithPwm,
{ /* private fields */ }

Implementations§

Source§

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

Source

pub fn release(self, _channels: TIM::Channels) -> FTimer<TIM, FREQ>

Source§

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

Source

pub fn get_max_duty(&self) -> u16

Get the maximum duty cycle value of the timer

If 0 returned means max_duty is 2^16

Source

pub fn get_period(&self) -> TimerDurationU32<FREQ>

Get the PWM frequency of the timer as a duration

Source

pub fn set_period(&mut self, period: TimerDurationU32<FREQ>)

Set the PWM frequency for the timer from a duration

Source§

impl<TIM, const FREQ: u32> PwmManager<TIM, FREQ>
where TIM: Instance + WithPwm + Advanced,

Source

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

Set number DTS ticks during that the primary and complementary PWM pins are simultaneously forced to their inactive states ( see Polarity setting ) when changing PWM state. This duration when both channels are in an ‘off’ state is called ‘dead time’.

This is necessary in applications like motor control or power converters to prevent the destruction of the switching elements by short circuit in the moment of switching.

Source

pub fn set_dead_time_bits(&mut self, bits: u8)

Set raw dead time (DTG) bits

The dead time generation is nonlinear and constrained by the DTS tick duration. DTG register configuration and calculation of the actual resulting dead time is described in the application note RM0368 from ST Microelectronics

Source

pub fn get_dead_time(&self) -> u16

Return dead time for complementary pins in the unit of DTS ticks

Source

pub fn get_dead_time_bits(&self) -> u8

Get raw dead time (DTG) bits

Source

pub fn set_cms(&mut self, mode: CenterAlignedMode)

Sets the alignment mode

Methods from Deref<Target = FTimer<TIM, FREQ>>§

Source

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

Calculate prescaler depending on Clocks state

Source

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

Trait Implementations§

Source§

impl<TIM, const FREQ: u32> Deref for PwmManager<TIM, FREQ>
where TIM: Instance + WithPwm,

Source§

type Target = FTimer<TIM, FREQ>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<TIM, const FREQ: u32> DerefMut for PwmManager<TIM, FREQ>
where TIM: Instance + WithPwm,

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<TIM, const FREQ: u32> UnwindSafe for PwmManager<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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.