Chapter 2. API Reference
UART_SIGNAL_DSR_INV = (0x1 << 4)
inverse the UART dsr signal
UART_SIGNAL_TXD_INV = (0x1 << 5)
inverse the UART txd signal
UART_SIGNAL_RTS_INV = (0x1 << 6)
inverse the UART rts signal
UART_SIGNAL_DTR_INV = (0x1 << 7)
inverse the UART dtr signal
enum uart_sclk_t
UART source clock.
Values:
UART_SCLK_APB = 0x0
UART source clock from APB
UART_SCLK_REF_TICK = 0x3
UART source clock from REF_TICK
GPIO Lookup Macros The UART peripherals have dedicated IO_MUX pins to which they are connected directly.
However, signals can also be routed to other pins using the less direct GPIO matrix. To use direct routes, you need
to know which pin is a dedicated IO_MUX pin for a UART channel. GPIO Lookup Macros simplify the process of
finding and assigning IO_MUX pins. You choose a macro based on either the IO_MUX pin number, or a required
UART channel name, and the macro will return the matching counterpart for you. See some examples below.
Note: These macros are useful if you need very high UART baud rates (over 40 MHz), which means you will have
to use IO_MUX pins only. In other cases, these macros can be ignored, and you can use the GPIO Matrix as it allows
you to configure any GPIO pin for any UART function.
1. UART_NUM_2_TXD_DIRECT_GPIO_NUM returns the IO_MUX pin number of UART channel 2 TXD pin
(pin 17)
2. UART_GPIO19_DIRECT_CHANNEL returns the UART number of GPIO 19 when connected to the UART
peripheral via IO_MUX (this is UART_NUM_0)
3. UART_CTS_GPIO19_DIRECT_CHANNEL returns the UART number of GPIO 19 when used as the UART
CTS pin via IO_MUX (this is UART_NUM_0). Similar to the above macro but specifies the pin function which
is also part of the IO_MUX assignment.
Header File
• components/soc/esp32s2/include/soc/uart_channel.h
Macros
UART_GPIO1_DIRECT_CHANNEL
UART_NUM_0_TXD_DIRECT_GPIO_NUM
UART_GPIO3_DIRECT_CHANNEL
UART_NUM_0_RXD_DIRECT_GPIO_NUM
UART_GPIO19_DIRECT_CHANNEL
UART_NUM_0_CTS_DIRECT_GPIO_NUM
UART_GPIO22_DIRECT_CHANNEL
UART_NUM_0_RTS_DIRECT_GPIO_NUM
UART_TXD_GPIO1_DIRECT_CHANNEL
Espressif Systems 479
Submit Document Feedback
Release v4.4