Skip to main content

uart_detect_bitrate_start

Function uart_detect_bitrate_start 

Source
pub unsafe extern "C" fn uart_detect_bitrate_start(
    uart_num: uart_port_t,
    config: *const uart_bitrate_detect_config_t,
) -> esp_err_t
Expand description

@brief Start to do a bitrate detection for an incoming data signal (auto baud rate detection)

This function can act as a standalone API. No need to install UART driver before calling this function.

It is recommended that the incoming data line contains alternating bit sequence, data bytes such as 0x55 or 0xAA. Characters NULL', 0xCC` are not good for the measurement.

@param uart_num The ID of the UART port to be used to do the measurement. Note that only HP UART ports have the capability. @param config Pointer to the configuration structure for the UART port. If the port has already been acquired, this parameter is ignored.

@return - ESP_OK on success - ESP_ERR_INVALID_ARG Parameter error - ESP_FAIL No free uart port or source_clk invalid