pub struct BufferedUarteRx<'d, U: UarteInstance, T: TimerInstance> { /* private fields */ }
Expand description
Reader part of the buffered UARTE driver.
Implementations§
Source§impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'d, U, T>
impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'d, U, T>
Sourcepub fn new(
uarte: impl Peripheral<P = U> + 'd,
timer: impl Peripheral<P = T> + 'd,
ppi_ch1: impl Peripheral<P = impl ConfigurableChannel> + 'd,
ppi_ch2: impl Peripheral<P = impl ConfigurableChannel> + 'd,
ppi_group: impl Peripheral<P = impl Group> + 'd,
_irq: impl Binding<U::Interrupt, InterruptHandler<U>> + 'd,
rxd: impl Peripheral<P = impl GpioPin> + 'd,
config: Config,
rx_buffer: &'d mut [u8],
) -> Self
pub fn new( uarte: impl Peripheral<P = U> + 'd, timer: impl Peripheral<P = T> + 'd, ppi_ch1: impl Peripheral<P = impl ConfigurableChannel> + 'd, ppi_ch2: impl Peripheral<P = impl ConfigurableChannel> + 'd, ppi_group: impl Peripheral<P = impl Group> + 'd, _irq: impl Binding<U::Interrupt, InterruptHandler<U>> + 'd, rxd: impl Peripheral<P = impl GpioPin> + 'd, config: Config, rx_buffer: &'d mut [u8], ) -> Self
Sourcepub fn new_with_rts(
uarte: impl Peripheral<P = U> + 'd,
timer: impl Peripheral<P = T> + 'd,
ppi_ch1: impl Peripheral<P = impl ConfigurableChannel> + 'd,
ppi_ch2: impl Peripheral<P = impl ConfigurableChannel> + 'd,
ppi_group: impl Peripheral<P = impl Group> + 'd,
_irq: impl Binding<U::Interrupt, InterruptHandler<U>> + 'd,
rxd: impl Peripheral<P = impl GpioPin> + 'd,
rts: impl Peripheral<P = impl GpioPin> + 'd,
config: Config,
rx_buffer: &'d mut [u8],
) -> Self
pub fn new_with_rts( uarte: impl Peripheral<P = U> + 'd, timer: impl Peripheral<P = T> + 'd, ppi_ch1: impl Peripheral<P = impl ConfigurableChannel> + 'd, ppi_ch2: impl Peripheral<P = impl ConfigurableChannel> + 'd, ppi_group: impl Peripheral<P = impl Group> + 'd, _irq: impl Binding<U::Interrupt, InterruptHandler<U>> + 'd, rxd: impl Peripheral<P = impl GpioPin> + 'd, rts: impl Peripheral<P = impl GpioPin> + 'd, config: Config, rx_buffer: &'d mut [u8], ) -> Self
Create a new BufferedUarte with hardware flow control (RTS/CTS)
§Panics
Panics if rx_buffer.len()
is odd.
Sourcepub async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
Pull some bytes from this source into the specified buffer, returning how many bytes were read.
Trait Implementations§
Source§impl<'d: 'd, U: UarteInstance, T: TimerInstance> BufRead for BufferedUarteRx<'d, U, T>
impl<'d: 'd, U: UarteInstance, T: TimerInstance> BufRead for BufferedUarteRx<'d, U, T>
Source§impl<'a, U: UarteInstance, T: TimerInstance> Drop for BufferedUarteRx<'a, U, T>
impl<'a, U: UarteInstance, T: TimerInstance> Drop for BufferedUarteRx<'a, U, T>
Source§impl<'d, U: UarteInstance, T: TimerInstance> ErrorType for BufferedUarteRx<'d, U, T>
impl<'d, U: UarteInstance, T: TimerInstance> ErrorType for BufferedUarteRx<'d, U, T>
Source§impl<'d: 'd, U: UarteInstance, T: TimerInstance> Read for BufferedUarteRx<'d, U, T>
impl<'d: 'd, U: UarteInstance, T: TimerInstance> Read for BufferedUarteRx<'d, U, T>
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf
. Read moreSource§impl<'d, U: UarteInstance, T: TimerInstance + 'd> ReadReady for BufferedUarteRx<'d, U, T>
impl<'d, U: UarteInstance, T: TimerInstance + 'd> ReadReady for BufferedUarteRx<'d, U, T>
Auto Trait Implementations§
impl<'d, U, T> Freeze for BufferedUarteRx<'d, U, T>
impl<'d, U, T> RefUnwindSafe for BufferedUarteRx<'d, U, T>where
U: RefUnwindSafe,
T: RefUnwindSafe,
impl<'d, U, T> Send for BufferedUarteRx<'d, U, T>
impl<'d, U, T> !Sync for BufferedUarteRx<'d, U, T>
impl<'d, U, T> Unpin for BufferedUarteRx<'d, U, T>
impl<'d, U, T> !UnwindSafe for BufferedUarteRx<'d, U, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more