pub struct UartTx<'d, M: PeriMode> { /* private fields */ }Expand description
Tx-only UART Driver.
Can be obtained from Uart::split, or can be constructed independently,
if you do not need the receiving half of the driver.
Implementations§
Source§impl<'d> UartTx<'d, Async>
impl<'d> UartTx<'d, Async>
Sourcepub fn new<T: Instance, D: TxDma<T>, A>(
peri: Peri<'d, T>,
tx: Peri<'d, impl TxPin<T, A>>,
tx_dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Result<Self, ConfigError>
pub fn new<T: Instance, D: TxDma<T>, A>( peri: Peri<'d, T>, tx: Peri<'d, impl TxPin<T, A>>, tx_dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + '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<T: Instance, D: TxDma<T>, A>(
peri: Peri<'d, T>,
tx: Peri<'d, impl TxPin<T, A>>,
cts: Peri<'d, impl CtsPin<T, A>>,
tx_dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Result<Self, ConfigError>
pub fn new_with_cts<T: Instance, D: TxDma<T>, A>( peri: Peri<'d, T>, tx: Peri<'d, impl TxPin<T, A>>, cts: Peri<'d, impl CtsPin<T, A>>, tx_dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Result<Self, ConfigError>
Create a new tx-only UART with a clear-to-send pin
Sourcepub fn new_master<T: Instance, D: TxDma<T>, A>(
peri: Peri<'d, T>,
ck: Peri<'d, impl CkPin<T, A>>,
tx: Peri<'d, impl TxPin<T, A>>,
tx_dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Result<Self, ConfigError>
pub fn new_master<T: Instance, D: TxDma<T>, A>( peri: Peri<'d, T>, ck: Peri<'d, impl CkPin<T, A>>, tx: Peri<'d, impl TxPin<T, A>>, tx_dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Result<Self, ConfigError>
Create a new tx-only USART in synchronous master mode.
Sourcepub fn new_master_with_cts<T: Instance, D: TxDma<T>, A>(
peri: Peri<'d, T>,
ck: Peri<'d, impl CkPin<T, A>>,
tx: Peri<'d, impl TxPin<T, A>>,
cts: Peri<'d, impl CtsPin<T, A>>,
tx_dma: Peri<'d, D>,
_irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd,
config: Config,
) -> Result<Self, ConfigError>
pub fn new_master_with_cts<T: Instance, D: TxDma<T>, A>( peri: Peri<'d, T>, ck: Peri<'d, impl CkPin<T, A>>, tx: Peri<'d, impl TxPin<T, A>>, cts: Peri<'d, impl CtsPin<T, A>>, tx_dma: Peri<'d, D>, _irq: impl Binding<D::Interrupt, InterruptHandler<D>> + 'd, config: Config, ) -> Result<Self, ConfigError>
Create a new tx-only USART with a clear-to-send pin in synchronous master mode.
Source§impl<'d> UartTx<'d, Blocking>
impl<'d> UartTx<'d, Blocking>
Sourcepub fn new_blocking<T: Instance, A>(
peri: Peri<'d, T>,
tx: Peri<'d, impl TxPin<T, A>>,
config: Config,
) -> Result<Self, ConfigError>
pub fn new_blocking<T: Instance, A>( peri: Peri<'d, T>, tx: Peri<'d, impl TxPin<T, A>>, config: Config, ) -> Result<Self, ConfigError>
Create a new blocking tx-only UART with no hardware flow control.
Useful if you only want Uart Tx. It saves 1 pin and consumes a little less power.
Sourcepub fn new_blocking_with_cts<T: Instance, A>(
peri: Peri<'d, T>,
tx: Peri<'d, impl TxPin<T, A>>,
cts: Peri<'d, impl CtsPin<T, A>>,
config: Config,
) -> Result<Self, ConfigError>
pub fn new_blocking_with_cts<T: Instance, A>( peri: Peri<'d, T>, tx: Peri<'d, impl TxPin<T, A>>, cts: Peri<'d, impl CtsPin<T, A>>, config: Config, ) -> Result<Self, ConfigError>
Create a new blocking tx-only UART with a clear-to-send pin
Sourcepub fn new_blocking_master<T: Instance, A>(
peri: Peri<'d, T>,
ck: Peri<'d, impl CkPin<T, A>>,
tx: Peri<'d, impl TxPin<T, A>>,
config: Config,
) -> Result<Self, ConfigError>
pub fn new_blocking_master<T: Instance, A>( peri: Peri<'d, T>, ck: Peri<'d, impl CkPin<T, A>>, tx: Peri<'d, impl TxPin<T, A>>, config: Config, ) -> Result<Self, ConfigError>
Create a new blocking tx-only USART in synchronous master mode.
Sourcepub fn new_blocking_master_with_cts<T: Instance, A>(
peri: Peri<'d, T>,
ck: Peri<'d, impl CkPin<T, A>>,
tx: Peri<'d, impl TxPin<T, A>>,
cts: Peri<'d, impl CtsPin<T, A>>,
config: Config,
) -> Result<Self, ConfigError>
pub fn new_blocking_master_with_cts<T: Instance, A>( peri: Peri<'d, T>, ck: Peri<'d, impl CkPin<T, A>>, tx: Peri<'d, impl TxPin<T, A>>, cts: Peri<'d, impl CtsPin<T, A>>, config: Config, ) -> Result<Self, ConfigError>
Create a new blocking tx-only USART with a clear-to-send pin in synchronous master mode.
Source§impl<'d, M: PeriMode> UartTx<'d, M>
impl<'d, M: PeriMode> UartTx<'d, M>
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 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
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, M: PeriMode> SetConfig for UartTx<'d, M>
impl<'d, M: PeriMode> SetConfig for UartTx<'d, M>
Source§type ConfigError = ConfigError
type ConfigError = ConfigError
set_config fails.