pub struct RxChannel<'a, Dm: DriverMode> { /* private fields */ }Expand description
A receive channel.
Created by Rmt::rx_channel or Rmt::async_rx_channel.
Implementations§
Source§impl<'a, Dm: DriverMode> RxChannel<'a, Dm>
impl<'a, Dm: DriverMode> RxChannel<'a, Dm>
Sourcepub fn with_pin(self, pin: impl PeripheralInput<'a>) -> Self
pub fn with_pin(self, pin: impl PeripheralInput<'a>) -> 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: &RxConfig) -> Result<(), ConfigError>
pub fn apply_config(&mut self, config: &RxConfig) -> Result<(), ConfigError>
Changes the configuration.
§Errors
ConfigError::UnreachableTickRate, ConfigError::UnreachableCarrier or
ConfigError::RxLimitOutOfRange.
Sourcepub fn receive(&mut self, buf: &mut [PulseCode]) -> Result<usize, RxError>
pub fn receive(&mut self, buf: &mut [PulseCode]) -> Result<usize, RxError>
Receives one frame into buf and returns the number of codes.
Blocks until the input stays at one level for longer than the idle threshold.
§Errors
Sourcepub fn start_receive(&mut self) -> RxReception<'_>
Available on crate feature unstable only.
pub fn start_receive(&mut self) -> RxReception<'_>
unstable only.Starts receiving one frame.
Returns an RxReception that copies the codes out while the frame arrives, see
RxReception::poll.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Source§impl<'a> RxChannel<'a, Async>
impl<'a> RxChannel<'a, Async>
Sourcepub async fn receive_async(
&mut self,
buf: &mut [PulseCode],
) -> Result<usize, RxError>
pub async fn receive_async( &mut self, buf: &mut [PulseCode], ) -> Result<usize, RxError>
Receives one frame into buf and returns the number of codes.
Dropping the future stops the reception. See RxChannel::receive.
§Errors
Trait Implementations§
Source§impl<'a, Dm: Debug + DriverMode> Debug for RxChannel<'a, Dm>
Available on crate feature unstable only.
impl<'a, Dm: Debug + DriverMode> Debug for RxChannel<'a, Dm>
unstable only.Source§impl<Dm: DriverMode> Drop for RxChannel<'_, Dm>
Available on crate feature unstable only.
impl<Dm: DriverMode> Drop for RxChannel<'_, Dm>
unstable only.