embassy-mcxa

Crates

git

Versions

mcx-a256

Flavors

BufferedLpuartRx

Struct BufferedLpuartRx 

Source
pub struct BufferedLpuartRx<'a> { /* private fields */ }
Expand description

Buffered LPUART RX driver

Implementations§

Source§

impl<'a> BufferedLpuartRx<'a>

Source

pub fn new<T: Instance>( inner: Peri<'a, T>, rx_pin: Peri<'a, impl RxPin<T>>, _irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>> + 'a, rx_buffer: &'a mut [u8], config: Config, ) -> Result<Self>

Create a new RX-only buffered LPUART

Source

pub fn new_with_rts<T: Instance>( inner: Peri<'a, T>, rx_pin: Peri<'a, impl RxPin<T>>, rts_pin: Peri<'a, impl RtsPin<T>>, _irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>> + 'a, rx_buffer: &'a mut [u8], config: Config, ) -> Result<Self>

Create a new RX-only buffered LPUART with RTS flow control

Source§

impl<'a> BufferedLpuartRx<'a>

Source

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

Read data asynchronously

Source

pub fn try_read(&mut self, buf: &mut [u8]) -> Result<usize>

Try to read without blocking

Trait Implementations§

Source§

impl ErrorType for BufferedLpuartRx<'_>

Source§

type Error = Error

Error type of all the IO operations on this type.
Source§

impl Read for BufferedLpuartRx<'_>

Source§

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>>

Read the exact number of bytes required to fill buf. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for BufferedLpuartRx<'a>

§

impl<'a> !RefUnwindSafe for BufferedLpuartRx<'a>

§

impl<'a> !Send for BufferedLpuartRx<'a>

§

impl<'a> !Sync for BufferedLpuartRx<'a>

§

impl<'a> Unpin for BufferedLpuartRx<'a>

§

impl<'a> !UnwindSafe for BufferedLpuartRx<'a>

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 = Infallible

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.