[][src]Function esp_idf_bindgen::adc2_get_raw

pub unsafe extern "C" fn adc2_get_raw(
    channel: adc2_channel_t,
    width_bit: adc_bits_width_t,
    raw_out: *mut c_int
) -> esp_err_t

@brief Take an ADC2 reading on a single channel

@note ESP32: When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on, the input of GPIO36 and GPIO39 will be pulled down for about 80ns. When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39. Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.

@note ESP32: For a given channel, adc2_config_channel_atten() must be called before the first time this function is called. If Wi-Fi is started via esp_wifi_start(), this function will always fail with ESP_ERR_TIMEOUT.

@note ESP32S2: ADC2 support hardware arbiter. The arbiter is to improve the use efficiency of ADC2. After the control right is robbed by the high priority, the low priority controller will read the invalid ADC2 data. Default priority: Wi-Fi > RTC > Digital;

@param channel ADC2 channel to read @param width_bit Bit capture width for ADC2. For ESP32S2, only support ADC_WIDTH_BIT_13. @param raw_out the variable to hold the output data.

@return - ESP_OK if success - ESP_ERR_TIMEOUT ADC2 is being used by other controller and the request timed out. - ESP_ERR_INVALID_STATE The controller status is invalid. Please try again.