pub struct PwmHz<TIM, REMAP, P, PINS>{ /* private fields */ }
Implementations§
Source§impl<TIM, REMAP, P, PINS> PwmHz<TIM, REMAP, P, PINS>
impl<TIM, REMAP, P, PINS> PwmHz<TIM, REMAP, P, PINS>
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)
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> Pwm for PwmHz<TIM, REMAP, P, PINS>
impl<TIM, REMAP, P, PINS> Pwm for PwmHz<TIM, REMAP, P, PINS>
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 = Rate<u32, 1, 1>
type Time = Rate<u32, 1, 1>
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> Freeze for PwmHz<TIM, REMAP, P, PINS>where
TIM: Freeze,
impl<TIM, REMAP, P, PINS> RefUnwindSafe for PwmHz<TIM, REMAP, P, PINS>
impl<TIM, REMAP, P, PINS> Send for PwmHz<TIM, REMAP, P, PINS>
impl<TIM, REMAP, P, PINS> Sync for PwmHz<TIM, REMAP, P, PINS>
impl<TIM, REMAP, P, PINS> Unpin for PwmHz<TIM, REMAP, P, PINS>
impl<TIM, REMAP, P, PINS> UnwindSafe for PwmHz<TIM, REMAP, P, PINS>
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