Function esp_idf_sys::uart_driver_install

source ·
pub unsafe extern "C" fn uart_driver_install(
    uart_num: uart_port_t,
    rx_buffer_size: c_int,
    tx_buffer_size: c_int,
    queue_size: c_int,
    uart_queue: *mut QueueHandle_t,
    intr_alloc_flags: c_int,
) -> esp_err_t
Expand description

@brief 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.

@note Rx_buffer_size should be greater than UART_FIFO_LEN. Tx_buffer_size should be either zero or greater than UART_FIFO_LEN.

@param uart_num UART port number, the max port number is (UART_NUM_MAX -1). @param rx_buffer_size UART RX ring buffer size. @param 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. @param queue_size UART event queue size/depth. @param 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. @param 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 - ESP_OK Success - ESP_FAIL Parameter error