Struct rp2040_hal::pwm::Channel
source · [−]Expand description
A Channel from the Pwm subsystem.
Its attached to one of the eight slices and can be an A or B side channel
Implementations
sourceimpl<S: SliceId, M: SliceMode + ValidSliceMode<S>> Channel<S, M, A>
impl<S: SliceId, M: SliceMode + ValidSliceMode<S>> Channel<S, M, A>
sourcepub fn output_to<G: PinId + BankPinId + ValidPwmOutputPin<S, A>, PM: PinMode + ValidPinMode<G>>(
&mut self,
pin: Pin<G, PM>
) -> PwmPinToken<G>
pub fn output_to<G: PinId + BankPinId + ValidPwmOutputPin<S, A>, PM: PinMode + ValidPinMode<G>>(
&mut self,
pin: Pin<G, PM>
) -> PwmPinToken<G>
Capture a gpio pin and use it as pwm output for channel A
sourcepub fn set_inverted(&mut self)
pub fn set_inverted(&mut self)
Invert channel output
sourcepub fn clr_inverted(&mut self)
pub fn clr_inverted(&mut self)
Stop inverting channel output
sourceimpl<S: SliceId, M: SliceMode + ValidSliceMode<S>> Channel<S, M, B>
impl<S: SliceId, M: SliceMode + ValidSliceMode<S>> Channel<S, M, B>
sourcepub fn output_to<G: PinId + BankPinId + ValidPwmOutputPin<S, B>, PM: PinMode + ValidPinMode<G>>(
&mut self,
pin: Pin<G, PM>
) -> PwmPinToken<G>
pub fn output_to<G: PinId + BankPinId + ValidPwmOutputPin<S, B>, PM: PinMode + ValidPinMode<G>>(
&mut self,
pin: Pin<G, PM>
) -> PwmPinToken<G>
Capture a gpio pin and use it as pwm output for channel B
sourcepub fn set_inverted(&mut self)
pub fn set_inverted(&mut self)
Invert channel output
sourcepub fn clr_inverted(&mut self)
pub fn clr_inverted(&mut self)
Stop inverting channel output
sourceimpl<S: SliceId, M: SliceMode + ValidSliceInputMode<S>> Channel<S, M, B>
impl<S: SliceId, M: SliceMode + ValidSliceInputMode<S>> Channel<S, M, B>
sourcepub fn input_from<G: PinId + BankPinId + ValidPwmInputPin<S>, PM: PinMode + ValidPinMode<G>>(
&mut self,
pin: Pin<G, PM>
) -> PwmPinToken<G>
pub fn input_from<G: PinId + BankPinId + ValidPwmInputPin<S>, PM: PinMode + ValidPinMode<G>>(
&mut self,
pin: Pin<G, PM>
) -> PwmPinToken<G>
Capture a gpio pin and use it as pwm input for channel B
Trait Implementations
sourceimpl<S: SliceId, M: SliceMode> PwmPin for Channel<S, M, A>
impl<S: SliceId, M: SliceMode> PwmPin for Channel<S, M, A>
sourcefn disable(&mut self)
fn disable(&mut self)
We cant disable the channel without disturbing the other channel. So this just sets the duty cycle to zero
sourcefn get_max_duty(&self) -> Self::Duty
fn get_max_duty(&self) -> Self::Duty
Returns the maximum duty cycle value
Auto Trait Implementations
impl<S, M, C> RefUnwindSafe for Channel<S, M, C> where
C: RefUnwindSafe,
M: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, M, C> Send for Channel<S, M, C> where
C: Send,
M: Send,
S: Send,
impl<S, M, C> Sync for Channel<S, M, C> where
C: Sync,
M: Sync,
S: Sync,
impl<S, M, C> Unpin for Channel<S, M, C> where
C: Unpin,
M: Unpin,
S: Unpin,
impl<S, M, C> UnwindSafe for Channel<S, M, C> where
C: UnwindSafe,
M: UnwindSafe,
S: 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