pub struct UartTx<'d, M, T = AnyUart> { /* private fields */ }Expand description
UART (Transmit)
Implementations§
Source§impl<'d, M, T> UartTx<'d, M, T>
impl<'d, M, T> UartTx<'d, M, T>
Sourcepub fn with_rts(
self,
rts: impl Peripheral<P = impl PeripheralOutput> + 'd,
) -> Self
pub fn with_rts( self, rts: impl Peripheral<P = impl PeripheralOutput> + 'd, ) -> Self
Configure RTS pin
Source§impl<'d> UartTx<'d, Blocking>
impl<'d> UartTx<'d, Blocking>
Sourcepub fn new(
uart: impl Peripheral<P = impl Instance> + 'd,
tx: impl Peripheral<P = impl PeripheralOutput> + 'd,
) -> Result<Self, Error>
pub fn new( uart: impl Peripheral<P = impl Instance> + 'd, tx: impl Peripheral<P = impl PeripheralOutput> + 'd, ) -> Result<Self, Error>
Create a new UART TX instance in Blocking mode.
Sourcepub fn new_with_config(
uart: impl Peripheral<P = impl Instance> + 'd,
config: Config,
tx: impl Peripheral<P = impl PeripheralOutput> + 'd,
) -> Result<Self, Error>
pub fn new_with_config( uart: impl Peripheral<P = impl Instance> + 'd, config: Config, tx: impl Peripheral<P = impl PeripheralOutput> + 'd, ) -> Result<Self, Error>
Create a new UART TX instance with configuration options in
Blocking mode.
Source§impl<'d, T> UartTx<'d, Blocking, T>where
T: Instance,
impl<'d, T> UartTx<'d, Blocking, T>where
T: Instance,
Sourcepub fn new_typed(
uart: impl Peripheral<P = T> + 'd,
tx: impl Peripheral<P = impl PeripheralOutput> + 'd,
) -> Result<Self, Error>
pub fn new_typed( uart: impl Peripheral<P = T> + 'd, tx: impl Peripheral<P = impl PeripheralOutput> + 'd, ) -> Result<Self, Error>
Create a new UART TX instance in Blocking mode.
Sourcepub fn new_with_config_typed(
uart: impl Peripheral<P = T> + 'd,
config: Config,
tx: impl Peripheral<P = impl PeripheralOutput> + 'd,
) -> Result<Self, Error>
pub fn new_with_config_typed( uart: impl Peripheral<P = T> + 'd, config: Config, tx: impl Peripheral<P = impl PeripheralOutput> + 'd, ) -> Result<Self, Error>
Create a new UART TX instance with configuration options in
Blocking mode.
Sourcepub fn into_async(self) -> UartTx<'d, Async, T>
pub fn into_async(self) -> UartTx<'d, Async, T>
Reconfigures the driver to operate in Async mode.
Source§impl<'d, T> UartTx<'d, Async, T>where
T: Instance,
impl<'d, T> UartTx<'d, Async, T>where
T: Instance,
Sourcepub fn into_blocking(self) -> UartTx<'d, Blocking, T>
pub fn into_blocking(self) -> UartTx<'d, Blocking, T>
Reconfigures the driver to operate in Blocking mode.
Source§impl<T> UartTx<'_, Async, T>where
T: Instance,
impl<T> UartTx<'_, Async, T>where
T: Instance,
Sourcepub async fn write_async(&mut self, words: &[u8]) -> Result<usize, Error>
pub async fn write_async(&mut self, words: &[u8]) -> Result<usize, Error>
Asynchronously writes data to the UART transmit buffer in chunks.
This function sends the contents of the provided buffer words over
the UART. Data is written in chunks to avoid overflowing the
transmit FIFO, and the function waits asynchronously when
necessary for space in the buffer to become available.
Sourcepub async fn flush_async(&mut self) -> Result<(), Error>
pub async fn flush_async(&mut self) -> Result<(), Error>
Asynchronously flushes the UART transmit buffer.
This function ensures that all pending data in the transmit FIFO has been sent over the UART. If the FIFO contains data, it waits for the transmission to complete before returning.
Trait Implementations§
Source§impl<M, T> SetConfig for UartTx<'_, M, T>
impl<M, T> SetConfig for UartTx<'_, M, T>
Source§type ConfigError = Error
type ConfigError = Error
set_config fails.