Function esp_idf_svc::hal::sys::uart_pattern_pop_pos

source ยท
pub unsafe extern "C" fn uart_pattern_pop_pos(uart_num: u32) -> i32
Expand description

@brief Return the nearest detected pattern position in buffer. The positions of the detected pattern are saved in a queue, this function will dequeue the first pattern position and move the pointer to next pattern position. @note If the RX buffer is full and flow control is not enabled, the detected pattern may not be found in the rx buffer due to overflow.

   The following APIs will modify the pattern position info:
   uart_flush_input, uart_read_bytes, uart_driver_delete, uart_pop_pattern_pos
   It is the application's responsibility to ensure atomic access to the pattern queue and the rx data buffer
   when using pattern detect feature.

@param uart_num UART port number, the max port number is (UART_NUM_MAX -1). @return - (-1) No pattern found for current index or parameter error - others the pattern position in rx buffer.