pub struct UartTx<'d, T: BasicInstance, TxDma = NoDma> { /* private fields */ }Expand description
Tx-only UART Driver
Implementations§
Source§impl<'d, T: BasicInstance, TxDma> UartTx<'d, T, TxDma>
 
impl<'d, T: BasicInstance, TxDma> UartTx<'d, T, TxDma>
Sourcepub fn new(
    peri: impl Peripheral<P = T> + 'd,
    tx: impl Peripheral<P = impl TxPin<T>> + 'd,
    tx_dma: impl Peripheral<P = TxDma> + 'd,
    config: Config,
) -> Result<Self, ConfigError>
 
pub fn new( peri: impl Peripheral<P = T> + 'd, tx: impl Peripheral<P = impl TxPin<T>> + 'd, tx_dma: impl Peripheral<P = TxDma> + 'd, config: Config, ) -> Result<Self, ConfigError>
Useful if you only want Uart Tx. It saves 1 pin and consumes a little less power.
Sourcepub fn new_with_cts(
    peri: impl Peripheral<P = T> + 'd,
    tx: impl Peripheral<P = impl TxPin<T>> + 'd,
    cts: impl Peripheral<P = impl CtsPin<T>> + 'd,
    tx_dma: impl Peripheral<P = TxDma> + 'd,
    config: Config,
) -> Result<Self, ConfigError>
 
pub fn new_with_cts( peri: impl Peripheral<P = T> + 'd, tx: impl Peripheral<P = impl TxPin<T>> + 'd, cts: impl Peripheral<P = impl CtsPin<T>> + 'd, tx_dma: impl Peripheral<P = TxDma> + 'd, config: Config, ) -> Result<Self, ConfigError>
Create a new tx-only UART with a clear-to-send pin
Sourcepub fn set_config(&mut self, config: &Config) -> Result<(), ConfigError>
 
pub fn set_config(&mut self, config: &Config) -> Result<(), ConfigError>
Reconfigure the driver
Sourcepub async fn write(&mut self, buffer: &[u8]) -> Result<(), Error>where
    TxDma: TxDma<T>,
 
pub async fn write(&mut self, buffer: &[u8]) -> Result<(), Error>where
    TxDma: TxDma<T>,
Initiate an asynchronous UART write
Sourcepub fn blocking_write(&mut self, buffer: &[u8]) -> Result<(), Error>
 
pub fn blocking_write(&mut self, buffer: &[u8]) -> Result<(), Error>
Perform a blocking UART write
Sourcepub fn blocking_flush(&mut self) -> Result<(), Error>
 
pub fn blocking_flush(&mut self) -> Result<(), Error>
Block until transmission complete
Trait Implementations§
Source§impl<'d, T: BasicInstance, TxDma> Drop for UartTx<'d, T, TxDma>
 
impl<'d, T: BasicInstance, TxDma> Drop for UartTx<'d, T, TxDma>
Source§impl<T, TxDma> ErrorType for UartTx<'_, T, TxDma>where
    T: BasicInstance,
 
impl<T, TxDma> ErrorType for UartTx<'_, T, TxDma>where
    T: BasicInstance,
Source§impl<'d, T: BasicInstance, TxDma> ErrorType for UartTx<'d, T, TxDma>
 
impl<'d, T: BasicInstance, TxDma> ErrorType for UartTx<'d, T, TxDma>
Source§impl<'d, T: BasicInstance, TxDma> SetConfig for UartTx<'d, T, TxDma>
 
impl<'d, T: BasicInstance, TxDma> SetConfig for UartTx<'d, T, TxDma>
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<T, TxDma> Write for UartTx<'_, T, TxDma>where
    T: BasicInstance,
    TxDma: TxDma<T>,
 
impl<T, TxDma> Write for UartTx<'_, T, TxDma>where
    T: BasicInstance,
    TxDma: TxDma<T>,
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<T, TxDma> Write for UartTx<'_, T, TxDma>where
    T: BasicInstance,
    TxDma: TxDma<T>,
 
impl<T, TxDma> Write for UartTx<'_, T, TxDma>where
    T: BasicInstance,
    TxDma: TxDma<T>,
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, T: BasicInstance, TxDma> Write for UartTx<'d, T, TxDma>
 
impl<'d, T: BasicInstance, TxDma> Write for UartTx<'d, T, TxDma>
Auto Trait Implementations§
impl<'d, T, TxDma> Freeze for UartTx<'d, T, TxDma>where
    TxDma: Freeze,
impl<'d, T, TxDma> RefUnwindSafe for UartTx<'d, T, TxDma>where
    TxDma: RefUnwindSafe,
    T: RefUnwindSafe,
impl<'d, T, TxDma> Send for UartTx<'d, T, TxDma>where
    TxDma: Send,
impl<'d, T, TxDma> Sync for UartTx<'d, T, TxDma>
impl<'d, T, TxDma> Unpin for UartTx<'d, T, TxDma>where
    TxDma: Unpin,
impl<'d, T, TxDma = NoDma> !UnwindSafe for UartTx<'d, T, TxDma>
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