Trait esp32c3_hal::pulse_control::OutputChannel
source · [−]pub trait OutputChannel {
fn set_idle_output_level(&mut self, level: bool) -> &mut Self;
fn set_idle_output(&mut self, state: bool) -> &mut Self;
fn set_channel_divider(&mut self, divider: u8) -> &mut Self;
fn set_carrier_modulation(&mut self, state: bool) -> &mut Self;
fn assign_pin<RmtPin>(&mut self, pin: RmtPin) -> &mut Self
where
RmtPin: OutputPin;
fn send_pulse_sequence<const N: usize>(
&mut self,
repeat_mode: RepeatMode,
sequence: &[PulseCode; N]
) -> Result<(), TransmissionError>;
fn send_pulse_sequence_raw<const N: usize>(
&mut self,
repeat_mode: RepeatMode,
sequence: &[u32; N]
) -> Result<(), TransmissionError>;
fn stop_transmission(&self);
}
Expand description
Functionality that every OutputChannel must support
Required Methods
sourcefn set_idle_output_level(&mut self, level: bool) -> &mut Self
fn set_idle_output_level(&mut self, level: bool) -> &mut Self
Set the logical level that the connected pin is pulled to while the channel is idle
sourcefn set_idle_output(&mut self, state: bool) -> &mut Self
fn set_idle_output(&mut self, state: bool) -> &mut Self
Enable/Disable the output while the channel is idle
sourcefn set_channel_divider(&mut self, divider: u8) -> &mut Self
fn set_channel_divider(&mut self, divider: u8) -> &mut Self
Set channel clock divider value
sourcefn set_carrier_modulation(&mut self, state: bool) -> &mut Self
fn set_carrier_modulation(&mut self, state: bool) -> &mut Self
Enable/Disable carrier modulation
sourcefn assign_pin<RmtPin>(&mut self, pin: RmtPin) -> &mut Selfwhere
RmtPin: OutputPin,
fn assign_pin<RmtPin>(&mut self, pin: RmtPin) -> &mut Selfwhere
RmtPin: OutputPin,
Assign a pin that should be driven by this channel
(Note that we only take a reference here, so the ownership remains with the calling entity. The configured pin thus can be re-configured independently.)
sourcefn send_pulse_sequence<const N: usize>(
&mut self,
repeat_mode: RepeatMode,
sequence: &[PulseCode; N]
) -> Result<(), TransmissionError>
fn send_pulse_sequence<const N: usize>(
&mut self,
repeat_mode: RepeatMode,
sequence: &[PulseCode; N]
) -> Result<(), TransmissionError>
Send a pulse sequence in a blocking fashion
sourcefn send_pulse_sequence_raw<const N: usize>(
&mut self,
repeat_mode: RepeatMode,
sequence: &[u32; N]
) -> Result<(), TransmissionError>
fn send_pulse_sequence_raw<const N: usize>(
&mut self,
repeat_mode: RepeatMode,
sequence: &[u32; N]
) -> Result<(), TransmissionError>
Send a raw pulse sequence in a blocking fashion
In this function we expect the sequence
elements to be already
in the correct u32 format that is understood by the RMT.
Please refer to the reference manual or use the variant which
accepts PulseCode
objects instead.
sourcefn stop_transmission(&self)
fn stop_transmission(&self)
Stop any ongoing (repetitive) transmission
This function needs to be called to stop sending when
previously a sequence was sent with RepeatMode::Forever
.