Function esp_idf_svc::hal::sys::uart_driver_install

source ·
pub unsafe extern "C" fn uart_driver_install(
    uart_num: u32,
    rx_buffer_size: i32,
    tx_buffer_size: i32,
    queue_size: i32,
    uart_queue: *mut *mut QueueDefinition,
    intr_alloc_flags: i32,
) -> i32
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_HW_FIFO_LEN(uart_num). Tx_buffer_size should be either zero or greater than UART_HW_FIFO_LEN(uart_num).

@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