_embedded_hal_serial_nb_Read

Trait _embedded_hal_serial_nb_Read 

Source
pub trait _embedded_hal_serial_nb_Read<Word = u8>: ErrorType
where Word: Copy,
{ // Required method fn read(&mut self) -> Result<Word, Error<Self::Error>>; }
Expand description

Read half of a serial interface.

Some serial interfaces support different data sizes (8 bits, 9 bits, etc.); This can be encoded in this trait via the Word type parameter.

Required Methods§

Source

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

Reads a single word from the serial interface

Implementations on Foreign Types§

Source§

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

Source§

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

Implementors§

Source§

impl<USART: Instance> Read for Rx<USART, u8>

Source§

impl<USART: Instance> Read<u16> for Rx<USART, u16>

Reads 9-bit words from the UART/USART

If the UART/USART was configured with WordLength::DataBits9, the returned value will contain 9 received data bits and all other bits set to zero. Otherwise, the returned value will contain 8 received data bits and all other bits set to zero.

Source§

impl<USART: Instance, WORD: Copy> Read<WORD> for Serial<USART, WORD>
where Rx<USART, WORD>: Read<WORD, Error = Error>,