pub struct BufferedUartTx<'d> { /* private fields */ }Expand description
Buffered UART TX handle.
Implementations§
Source§impl<'d> BufferedUartTx<'d>
impl<'d> BufferedUartTx<'d>
Sourcepub fn new<T: Instance>(
_uart: Peri<'d, T>,
tx: Peri<'d, impl TxPin<T>>,
_irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>,
tx_buffer: &'d mut [u8],
config: Config,
) -> Self
pub fn new<T: Instance>( _uart: Peri<'d, T>, tx: Peri<'d, impl TxPin<T>>, _irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>, tx_buffer: &'d mut [u8], config: Config, ) -> Self
Create a new buffered UART TX.
Sourcepub fn new_with_cts<T: Instance>(
_uart: Peri<'d, T>,
tx: Peri<'d, impl TxPin<T>>,
cts: Peri<'d, impl CtsPin<T>>,
_irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>,
tx_buffer: &'d mut [u8],
config: Config,
) -> Self
pub fn new_with_cts<T: Instance>( _uart: Peri<'d, T>, tx: Peri<'d, impl TxPin<T>>, cts: Peri<'d, impl CtsPin<T>>, _irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>, tx_buffer: &'d mut [u8], config: Config, ) -> Self
Create a new buffered UART TX with flow control.
Sourcepub async fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
pub async fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Write to UART TX buffer.
Waits until there is space in the TX buffer, then writes as many bytes as
fit (up to buf.len()) and returns the number of bytes written.
Sourcepub async fn flush(&mut self) -> Result<(), Error>
pub async fn flush(&mut self) -> Result<(), Error>
Wait until all written bytes have been fully transmitted on the wire.
Sourcepub fn blocking_write(&mut self, buf: &[u8]) -> Result<usize, Error>
pub fn blocking_write(&mut self, buf: &[u8]) -> Result<usize, Error>
Write to UART TX buffer blocking execution until done.
Sourcepub fn blocking_flush(&mut self) -> Result<(), Error>
pub fn blocking_flush(&mut self) -> Result<(), Error>
Flush UART TX blocking execution until done.
Sourcepub async fn send_break(&mut self, bits: u32)
pub async fn send_break(&mut self, bits: u32)
Assert a break condition after waiting for the transmit buffers to empty,
for the specified number of bit times. This condition must be asserted
for at least two frame times to be effective, bits will adjusted
according to frame size, parity, and stop bit settings to ensure this.
This method may block for a long amount of time since it has to wait for the transmit fifo to empty, which may take a while on slow links.
Sourcepub fn set_baudrate(&mut self, baudrate: u32)
pub fn set_baudrate(&mut self, baudrate: u32)
sets baudrate on runtime
Sourcepub fn set_config(&mut self, config: Config)
pub fn set_config(&mut self, config: Config)
Set the configuration at runtime (ignores pin inversions)