Module serial

Source
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 u16s.

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§

config
dma

Structs§

Rx
Serial receiver containing RX pin
Serial
Serial abstraction
Tx
Serial transmitter containing TX pin

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.
SerialExt
TxISR
Trait for Tx interrupt handling.
TxListen
Trait for listening Tx interrupt event.

Type Aliases§

Rx1
Rx2
Rx3
Rx6
Serial1
Serial2
Serial3
Serial6
Tx1
Tx2
Tx3
Tx6