pub struct Output<P> { /* private fields */ }
Expand description
A PWM output pin.
Provides a simple interface for configuring a PWM pin, and for defining
the turn on and turn off count values. Use new_a
or new_b
to create
your PWM outputs (depending on the PWM pin’s function).
The behaviors of the output pin depend on the submodule’s configurations.
Make sure you configure your PWM output pair operations with
Submodule::set_pair_operation
.
to ensure this output functions as expected.
Implementations§
source§impl<P, const N: u8, const M: u8> Output<P>
impl<P, const N: u8, const M: u8> Output<P>
sourcepub fn release(self, pwm: &mut Pwm<N>) -> P
pub fn release(self, pwm: &mut Pwm<N>) -> P
Release the PWM pin.
This call disables the PWM output on the pin.
sourcepub fn output_enable(&self, pwm: &Pwm<N>) -> bool
pub fn output_enable(&self, pwm: &Pwm<N>) -> bool
Indicates if this ouput is enabled.
sourcepub fn set_output_enable(&self, pwm: &mut Pwm<N>, enable: bool)
pub fn set_output_enable(&self, pwm: &mut Pwm<N>, enable: bool)
Enable or disable this output.
sourcepub fn turn_on(&self, sm: &Submodule<N, M>) -> i16
pub fn turn_on(&self, sm: &Submodule<N, M>) -> i16
Returns the turn on counter value.
When the PWM counter reaches this value, the output sets.
sourcepub fn turn_off(&self, sm: &Submodule<N, M>) -> i16
pub fn turn_off(&self, sm: &Submodule<N, M>) -> i16
Returns the turn off counter value.
When the PWM counter reaches this value, the output clears.
sourcepub fn set_turn_on(&self, sm: &Submodule<N, M>, compare: i16)
pub fn set_turn_on(&self, sm: &Submodule<N, M>, compare: i16)
Set the turn on counter value.
sourcepub fn set_turn_off(&self, sm: &Submodule<N, M>, compare: i16)
pub fn set_turn_off(&self, sm: &Submodule<N, M>, compare: i16)
Set the turn off counter value.