pub struct PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, P>, { /* private fields */ }
Implementations
sourceimpl<TIM, P, PINS> PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, P>,
impl<TIM, P, PINS> PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, 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 set_master_mode(&mut self, mode: TIM::Mms)
Trait Implementations
sourceimpl<TIM, P, PINS> Deref for PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, P>,
impl<TIM, P, PINS> Deref for PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, P>,
sourceimpl<TIM, P, PINS> DerefMut for PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, P>,
impl<TIM, P, PINS> DerefMut for PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, P>,
sourceimpl<TIM, P, PINS> Pwm for PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, P>,
impl<TIM, P, PINS> Pwm for PwmHz<TIM, P, PINS> where
TIM: Instance + WithPwm,
PINS: Pins<TIM, P>,
sourcefn get_max_duty(&self) -> Self::Duty
fn get_max_duty(&self) -> Self::Duty
If 0
returned means max_duty is 2^16
sourcefn get_period(&self) -> Self::Time
fn get_period(&self) -> Self::Time
Returns the current PWM period
sourcefn 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
Auto Trait Implementations
impl<TIM, P, PINS> RefUnwindSafe for PwmHz<TIM, P, PINS> where
P: RefUnwindSafe,
PINS: RefUnwindSafe,
TIM: RefUnwindSafe,
impl<TIM, P, PINS> Send for PwmHz<TIM, P, PINS> where
P: Send,
PINS: Send,
TIM: Send,
impl<TIM, P, PINS> Sync for PwmHz<TIM, P, PINS> where
P: Sync,
PINS: Sync,
TIM: Sync,
impl<TIM, P, PINS> Unpin for PwmHz<TIM, P, PINS> where
P: Unpin,
PINS: Unpin,
TIM: Unpin,
impl<TIM, P, PINS> UnwindSafe for PwmHz<TIM, P, PINS> where
P: UnwindSafe,
PINS: UnwindSafe,
TIM: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more