pub struct UarteRx<'d> { /* private fields */ }Expand description
Receiver part of the UARTE driver.
This can be obtained via Uarte::split, or created directly.
Implementations§
Source§impl<'d> UarteRx<'d>
impl<'d> UarteRx<'d>
Sourcepub fn new<T: Instance>(
uarte: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
rxd: Peri<'d, impl GpioPin>,
config: Config,
) -> Self
pub fn new<T: Instance>( uarte: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, rxd: Peri<'d, impl GpioPin>, config: Config, ) -> Self
Create a new rx-only UARTE without hardware flow control
Sourcepub fn new_with_rtscts<T: Instance>(
uarte: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
rxd: Peri<'d, impl GpioPin>,
rts: Peri<'d, impl GpioPin>,
config: Config,
) -> Self
pub fn new_with_rtscts<T: Instance>( uarte: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, rxd: Peri<'d, impl GpioPin>, rts: Peri<'d, impl GpioPin>, config: Config, ) -> Self
Create a new rx-only UARTE with hardware flow control (RTS/CTS)
Sourcepub fn with_idle<U: TimerInstance>(
self,
timer: Peri<'d, U>,
ppi_ch1: Peri<'d, impl ConfigurableChannel + 'd>,
ppi_ch2: Peri<'d, impl ConfigurableChannel + 'd>,
) -> UarteRxWithIdle<'d>
pub fn with_idle<U: TimerInstance>( self, timer: Peri<'d, U>, ppi_ch1: Peri<'d, impl ConfigurableChannel + 'd>, ppi_ch2: Peri<'d, impl ConfigurableChannel + 'd>, ) -> UarteRxWithIdle<'d>
Upgrade to an instance that supports idle line detection.
Sourcepub async fn read(&mut self, buffer: &mut [u8]) -> Result<(), Error>
pub async fn read(&mut self, buffer: &mut [u8]) -> Result<(), Error>
Read bytes until the buffer is filled.
Sourcepub fn blocking_read(&mut self, buffer: &mut [u8]) -> Result<(), Error>
pub fn blocking_read(&mut self, buffer: &mut [u8]) -> Result<(), Error>
Read bytes until the buffer is filled.
Sourcepub async fn stop_rx(&mut self)
pub async fn stop_rx(&mut self)
Stop the receiver.
This function waits for the receiver to stop (as indicated by a RXTO event).
Note that the receiver may still receive up to 4 bytes while being stopped.
You can use Self::flush_rx() to remove the data from the internal RX FIFO
without re-activating the receiver.
Sourcepub fn blocking_stop_rx(&mut self)
pub fn blocking_stop_rx(&mut self)
Stop the receiver.
This function waits for the receiver to stop (as indicated by a RXTO event).
Note that the receiver may still receive up to 4 bytes while being stopped.
You can use Self::blocking_flush_rx() to remove the data from the internal RX FIFO
without re-activating the receiver.