Struct DeadTimeCfg

Source
pub struct DeadTimeCfg { /* private fields */ }
Available on crate feature unstable only.
Expand description

Configuration for MCPWM Operator DeadTime It’s recommended to reference the technical manual for configuration

Implementations§

Source§

impl DeadTimeCfg

Source

pub const fn new_bypass() -> DeadTimeCfg

Uses the following configuration:

  • Clock: PWM_clk
  • Bypass: A & B
  • Inputs: A->A, B->B (InSel)
  • Outputs: A->A, B->B (OutSwap)
  • No Dual-edge B
  • No Invert
  • FED/RED update mode = immediate
Source

pub const fn new_ahc() -> DeadTimeCfg

Active High Complementary (AHC) from Technical Reference manual

Will generate a PWM from input PWMA, such that output PWMA & PWMB are each others complement except during a transition in which they will be both off (as deadtime) such that they should never overlap, useful for H-Bridge type scenarios

Source

pub const fn invert_output(self, fed: bool, red: bool) -> Self

Sets FED/RED output inverter Inverts the output of the FED/RED module (excl DEB mode feedback)

Source

pub const fn set_output_swap(self, stream: PWMStream, swap: bool) -> Self

Swaps the output of a PWM Stream i.e. If both streams have output_swap enabled, the output of the module is swapped, while if only one is enabled that one ‘copies’ from the other stream

Source

pub const fn set_bypass(self, stream: PWMStream, enable: bool) -> Self

Set PWMA/PWMB stream to bypass everything except output_swap This means no deadtime is applied when enabled

Source

pub const fn select_clock(self, pwm_clock: bool) -> Self

Select Between PWMClk & PT_Clk

Source

pub const fn select_input(self, fed: PWMStream, red: PWMStream) -> Self

Select which stream is used for the input of FED/RED

Trait Implementations§

Source§

impl Clone for DeadTimeCfg

Source§

fn clone(&self) -> DeadTimeCfg

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DeadTimeCfg

Auto Trait Implementations§

§

impl Freeze for DeadTimeCfg

§

impl RefUnwindSafe for DeadTimeCfg

§

impl Send for DeadTimeCfg

§

impl Sync for DeadTimeCfg

§

impl Unpin for DeadTimeCfg

§

impl UnwindSafe for DeadTimeCfg

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.