pub struct DeadTimeCfg { /* private fields */ }
Expand description

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

Implementations§

source§

impl DeadTimeCfg

source

pub 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
  • FED/RED = 0
source

pub fn new_ahc(red_delay: Option<u16>, fed_delay: Option<u16>) -> 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

Default delay on both rising (red) and falling (fed) edge is 16 cycles

source

pub fn set_delay(&mut self, rising_edge: u16, falling_edge: u16)

Sets the delay for the FED/RED module

source

pub fn invert_output(&mut self, fed: bool, red: bool)

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

source

pub fn set_output_swap(&mut self, stream: PWMStream, swap: bool)

Swaps the output of a PWM Stream i.e. If 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 fn set_bypass(&mut self, stream: PWMStream, enable: bool)

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

source

pub fn select_clock(&mut self, pwm_clock: bool)

Select Between PWMClk & PT_Clk

source

pub fn select_input(&mut self, fed: PWMStream, red: PWMStream)

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

Auto Trait Implementations§

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>,

§

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>,

§

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.