Module stm32f4xx_hal::uart
source · Expand description
Asynchronous serial communication using UART peripherals
Word length
By default, the UART/UART 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 crate::serial::config;
pub use crate::serial::Error;
pub use crate::serial::Event;
pub use crate::serial::Instance;
pub use crate::serial::NoRx;
pub use crate::serial::NoTx;
pub use crate::serial::Rx;
pub use crate::serial::RxISR;
pub use crate::serial::Serial;
pub use crate::serial::Tx;
pub use crate::serial::TxISR;
pub use config::Config;