Struct PwmHzManager

Source
pub struct PwmHzManager<TIM>
where TIM: Instance + WithPwm,
{ /* private fields */ }

Implementations§

Source§

impl<TIM> PwmHzManager<TIM>
where TIM: Instance + WithPwm + Split,

Source

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

Source§

impl<TIM> PwmHzManager<TIM>
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) -> Hertz

Get the PWM frequency of the timer in Hertz

Source

pub fn set_period(&mut self, period: Hertz)

Set the PWM frequency for the timer in Hertz

Source§

impl<TIM> PwmHzManager<TIM>
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 = Timer<TIM>>§

Source

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

Source

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

Trait Implementations§

Source§

impl<TIM> Deref for PwmHzManager<TIM>
where TIM: Instance + WithPwm,

Source§

type Target = Timer<TIM>

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<TIM> DerefMut for PwmHzManager<TIM>
where TIM: Instance + WithPwm,

Source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<TIM> Freeze for PwmHzManager<TIM>
where TIM: Freeze,

§

impl<TIM> RefUnwindSafe for PwmHzManager<TIM>
where TIM: RefUnwindSafe,

§

impl<TIM> Send for PwmHzManager<TIM>
where TIM: Send,

§

impl<TIM> Sync for PwmHzManager<TIM>
where TIM: Sync,

§

impl<TIM> Unpin for PwmHzManager<TIM>
where TIM: Unpin,

§

impl<TIM> UnwindSafe for PwmHzManager<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<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.