esp_hal

Module uart

Source
Expand description

§Universal Asynchronous Receiver/Transmitter (UART)

§Overview

The UART is a hardware peripheral which handles communication using serial communication interfaces, such as RS232 and RS485. This peripheral provides a cheap and ubiquitous method for full- and half-duplex communication between devices.

Depending on your device, two or more UART controllers are available for use, all of which can be configured and used in the same way. All UART controllers are compatible with UART-enabled devices from various manufacturers, and can also support Infrared Data Association (IrDA) protocols.

§Configuration

Each UART controller is individually configurable, and the usual setting such as baud rate, data bits, parity, and stop bits can easily be configured. Additionally, the receive (RX) and transmit (TX) pins need to be specified.

The UART controller can be configured to invert the polarity of the pins. This is achieved by inverting the desired pins, and then constructing the UART instance using the inverted pins.

§Usage

The UART driver implements a number of third-party traits, with the intention of making the HAL inter-compatible with various device drivers from the community. This includes, but is not limited to, the embedded-hal and embedded-io blocking traits, and the embedded-hal-async and embedded-io-async asynchronous traits.

In addition to the interfaces provided by these traits, native APIs are also available. See the examples below for more information on how to interact with this driver.

Structs§

  • Any UART peripheral.
  • AtCmdConfigunstable
    Configuration for the AT-CMD detection functionality
  • UART Configuration
  • UART Receive part configuration.
  • UART Transmit part configuration.
  • UART (Full-duplex)
  • UartRxunstable
    UART (Receive)
  • UartTxunstable
    UART (Transmit)

Enums§