Module stm32f4xx_hal::serial
source · [−]Expand description
Asynchronous serial communication using UART/USART peripherals
Word length
By default, the UART/USART uses 8 data bits. The Serial
, Rx
, and Tx
structs implement
the embedded-hal read and write traits with u8
as the word type.
You can also configure the hardware to use 9 data bits with the Config
wordlength_9()
function. After creating a Serial
with this option, use the with_u16_data()
function to
convert the Serial<_, _, u8>
object into a Serial<_, _, u16>
that can send and receive
u16
s.
In this mode, the Serial<_, _, u16>
, Rx<_, u16>
, and Tx<_, u16>
structs instead implement
the embedded-hal read and write traits with u16
as the word type. You can use these
implementations for 9-bit words.
Re-exports
pub use config::Config;