pub struct BufferedUartTx<'d> { /* private fields */ }Expand description
Tx-only buffered UART
Created with BufferedUart::split
Implementations§
Source§impl<'d> BufferedUartTx<'d>
impl<'d> BufferedUartTx<'d>
Sourcepub async fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
pub async fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Write to the TX buffer, waiting until there is space for at least one byte.
Returns the number of bytes written, which is at least 1 if buf is not empty.
Sourcepub async fn flush(&mut self) -> Result<(), Error>
pub async fn flush(&mut self) -> Result<(), Error>
Wait until the TX buffer is empty and the last byte has been transmitted.
Sourcepub fn blocking_write(&mut self, buf: &[u8]) -> Result<usize, Error>
pub fn blocking_write(&mut self, buf: &[u8]) -> Result<usize, Error>
Write to the TX buffer, busy-waiting until there is space for at least one byte.
Returns the number of bytes written, which is at least 1 if buf is not empty.
Sourcepub fn blocking_flush(&mut self) -> Result<(), Error>
pub fn blocking_flush(&mut self) -> Result<(), Error>
Busy-wait until the TX buffer is empty and the last byte has been transmitted.
Sourcepub fn write_ready(&mut self) -> Result<bool, Error>
pub fn write_ready(&mut self) -> Result<bool, Error>
Return whether the TX buffer has space, so that a write would not wait.
Sourcepub fn set_config(&mut self, config: &Config) -> Result<(), ConfigError>
pub fn set_config(&mut self, config: &Config) -> Result<(), ConfigError>
Reconfigure the driver
Sourcepub fn send_break(&self)
pub fn send_break(&self)
Send break character
Sourcepub fn set_baudrate(&self, baudrate: u32) -> Result<(), ConfigError>
pub fn set_baudrate(&self, baudrate: u32) -> Result<(), ConfigError>
Set baudrate
Trait Implementations§
Source§impl<'d> Drop for BufferedUartTx<'d>
impl<'d> Drop for BufferedUartTx<'d>
Source§impl<'d> ErrorType for BufferedUartTx<'d>
impl<'d> ErrorType for BufferedUartTx<'d>
Source§impl<'d> SetConfig for BufferedUartTx<'d>
impl<'d> SetConfig for BufferedUartTx<'d>
Source§type ConfigError = ConfigError
type ConfigError = ConfigError
The error type that can occur if
set_config fails.Source§fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError>
fn set_config(&mut self, config: &Self::Config) -> Result<(), Self::ConfigError>
Set the configuration of the driver.
Source§impl<'d> Write for BufferedUartTx<'d>
impl<'d> Write for BufferedUartTx<'d>
Source§async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Source§impl<'d> Write for BufferedUartTx<'d>
impl<'d> Write for BufferedUartTx<'d>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Source§impl<'d> Write<u8> for BufferedUartTx<'d>
impl<'d> Write<u8> for BufferedUartTx<'d>
Source§impl<'d> WriteReady for BufferedUartTx<'d>
impl<'d> WriteReady for BufferedUartTx<'d>
Auto Trait Implementations§
impl<'d> !RefUnwindSafe for BufferedUartTx<'d>
impl<'d> !UnwindSafe for BufferedUartTx<'d>
impl<'d> Freeze for BufferedUartTx<'d>
impl<'d> Send for BufferedUartTx<'d>
impl<'d> Sync for BufferedUartTx<'d>
impl<'d> Unpin for BufferedUartTx<'d>
impl<'d> UnsafeUnpin for BufferedUartTx<'d>
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