embassy-nrf

Crates

git

Versions

nrf9120-ns

Flavors

Skip to main content

UarteRxWithIdle

Struct UarteRxWithIdle 

Source
pub struct UarteRxWithIdle<'d, M: Mode> { /* private fields */ }
Expand description

Receiver part of the UARTE driver, with read_until_idle support.

This can be obtained via Uarte::split_with_idle.

Implementations§

Source§

impl<'d> UarteRxWithIdle<'d, Async>

Source

pub async fn read(&mut self, buffer: &mut [u8]) -> Result<(), Error>

Read bytes until the buffer is filled.

Source

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.

Source

pub async fn flush_rx(&mut self, buffer: &mut [u8]) -> Result<usize, Error>

Flush the RX FIFO to RAM without activating the receiver.

Source

pub async fn read_until_idle( &mut self, buffer: &mut [u8], ) -> Result<usize, Error>

Read bytes until the buffer is filled, or the line becomes idle.

Returns the amount of bytes read.

Source§

impl<'d, M: Mode> UarteRxWithIdle<'d, M>

Source

pub fn blocking_read(&mut self, buffer: &mut [u8]) -> Result<(), Error>

Read bytes until the buffer is filled.

Source

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.

Source

pub fn blocking_flush_rx(&mut self, buffer: &mut [u8]) -> Result<usize, Error>

Flush the RX FIFO to RAM without activating the receiver.

Source

pub fn blocking_read_until_idle( &mut self, buffer: &mut [u8], ) -> Result<usize, Error>

Read bytes until the buffer is filled, or the line becomes idle.

Returns the amount of bytes read.

Auto Trait Implementations§

§

impl<'d, M> !RefUnwindSafe for UarteRxWithIdle<'d, M>

§

impl<'d, M> !Sync for UarteRxWithIdle<'d, M>

§

impl<'d, M> !UnwindSafe for UarteRxWithIdle<'d, M>

§

impl<'d, M> Freeze for UarteRxWithIdle<'d, M>
where UarteRx<'d, M>: Freeze,

§

impl<'d, M> Send for UarteRxWithIdle<'d, M>
where UarteRx<'d, M>: Send,

§

impl<'d, M> Unpin for UarteRxWithIdle<'d, M>
where UarteRx<'d, M>: Unpin,

§

impl<'d, M> UnsafeUnpin for UarteRxWithIdle<'d, M>
where UarteRx<'d, M>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.