#[non_exhaustive]pub struct Channel<'ch, Dm, Dir>where
Dm: DriverMode,
Dir: Direction,{ /* private fields */ }Expand description
RMT Channel.
Implementations§
Source§impl<Dm, Dir> Channel<'_, Dm, Dir>where
Dm: DriverMode,
Dir: Direction,
impl<Dm, Dir> Channel<'_, Dm, Dir>where
Dm: DriverMode,
Dir: Direction,
Source§impl<'ch, Dm> Channel<'ch, Dm, Tx>where
Dm: DriverMode,
impl<'ch, Dm> Channel<'ch, Dm, Tx>where
Dm: DriverMode,
Sourcepub fn with_pin(self, pin: impl PeripheralOutput<'ch>) -> Self
pub fn with_pin(self, pin: impl PeripheralOutput<'ch>) -> Self
Connects a pin to the channel’s output signal.
This will replace previous pin assignments for this signal.
Sourcepub fn apply_config(
&mut self,
config: &TxChannelConfig,
) -> Result<(), ConfigError>
pub fn apply_config( &mut self, config: &TxChannelConfig, ) -> Result<(), ConfigError>
Changes the configuration.
§Errors
ConfigError::MemoryBlockNotAvailable or ConfigError::MemsizeOutOfRange.
Source§impl<'ch, Dm> Channel<'ch, Dm, Rx>where
Dm: DriverMode,
impl<'ch, Dm> Channel<'ch, Dm, Rx>where
Dm: DriverMode,
Sourcepub fn with_pin(self, pin: impl PeripheralInput<'ch>) -> Self
pub fn with_pin(self, pin: impl PeripheralInput<'ch>) -> Self
Connects a pin to the channel’s input signal.
This will replace previous pin assignments for this signal.
Sourcepub fn apply_config(
&mut self,
config: &RxChannelConfig,
) -> Result<(), ConfigError>
pub fn apply_config( &mut self, config: &RxChannelConfig, ) -> Result<(), ConfigError>
Changes the configuration.
§Errors
ConfigError::MemoryBlockNotAvailable, ConfigError::MemsizeOutOfRange, or
ConfigError::IdleThresholdOutOfRange.
Source§impl<'ch> Channel<'ch, Blocking, Tx>
Channel in TX mode.
impl<'ch> Channel<'ch, Blocking, Tx>
Channel in TX mode.
Sourcepub fn transmit<'data>(
self,
data: &'data [PulseCode],
) -> Result<TxTransaction<'ch, 'data>, (Error, Self)>
pub fn transmit<'data>( self, data: &'data [PulseCode], ) -> Result<TxTransaction<'ch, 'data>, (Error, Self)>
Starts transmitting the given pulse code sequence.
Returns a TxTransaction that can be used to wait for the transaction to
complete and get back the channel for further use.
Sourcepub fn transmit_continuously(
self,
data: &[PulseCode],
mode: LoopMode,
) -> Result<ContinuousTxTransaction<'ch>, (Error, Self)>
pub fn transmit_continuously( self, data: &[PulseCode], mode: LoopMode, ) -> Result<ContinuousTxTransaction<'ch>, (Error, Self)>
Starts transmitting the given pulse code continuously.
Returns a ContinuousTxTransaction that can be used to stop the ongoing
transmission and get back the channel for further use.
The mode argument determines whether transmission will continue until explicitly stopped
or for a fixed number of iterations; see LoopMode for more details.
When using a loop mode other than LoopMode::Infinite, ContinuousTxTransaction::is_loopcount_interrupt_set can be used to check if the loop count is reached.
The length of data cannot exceed the size of the allocated RMT RAM.
Source§impl<'ch> Channel<'ch, Blocking, Rx>
Channel is RX mode.
impl<'ch> Channel<'ch, Blocking, Rx>
Channel is RX mode.
Sourcepub fn receive<'data>(
self,
data: &'data mut [PulseCode],
) -> Result<RxTransaction<'ch, 'data>, (Error, Self)>
pub fn receive<'data>( self, data: &'data mut [PulseCode], ) -> Result<RxTransaction<'ch, 'data>, (Error, Self)>
Starts receiving pulse codes into the given buffer.
Returns a RxTransaction that can be used to wait for receive to complete
and get back the channel for further use.