embassy-rp

Crates

git

Versions

rp235xb

Flavors

Skip to main content

PioUartRx

Struct PioUartRx 

Source
pub struct PioUartRx<'d, PIO: Instance, const SM: usize> { /* private fields */ }
Expand description

PIO backed Uart receiver

Implementations§

Source§

impl<'d, PIO: Instance, const SM: usize> PioUartRx<'d, PIO, SM>

Source

pub fn new( baud: u32, common: &mut Common<'d, PIO>, sm_rx: StateMachine<'d, PIO, SM>, rx_pin: Peri<'d, impl PioPin>, program: &PioUartRxProgram<'d, PIO>, ) -> Self

Configure a pio state machine to use the loaded rx program.

Source

pub async fn read_u8(&mut self) -> u8

Wait for a single u8

Source

pub async fn read(&mut self, buf: &mut [u8])

Read bytes until buf is full.

Source

pub fn set_baudrate(&mut self, baud: u32)

Change Baud rate on runtime

Trait Implementations§

Source§

impl<PIO: Instance, const SM: usize> ErrorType for PioUartRx<'_, PIO, SM>

Source§

type Error = !

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

impl<PIO: Instance, const SM: usize> Read for PioUartRx<'_, PIO, SM>

Source§

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

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<'d, PIO, const SM: usize> !UnwindSafe for PioUartRx<'d, PIO, SM>

§

impl<'d, PIO, const SM: usize> Freeze for PioUartRx<'d, PIO, SM>
where StateMachine<'d, PIO, SM>: Freeze,

§

impl<'d, PIO, const SM: usize> RefUnwindSafe for PioUartRx<'d, PIO, SM>
where StateMachine<'d, PIO, SM>: RefUnwindSafe,

§

impl<'d, PIO, const SM: usize> Send for PioUartRx<'d, PIO, SM>
where StateMachine<'d, PIO, SM>: Send,

§

impl<'d, PIO, const SM: usize> Sync for PioUartRx<'d, PIO, SM>
where StateMachine<'d, PIO, SM>: Sync,

§

impl<'d, PIO, const SM: usize> Unpin for PioUartRx<'d, PIO, SM>
where StateMachine<'d, PIO, SM>: Unpin,

§

impl<'d, PIO, const SM: usize> UnsafeUnpin for PioUartRx<'d, PIO, SM>
where StateMachine<'d, PIO, SM>: 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.