Function esp_idf_svc::sys::uart_write_bytes_with_break

source ·
pub unsafe extern "C" fn uart_write_bytes_with_break(
    uart_num: u32,
    src: *const c_void,
    size: usize,
    brk_len: i32,
) -> 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 and the break signal have been sent out. After all data is sent out, send a break signal.

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. After all data sent out, send a break signal.

@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 @param brk_len break signal duration(unit: the time it takes to send one bit at current baudrate)

@return - (-1) Parameter error - OTHERS (>=0) The number of bytes pushed to the TX FIFO