EasyManua.ls Logo

Espressif ESP32-S2 - Page 477

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
parity_mode: Pointer to accept value of UART parity mode.
esp_err_t uart_set_baudrate(uart_port_t uart_num, uint32_t baudrate)
Set UART baud rate.
Return
ESP_FAIL Parameter error
ESP_OK Success
Parameters
uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
baudrate: UART baud rate.
esp_err_t uart_get_baudrate(uart_port_t uart_num, uint32_t *baudrate)
Get the UART baud rate configuration.
Return
ESP_FAIL Parameter error
ESP_OK Success, result will be put in (*baudrate)
Parameters
uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
baudrate: Pointer to accept value of UART baud rate
esp_err_t uart_set_line_inverse(uart_port_t uart_num, uint32_t inverse_mask)
Set UART line inverse mode.
Return
ESP_OK Success
ESP_FAIL Parameter error
Parameters
uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
inverse_mask: Choose the wires that need to be inverted. Using the ORred mask of
uart_signal_inv_t
esp_err_t uart_set_hw_flow_ctrl(uart_port_t uart_num, uart_hw_flowcontrol_t flow_ctrl, uint8_t
rx_thresh)
Set hardware flow control.
Return
ESP_OK Success
ESP_FAIL Parameter error
Parameters
uart_num: UART port number, the max port number is (UART_NUM_MAX -1).
flow_ctrl: Hardware flow control mode
rx_thresh: Threshold of Hardware RX flow control (0 ~ UART_FIFO_LEN). Only when
UART_HW_FLOWCTRL_RTS is set, will the rx_thresh value be set.
esp_err_t uart_set_sw_flow_ctrl(uart_port_t uart_num, bool enable, uint8_t rx_thresh_xon, uint8_t
rx_thresh_xo)
Set software flow control.
Return
ESP_OK Success
ESP_FAIL Parameter error
Parameters
uart_num: UART_NUM_0, UART_NUM_1 or UART_NUM_2
enable: switch on or off
rx_thresh_xon: low water mark
rx_thresh_xoff: high water mark
esp_err_t uart_get_hw_flow_ctrl(uart_port_t uart_num, uart_hw_flowcontrol_t *flow_ctrl)
Get the UART hardware flow control configuration.
Return
ESP_FAIL Parameter error
Espressif Systems 466
Submit Document Feedback
Release v4.4

Table of Contents