Struct stm32f4xx_hal::serial::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>

§

type Error = Error

Error type
source§

impl<UART> PeriAddress for Tx<UART, u8>
where <UART as Instance>::RegisterBlock: RegisterBlockImpl, UART: Deref<Target = <UART as Instance>::RegisterBlock> + Instance,

source§

fn address(&self) -> u32

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

type MemSize = u8

Memory size of the peripheral.
source§

impl<UART, WORD> TxISR for Tx<UART, WORD>
where <UART as Instance>::RegisterBlock: RegisterBlockImpl, UART: Deref<Target = <UART as Instance>::RegisterBlock> + Instance,

source§

fn is_tx_empty(&self) -> bool

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

impl<UART, WORD> TxListen for Tx<UART, WORD>
where <UART as Instance>::RegisterBlock: RegisterBlockImpl, UART: Deref<Target = <UART as Instance>::RegisterBlock> + Instance,

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> Write<u16> for Tx<USART, u16>
where <USART as Instance>::RegisterBlock: RegisterBlockImpl, USART: Deref<Target = <USART as Instance>::RegisterBlock> + Instance,

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> Write for Tx<UART>
where <UART as Instance>::RegisterBlock: RegisterBlockImpl, UART: Deref<Target = <UART as Instance>::RegisterBlock> + Instance,

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> Write for Tx<USART, u8>
where <USART as Instance>::RegisterBlock: RegisterBlockImpl, USART: Deref<Target = <USART as Instance>::RegisterBlock> + Instance,

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> Write<u16> for Tx<USART, u16>
where <USART as Instance>::RegisterBlock: RegisterBlockImpl, USART: Deref<Target = <USART as Instance>::RegisterBlock> + Instance,

§

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> Write<u8> for Tx<USART, u8>
where <USART as Instance>::RegisterBlock: RegisterBlockImpl, USART: Deref<Target = <USART as Instance>::RegisterBlock> + Instance,

§

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> Write<u16> for Tx<USART, u16>
where <USART as Instance>::RegisterBlock: RegisterBlockImpl, USART: Deref<Target = <USART as Instance>::RegisterBlock> + Instance,

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.

§

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> Write<u8> for Tx<USART, u8>
where <USART as Instance>::RegisterBlock: RegisterBlockImpl, USART: Deref<Target = <USART as Instance>::RegisterBlock> + Instance,

§

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> RefUnwindSafe for Tx<USART, WORD>
where USART: RefUnwindSafe, WORD: RefUnwindSafe, <USART as SerialAsync>::Tx<PushPull>: RefUnwindSafe,

§

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

§

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

§

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

§

impl<USART, WORD> UnwindSafe for Tx<USART, WORD>
where USART: UnwindSafe, WORD: UnwindSafe, <USART as SerialAsync>::Tx<PushPull>: 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>,

§

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>,

§

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.