Function esp_idf_svc::hal::sys::uart_write_bytes
source · pub unsafe extern "C" fn uart_write_bytes(
uart_num: u32,
src: *const c_void,
size: usize,
) -> i32
Expand description
@brief Send data to the UART port from a given buffer and length,
If the UART driver’s parameter ‘tx_buffer_size’ is set to zero: This function will not return until all the data have been sent out, or at least pushed into TX FIFO.
Otherwise, if the ‘tx_buffer_size’ > 0, this function will return after copying all the data to tx ring buffer, UART ISR will then move data from the ring buffer to TX FIFO gradually.
@param uart_num UART port number, the max port number is (UART_NUM_MAX -1). @param src data buffer address @param size data length to send
@return - (-1) Parameter error - OTHERS (>=0) The number of bytes pushed to the TX FIFO