uart_driver_install() function
Install UART driver and set the UART to the default configuration. UART ISR handler will be attached to the same CPU core that this function is running on.
Arguments
uart_num
UART port number, the max port number is (UART_NUM_MAX -1).
rx_buffer_size
UART RX ring buffer size.
tx_buffer_size
UART TX ring buffer size. If set to zero, driver will not use TX buffer, TX function will block task until all data have been sent out.
queue_size
UART event queue size/depth.
uart_queue
UART event queue handle (out param). On success, a new queue handle is written here to provide access to UART events. If set to NULL, driver will not use an event queue.
intr_alloc_flags
Flags used to allocate the interrupt. One or multiple (ORred) ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. Do not set ESP_INTR_FLAG_IRAM here (the driver's ISR handler is not located in IRAM)
Return value
- ESP_OK Success - ESP_FAIL Parameter error
Notes
Rx_buffer_size should be greater than UART_HW_FIFO_LEN(uart_num). Tx_buffer_size should be either zero or greater than UART_HW_FIFO_LEN(uart_num).
![]()
uart_driver_install(uart_num, LINE_BUF_SIZE, 0, 8, &uart_queue, 0);![]()
uart_driver_install(uart_num, 256, 0, 8, &uart_queue, 0);
uart_driver_install() is called by 5 functions and calls 12 functions:
![]()
uart_driver_install()
uart_driver_install() reads 22 variables and writes 17 variables:
![]()
uart_driver_install()