_embedded_hal_serial_nb_Write

Trait _embedded_hal_serial_nb_Write 

Source
pub trait _embedded_hal_serial_nb_Write<Word = u8>: ErrorType
where Word: Copy,
{ // Required methods fn write(&mut self, word: Word) -> Result<(), Error<Self::Error>>; fn flush(&mut self) -> Result<(), Error<Self::Error>>; }
Expand description

Write half of a serial interface.

Required Methods§

Source

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

Writes a single word to the serial interface.

Source

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

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

Trait Implementations§

Source§

impl<Word, Error> Write for dyn Write<Word, Error = Error> + '_
where Error: Error, Word: Copy + From<u8>,

Implementation of core::fmt::Write for the HAL’s serial::Write.

TODO write example of usage

Source§

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

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

Implementations on Foreign Types§

Source§

impl<T, Word> Write<Word> for &mut T
where T: Write<Word> + ?Sized, Word: Copy,

Source§

fn write( &mut self, word: Word, ) -> Result<(), Error<<&mut T as ErrorType>::Error>>

Source§

fn flush(&mut self) -> Result<(), Error<<&mut T as ErrorType>::Error>>

Implementors§

Source§

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

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§

impl<USART: Instance, WORD: Copy> Write<WORD> for Serial<USART, WORD>
where Tx<USART, WORD>: Write<WORD, Error = Error>,