[][src]Module esp32_hal::serial

UART peripheral control

Controls the 3 uart peripherals (UART0, UART1, UART2).

Example

Creation of the serial peripheral and writing formatted info.

let serial: Serial<_, _, _> = Serial::new(
    dp.UART0,
    esp32_hal::serial::Pins {
        tx: gpios.gpio1,
        rx: gpios.gpio3,
        cts: None,
        rts: None,
    },
    config,
    clkcntrl_config,
    &mut dport,
    )
    .unwrap();

writeln!(serial, "Serial output").unwrap();

TODO

  • Add all extra features esp32 supports (eg rs485, etc. etc.)
  • Free APB lock when TX is idle (and no RX used)
  • Address errata 3.17: UART fifo_cnt is inconsistent with FIFO pointer

Modules

config

UART configuration

Structs

Pins

Pins used by the UART interface

Rx

Serial receiver

Serial

Serial abstraction

Tx

Serial transmitter

Enums

Error

Serial error

Event

Interrupt event