pub struct Tx { /* private fields */ }Expand description
Serial transmitter
Can be created by using the Uart::split API.
Implementations§
Source§impl Tx
impl Tx
Sourcepub unsafe fn steal(id: Bank) -> Self
pub unsafe fn steal(id: Bank) -> Self
Retrieve a TX pin without expecting an explicit UART structure
§Safety
Circumvents the HAL safety guarantees.
pub fn perid(&self) -> u32
pub fn clear_fifo(&mut self)
pub fn enable(&mut self)
pub fn disable(&mut self)
Sourcepub fn enable_interrupts(&mut self)
pub fn enable_interrupts(&mut self)
Enables the IRQ_TX, IRQ_TX_STATUS and IRQ_TX_EMPTY interrupts.
- The IRQ_TX interrupt is generated when the TX FIFO is at least half empty.
- The IRQ_TX_STATUS interrupt is generated when write data is lost due to a FIFO overflow
- The IRQ_TX_EMPTY interrupt is generated when the TX FIFO is empty and the TXBUSY signal is 0
Sourcepub fn disable_interrupts(&mut self)
pub fn disable_interrupts(&mut self)
Disables the IRQ_TX, IRQ_TX_STATUS and IRQ_TX_EMPTY interrupts.
Self::enable_interrupts documents the interrupts.
Sourcepub fn write_fifo(&mut self, data: u32) -> Result<(), Infallible>
pub fn write_fifo(&mut self, data: u32) -> Result<(), Infallible>
Low level function to write a word to the UART FIFO.
Uses the nb API to allow usage in blocking and non-blocking contexts.
Please note that you might have to mask the returned value with 0xff to retrieve the actual value if you use the manual parity mode. See chapter 11.4.1 for more information.
Sourcepub fn write_fifo_unchecked(&mut self, data: u32)
pub fn write_fifo_unchecked(&mut self, data: u32)
Low level function to write a word to the UART FIFO.
This does not necesarily mean that the FIFO can process another word because it might be full. Use the Self::write_fifo function to write a word to the FIFO reliably using the nb API.