Struct stm32f1xx_hal::timer::pwm::PwmHz
source · pub struct PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,{ /* private fields */ }
Implementations§
source§impl<TIM, REMAP, P, PINS> PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
impl<TIM, REMAP, P, PINS> PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
source§impl<TIM, REMAP, P, PINS> PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
impl<TIM, REMAP, P, PINS> PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
pub fn enable(&mut self, channel: Channel)
pub fn disable(&mut self, channel: Channel)
pub fn get_duty(&self, channel: Channel) -> u16
pub fn set_duty(&mut self, channel: Channel, duty: u16)
sourcepub fn get_max_duty(&self) -> u16
pub fn get_max_duty(&self) -> u16
If 0
returned means max_duty is 2^16
pub fn get_period(&self) -> Hertz
pub fn set_period(&mut self, period: Hertz)
Methods from Deref<Target = Timer<TIM>>§
pub fn configure(&mut self, clocks: &Clocks)
pub fn configure_external(&mut self, clocks: &Clocks)
pub fn configure(&mut self, clocks: &Clocks)
sourcepub fn listen(&mut self, event: Event)
pub fn listen(&mut self, event: Event)
Starts listening for an event
Note, you will also have to enable the TIM2 interrupt in the NVIC to start receiving events.
sourcepub fn clear_interrupt(&mut self, event: Event)
pub fn clear_interrupt(&mut self, event: Event)
Clears interrupt associated with event
.
If the interrupt is not cleared, it will immediately retrigger after the ISR has finished.
pub fn get_interrupt(&mut self) -> Event
sourcepub fn stop_in_debug(&mut self, dbg: &mut DBG, state: bool)
pub fn stop_in_debug(&mut self, dbg: &mut DBG, state: bool)
Stopping timer in debug mode can cause troubles when sampling the signal
pub fn set_master_mode(&mut self, mode: TIM::Mms)
Trait Implementations§
source§impl<TIM, REMAP, P, PINS> Deref for PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
impl<TIM, REMAP, P, PINS> Deref for PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
source§impl<TIM, REMAP, P, PINS> DerefMut for PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
impl<TIM, REMAP, P, PINS> DerefMut for PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
source§impl<TIM, REMAP, P, PINS> Pwm for PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
impl<TIM, REMAP, P, PINS> Pwm for PwmHz<TIM, REMAP, P, PINS>where
TIM: Instance + WithPwm,
REMAP: Remap<Periph = TIM>,
PINS: Pins<REMAP, P>,
source§fn get_max_duty(&self) -> Self::Duty
fn get_max_duty(&self) -> Self::Duty
If 0
returned means max_duty is 2^16
source§fn get_period(&self) -> Self::Time
fn get_period(&self) -> Self::Time
Returns the current PWM period
source§fn set_period<T>(&mut self, period: T)where
T: Into<Self::Time>,
fn set_period<T>(&mut self, period: T)where
T: Into<Self::Time>,
Sets a new PWM period