Expand description
Asynchronous serial communication using 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;
pub use gpio::NoPin as NoTx;
pub use gpio::NoPin as NoRx;
pub use gpio::alt::SerialAsync as CommonPins;
Modules§
Structs§
Enums§
- CFlag
- UART clearable flags
- Error
- Serial error kind
- Event
- UART interrupt events
- Flag
- UART/USART status flags
Traits§
- Instance
- RxISR
- Trait for
Rx
interrupt handling. - RxListen
- Trait for listening
Rx
interrupt events. - Serial
Ext - TxISR
- Trait for
Tx
interrupt handling. - TxListen
- Trait for listening
Tx
interrupt event.