Struct stm32f4xx_hal::timer::pwm::PwmChannel
source · pub struct PwmChannel<TIM, const C: u8, const COMP: bool = false> { /* private fields */ }
Implementations§
source§impl<TIM: Instance + WithPwm, const C: u8, const COMP: bool> PwmChannel<TIM, C, COMP>
impl<TIM: Instance + WithPwm, const C: u8, const COMP: bool> PwmChannel<TIM, C, COMP>
sourcepub fn set_polarity(&mut self, p: Polarity)
pub fn set_polarity(&mut self, p: Polarity)
Set PWM channel polarity
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_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, const C: u8> PwmChannel<TIM, C, true>
impl<TIM: Instance + WithPwm + Advanced, const C: u8> PwmChannel<TIM, C, true>
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, const C: u8> ErrorType for PwmChannel<TIM, C>
impl<TIM: Instance + WithPwm, const C: u8> ErrorType for PwmChannel<TIM, C>
§type Error = Infallible
type Error = Infallible
Error type
source§impl<TIM: Instance + WithPwm, const C: u8> PwmPin for PwmChannel<TIM, C>
impl<TIM: Instance + WithPwm, const C: u8> PwmPin for PwmChannel<TIM, C>
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, const C: u8> SetDutyCycle for PwmChannel<TIM, C>
impl<TIM: Instance + WithPwm, const C: u8> SetDutyCycle for PwmChannel<TIM, C>
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> RefUnwindSafe for PwmChannel<TIM, C, COMP>where
TIM: RefUnwindSafe,
impl<TIM, const C: u8, const COMP: bool> Send for PwmChannel<TIM, C, COMP>where
TIM: Send,
impl<TIM, const C: u8, const COMP: bool> Sync for PwmChannel<TIM, C, COMP>where
TIM: Sync,
impl<TIM, const C: u8, const COMP: bool> Unpin for PwmChannel<TIM, C, COMP>where
TIM: Unpin,
impl<TIM, const C: u8, const COMP: bool> UnwindSafe for PwmChannel<TIM, C, COMP>where
TIM: 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