pub struct PioUartTx<'d, PIO: Instance, const SM: usize> { /* private fields */ }Expand description
PIO backed Uart transmitter
Implementations§
Source§impl<'d, PIO: Instance, const SM: usize> PioUartTx<'d, PIO, SM>
impl<'d, PIO: Instance, const SM: usize> PioUartTx<'d, PIO, SM>
Sourcepub fn new(
baud: u32,
common: &mut Common<'d, PIO>,
sm_tx: StateMachine<'d, PIO, SM>,
tx_pin: Peri<'d, impl PioPin>,
program: &PioUartTxProgram<'d, PIO>,
) -> Self
pub fn new( baud: u32, common: &mut Common<'d, PIO>, sm_tx: StateMachine<'d, PIO, SM>, tx_pin: Peri<'d, impl PioPin>, program: &PioUartTxProgram<'d, PIO>, ) -> Self
Configure a pio state machine to use the loaded tx program.
Sourcepub async fn write(&mut self, buf: &[u8])
pub async fn write(&mut self, buf: &[u8])
Write all bytes in buf.
Returns once all bytes have been pushed into the state machine’s TX FIFO.
Sourcepub async fn flush(&mut self)
pub async fn flush(&mut self)
Wait until all written bytes have been fully transmitted on the wire.
Sourcepub fn set_baudrate(&mut self, baud: u32)
pub fn set_baudrate(&mut self, baud: u32)
Change baud rate on run time
Trait Implementations§
Source§impl<PIO: Instance, const SM: usize> Write for PioUartTx<'_, PIO, SM>
impl<PIO: Instance, const SM: usize> Write for PioUartTx<'_, PIO, SM>
Source§async fn write(&mut self, buf: &[u8]) -> Result<usize, Infallible>
async fn write(&mut self, buf: &[u8]) -> Result<usize, Infallible>
Write a buffer into this writer, returning how many bytes were written. Read more
Auto Trait Implementations§
impl<'d, PIO, const SM: usize> !UnwindSafe for PioUartTx<'d, PIO, SM>
impl<'d, PIO, const SM: usize> Freeze for PioUartTx<'d, PIO, SM>where
StateMachine<'d, PIO, SM>: Freeze,
impl<'d, PIO, const SM: usize> RefUnwindSafe for PioUartTx<'d, PIO, SM>where
StateMachine<'d, PIO, SM>: RefUnwindSafe,
impl<'d, PIO, const SM: usize> Send for PioUartTx<'d, PIO, SM>where
StateMachine<'d, PIO, SM>: Send,
impl<'d, PIO, const SM: usize> Sync for PioUartTx<'d, PIO, SM>where
StateMachine<'d, PIO, SM>: Sync,
impl<'d, PIO, const SM: usize> Unpin for PioUartTx<'d, PIO, SM>where
StateMachine<'d, PIO, SM>: Unpin,
impl<'d, PIO, const SM: usize> UnsafeUnpin for PioUartTx<'d, PIO, SM>where
StateMachine<'d, PIO, SM>: UnsafeUnpin,
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