pub struct Pwm<TIM, REMAP, P, PINS, const FREQ: u32>{ /* private fields */ }
Implementations§
Source§impl<TIM, REMAP, P, PINS, const FREQ: u32> Pwm<TIM, REMAP, P, PINS, FREQ>
impl<TIM, REMAP, P, PINS, const FREQ: u32> Pwm<TIM, REMAP, P, PINS, FREQ>
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) -> TimerDurationU32<FREQ>
pub fn set_period(&mut self, period: TimerDurationU32<FREQ>)
Methods from Deref<Target = FTimer<TIM, FREQ>>§
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, const FREQ: u32> Pwm for Pwm<TIM, REMAP, P, PINS, FREQ>
impl<TIM, REMAP, P, PINS, const FREQ: u32> Pwm for Pwm<TIM, REMAP, P, PINS, FREQ>
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§type Channel = Channel
type Channel = Channel
Enumeration of channels that can be used with this
Pwm
interface Read moreSource§type Time = Duration<u32, 1, FREQ>
type Time = Duration<u32, 1, FREQ>
A time unit that can be converted into a human time unit (e.g. seconds)
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)
fn set_period<T>(&mut self, period: T)
Sets a new PWM period
Auto Trait Implementations§
impl<TIM, REMAP, P, PINS, const FREQ: u32> Freeze for Pwm<TIM, REMAP, P, PINS, FREQ>where
TIM: Freeze,
impl<TIM, REMAP, P, PINS, const FREQ: u32> RefUnwindSafe for Pwm<TIM, REMAP, P, PINS, FREQ>
impl<TIM, REMAP, P, PINS, const FREQ: u32> Send for Pwm<TIM, REMAP, P, PINS, FREQ>
impl<TIM, REMAP, P, PINS, const FREQ: u32> Sync for Pwm<TIM, REMAP, P, PINS, FREQ>
impl<TIM, REMAP, P, PINS, const FREQ: u32> Unpin for Pwm<TIM, REMAP, P, PINS, FREQ>
impl<TIM, REMAP, P, PINS, const FREQ: u32> UnwindSafe for Pwm<TIM, REMAP, P, PINS, FREQ>
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