pub struct Operator<const OP: u8, PWM> { /* private fields */ }Expand description
A MCPWM operator
The PWM Operator submodule has the following functions:
- Generates a PWM signal pair, based on timing references obtained from the corresponding PWM timer.
- Each signal out of the PWM signal pair includes a specific pattern of dead time. (Not yet implemented)
- Superimposes a carrier on the PWM signal, if configured to do so. (Not yet implemented)
- Handles response under fault conditions. (Not yet implemented)
Implementations§
Source§impl<const OP: u8, PWM: PwmPeripheral> Operator<OP, PWM>
impl<const OP: u8, PWM: PwmPeripheral> Operator<OP, PWM>
Sourcepub fn with_pin_a<'d>(
self,
pin: impl Peripheral<P = impl PeripheralOutput> + 'd,
config: PwmPinConfig<true>,
) -> PwmPin<'d, PWM, OP, true>
pub fn with_pin_a<'d>( self, pin: impl Peripheral<P = impl PeripheralOutput> + 'd, config: PwmPinConfig<true>, ) -> PwmPin<'d, PWM, OP, true>
Use the A output with the given pin and configuration
Sourcepub fn with_pin_b<'d>(
self,
pin: impl Peripheral<P = impl PeripheralOutput> + 'd,
config: PwmPinConfig<false>,
) -> PwmPin<'d, PWM, OP, false>
pub fn with_pin_b<'d>( self, pin: impl Peripheral<P = impl PeripheralOutput> + 'd, config: PwmPinConfig<false>, ) -> PwmPin<'d, PWM, OP, false>
Use the B output with the given pin and configuration
Sourcepub fn with_pins<'d>(
self,
pin_a: impl Peripheral<P = impl PeripheralOutput> + 'd,
config_a: PwmPinConfig<true>,
pin_b: impl Peripheral<P = impl PeripheralOutput> + 'd,
config_b: PwmPinConfig<false>,
) -> (PwmPin<'d, PWM, OP, true>, PwmPin<'d, PWM, OP, false>)
pub fn with_pins<'d>( self, pin_a: impl Peripheral<P = impl PeripheralOutput> + 'd, config_a: PwmPinConfig<true>, pin_b: impl Peripheral<P = impl PeripheralOutput> + 'd, config_b: PwmPinConfig<false>, ) -> (PwmPin<'d, PWM, OP, true>, PwmPin<'d, PWM, OP, false>)
Use both the A and the B output with the given pins and configurations
Sourcepub fn with_linked_pins<'d>(
self,
pin_a: impl Peripheral<P = impl PeripheralOutput> + 'd,
config_a: PwmPinConfig<true>,
pin_b: impl Peripheral<P = impl PeripheralOutput> + 'd,
config_b: PwmPinConfig<false>,
config_dt: DeadTimeCfg,
) -> LinkedPins<'d, PWM, OP>
pub fn with_linked_pins<'d>( self, pin_a: impl Peripheral<P = impl PeripheralOutput> + 'd, config_a: PwmPinConfig<true>, pin_b: impl Peripheral<P = impl PeripheralOutput> + 'd, config_b: PwmPinConfig<false>, config_dt: DeadTimeCfg, ) -> LinkedPins<'d, PWM, OP>
Link two pins using the deadtime generator
This is useful for complementary or mirrored signals with or without configured deadtime
Auto Trait Implementations§
impl<const OP: u8, PWM> Freeze for Operator<OP, PWM>
impl<const OP: u8, PWM> RefUnwindSafe for Operator<OP, PWM>where
PWM: RefUnwindSafe,
impl<const OP: u8, PWM> Send for Operator<OP, PWM>where
PWM: Send,
impl<const OP: u8, PWM> Sync for Operator<OP, PWM>where
PWM: Sync,
impl<const OP: u8, PWM> Unpin for Operator<OP, PWM>where
PWM: Unpin,
impl<const OP: u8, PWM> UnwindSafe for Operator<OP, PWM>where
PWM: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more