Chapter 2. API Reference
Parameters
• uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
• level: 1: RTS output low (active); 0: RTS output high (block)
esp_err_t uart_set_dtr(uart_port_t
Manually set the UART DTR pin level.
Return
• ESP_OK Success
• ESP_FAIL Parameter error
Parameters
• uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
• level: 1: DTR output low; 0: DTR output high
esp_err_t uart_set_tx_idle_num(uart_port_t
Set UART idle interval after tx FIFO is empty.
Return
• ESP_OK Success
• ESP_FAIL Parameter error
Parameters
• uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
• idle_num: idle interval after tx FIFO is empty(unit: the time it takes to send one bit under current
baudrate)
esp_err_t uart_param_config(uart_port_t
Set UART configuration parameters.
Return
• ESP_OK Success
• ESP_FAIL Parameter error
Parameters
• uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
• uart_config: UART parameter settings
esp_err_t uart_intr_config(uart_port_t
Configure UART interrupts.
Return
• ESP_OK Success
• ESP_FAIL Parameter error
Parameters
• uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
• intr_conf: UART interrupt settings
esp_err_t uart_wait_tx_done(uart_port_t
Wait until UART TX FIFO is empty.
Return
• ESP_OK Success
• ESP_FAIL Parameter error
• ESP_ERR_TIMEOUT Timeout
Parameters
• uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
• ticks_to_wait: Timeout, count in RTOS ticks
int
uart_tx_chars(uart_port_t
Send data to the UART port from a given buffer and length.
This function will not wait for enough space in TX FIFO. It will just fill the available TX FIFO and return
when the FIFO is full.
Note This function should only be used when UART TX buffer is not enabled.
Return
• (-1) Parameter error
Espressif Systems
uart_num, int level)
uart_num, uint16_t idle_num)
uart_num, const
uart_num, const
uart_num, TickType_t ticks_to_wait)
uart_num, const char *buffer, uint32_t len)
469
Submit Document Feedback
uart_config_t
*uart_config)
uart_intr_config_t
*intr_conf)
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?