#[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
Connect 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>
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
Connect 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>
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)>
Start transmitting the given pulse code sequence.
This returns a TxTransaction which 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)>
Start transmitting the given pulse code continuously.
This returns a ContinuousTxTransaction which 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)>
Start receiving pulse codes into the given buffer. This returns a RxTransaction which can be used to wait for receive to complete and get back the channel for further use.