pub struct PwmChannel<TIM: CPin<C>, const C: u8, const COMP: bool = false, Otype = PushPull> { /* private fields */ }
Implementations§
Source§impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> PwmChannel<TIM, C, COMP, Otype>
impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> PwmChannel<TIM, C, COMP, Otype>
Source§impl<TIM: Instance + CPin<C>, const C: u8, const COMP: bool, Otype> PwmChannel<TIM, C, COMP, Otype>
impl<TIM: Instance + CPin<C>, const C: u8, const COMP: bool, Otype> PwmChannel<TIM, C, COMP, Otype>
Source§impl<TIM: Instance + CPin<C> + NCPin<C>, const C: u8, const COMP: bool, Otype> PwmChannel<TIM, C, COMP, Otype>
impl<TIM: Instance + CPin<C> + NCPin<C>, const C: u8, const COMP: bool, Otype> PwmChannel<TIM, C, COMP, Otype>
pub fn with_complementary( self, pin: impl Into<TIM::ChN<Otype>>, ) -> PwmChannel<TIM, C, true, Otype>
Source§impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> PwmChannel<TIM, C, COMP, Otype>
impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> PwmChannel<TIM, C, COMP, Otype>
Sourcepub fn get_max_duty(&self) -> u16
pub fn get_max_duty(&self) -> u16
Get the maximum duty cycle value of the PWM channel
If 0
returned means max_duty is 2^16
Sourcepub fn set_polarity(&mut self, p: Polarity)
pub fn set_polarity(&mut self, p: Polarity)
Set PWM channel polarity
Sourcepub fn set_complementary_polarity(&mut self, p: Polarity)
pub fn set_complementary_polarity(&mut self, p: Polarity)
Set complementary PWM channel polarity
Source§impl<TIM: Instance + WithPwm + Advanced + CPin<C>, const C: u8, Otype> PwmChannel<TIM, C, true, Otype>
impl<TIM: Instance + WithPwm + Advanced + CPin<C>, const C: u8, Otype> PwmChannel<TIM, C, true, Otype>
Sourcepub fn disable_complementary(&mut self)
pub fn disable_complementary(&mut self)
Disable complementary PWM channel
Sourcepub fn enable_complementary(&mut self)
pub fn enable_complementary(&mut self)
Enable complementary PWM channel
Sourcepub fn set_idle_state(&mut self, s: IdleState)
pub fn set_idle_state(&mut self, s: IdleState)
Set PWM channel idle state
Sourcepub fn set_complementary_idle_state(&mut self, s: IdleState)
pub fn set_complementary_idle_state(&mut self, s: IdleState)
Set complementary PWM channel idle state
Trait Implementations§
Source§impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> ErrorType for PwmChannel<TIM, C, COMP, Otype>
impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> ErrorType for PwmChannel<TIM, C, COMP, Otype>
Source§type Error = Infallible
type Error = Infallible
Error type
Source§impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> PwmPin for PwmChannel<TIM, C, COMP, Otype>
impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> PwmPin for PwmChannel<TIM, C, COMP, Otype>
Source§fn get_max_duty(&self) -> Self::Duty
fn get_max_duty(&self) -> Self::Duty
Returns the maximum duty cycle value
Source§impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> SetDutyCycle for PwmChannel<TIM, C, COMP, Otype>
impl<TIM: Instance + WithPwm + CPin<C>, const C: u8, const COMP: bool, Otype> SetDutyCycle for PwmChannel<TIM, C, COMP, Otype>
Source§fn max_duty_cycle(&self) -> u16
fn max_duty_cycle(&self) -> u16
Get the maximum duty cycle value. Read more
Source§fn set_duty_cycle(&mut self, duty: u16) -> Result<(), Self::Error>
fn set_duty_cycle(&mut self, duty: u16) -> Result<(), Self::Error>
Set the duty cycle to
duty / max_duty
. Read moreSource§fn set_duty_cycle_fully_off(&mut self) -> Result<(), Self::Error>
fn set_duty_cycle_fully_off(&mut self) -> Result<(), Self::Error>
Set the duty cycle to 0%, or always inactive.
Source§fn set_duty_cycle_fully_on(&mut self) -> Result<(), Self::Error>
fn set_duty_cycle_fully_on(&mut self) -> Result<(), Self::Error>
Set the duty cycle to 100%, or always active.
Auto Trait Implementations§
impl<TIM, const C: u8, const COMP: bool, Otype> Freeze for PwmChannel<TIM, C, COMP, Otype>
impl<TIM, const C: u8, const COMP: bool, Otype> RefUnwindSafe for PwmChannel<TIM, C, COMP, Otype>
impl<TIM, const C: u8, const COMP: bool, Otype> Send for PwmChannel<TIM, C, COMP, Otype>
impl<TIM, const C: u8, const COMP: bool, Otype> Sync for PwmChannel<TIM, C, COMP, Otype>
impl<TIM, const C: u8, const COMP: bool, Otype> Unpin for PwmChannel<TIM, C, COMP, Otype>
impl<TIM, const C: u8, const COMP: bool, Otype> UnwindSafe for PwmChannel<TIM, C, COMP, Otype>
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