Struct Tx

Source
pub struct Tx<USART: CommonPins, WORD = u8> { /* private fields */ }
Expand description

Serial transmitter containing TX pin

Implementations§

Source§

impl<UART: CommonPins, WORD> Tx<UART, WORD>

Source

pub fn join(self, rx: Rx<UART, WORD>) -> Serial<UART, WORD>

Trait Implementations§

Source§

impl<UART: Instance, WORD> AsMut<Tx<UART, WORD>> for Serial<UART, WORD>

Source§

fn as_mut(&mut self) -> &mut Tx<UART, WORD>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<UART: Instance, WORD> AsRef<Tx<UART, WORD>> for Serial<UART, WORD>

Source§

fn as_ref(&self) -> &Tx<UART, WORD>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<USART: Instance, WORD> ErrorType for Tx<USART, WORD>

Source§

type Error = Error

Error type
Source§

impl<USART: Instance, WORD> ErrorType for Tx<USART, WORD>

Source§

type Error = Error

Error type of all the IO operations on this type.
Source§

impl<UART: Instance> PeriAddress for Tx<UART, u8>

Source§

type MemSize = u8

Memory size of the peripheral.
Source§

fn address(&self) -> u32

Returns the address to be used by the DMA stream.
Source§

impl<UART: Instance, WORD> TxISR for Tx<UART, WORD>

Source§

fn is_tx_empty(&self) -> bool

Return true if the tx register is empty (and can accept data)
Source§

impl<UART: Instance, WORD> TxListen for Tx<UART, WORD>

Source§

fn listen(&mut self)

Start listening for a tx empty interrupt event Read more
Source§

fn unlisten(&mut self)

Stop listening for the tx empty interrupt event
Source§

impl<USART: Instance> Write<u16> for Tx<USART, u16>

Writes 9-bit words to the UART/USART

If the UART/USART was configured with WordLength::DataBits9, the 9 least significant bits will be transmitted and the other 7 bits will be ignored. Otherwise, the 8 least significant bits will be transmitted and the other 8 bits will be ignored.

Source§

fn write(&mut self, word: u16) -> Result<(), Self::Error>

Writes a single word to the serial interface.
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Ensures that none of the previously written words are still buffered.
Source§

impl<UART: Instance> Write for Tx<UART>

Source§

fn write_str(&mut self, s: &str) -> Result

Writes a string slice into this writer, returning whether the write succeeded. Read more
1.1.0 · Source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · Source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more
Source§

impl<USART: Instance> Write for Tx<USART, u8>

Source§

fn write(&mut self, word: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface.
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Ensures that none of the previously written words are still buffered.
Source§

impl<USART: Instance> Write for Tx<USART, u8>

Source§

fn write(&mut self, bytes: &[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>

Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Write an entire buffer into this writer. Read more
Source§

fn write_fmt( &mut self, fmt: Arguments<'_>, ) -> Result<(), WriteFmtError<Self::Error>>

Write a formatted string into this writer, returning any error encountered. Read more
Source§

impl<USART> Write<u16> for Tx<USART, u16>
where USART: Deref<Target = <USART as Ptr>::RB> + Instance,

Source§

type Error = Error

The type of error that can occur when writing
Source§

fn bwrite_all(&mut self, slice: &[u16]) -> Result<(), Self::Error>

Writes a slice, blocking until everything has been written Read more
Source§

fn bflush(&mut self) -> Result<(), Self::Error>

Block until the serial interface has sent all buffered words
Source§

impl<USART: Instance> Write<u8> for Tx<USART, u8>

Source§

type Error = Error

The type of error that can occur when writing
Source§

fn bwrite_all(&mut self, bytes: &[u8]) -> Result<(), Self::Error>

Writes a slice, blocking until everything has been written Read more
Source§

fn bflush(&mut self) -> Result<(), Self::Error>

Block until the serial interface has sent all buffered words
Source§

impl<USART: Instance> Write<u16> for Tx<USART, u16>

Writes 9-bit words to the UART/USART

If the UART/USART was configured with WordLength::DataBits9, the 9 least significant bits will be transmitted and the other 7 bits will be ignored. Otherwise, the 8 least significant bits will be transmitted and the other 8 bits will be ignored.

Source§

type Error = Error

Write error
Source§

fn write(&mut self, word: u16) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Ensures that none of the previously written words are still buffered
Source§

impl<USART: Instance> Write<u8> for Tx<USART, u8>

Source§

type Error = Error

Write error
Source§

fn write(&mut self, word: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Ensures that none of the previously written words are still buffered
Source§

impl<UART, STREAM, const CHANNEL: u8> DMASet<STREAM, CHANNEL, MemoryToPeripheral> for Tx<UART>
where UART: DMASet<STREAM, CHANNEL, MemoryToPeripheral> + CommonPins,

Auto Trait Implementations§

§

impl<USART, WORD> Freeze for Tx<USART, WORD>
where USART: Freeze, <USART as SerialAsync>::Tx<PushPull>: Freeze,

§

impl<USART, WORD> RefUnwindSafe for Tx<USART, WORD>
where USART: RefUnwindSafe, <USART as SerialAsync>::Tx<PushPull>: RefUnwindSafe, WORD: RefUnwindSafe,

§

impl<USART, WORD> Send for Tx<USART, WORD>
where USART: Send, <USART as SerialAsync>::Tx<PushPull>: Send, WORD: Send,

§

impl<USART, WORD> Sync for Tx<USART, WORD>
where USART: Sync, <USART as SerialAsync>::Tx<PushPull>: Sync, WORD: Sync,

§

impl<USART, WORD> Unpin for Tx<USART, WORD>
where USART: Unpin, <USART as SerialAsync>::Tx<PushPull>: Unpin, WORD: Unpin,

§

impl<USART, WORD> UnwindSafe for Tx<USART, WORD>
where USART: UnwindSafe, <USART as SerialAsync>::Tx<PushPull>: UnwindSafe, WORD: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.