Function esp_idf_sys::esp_adc_cal_get_voltage
source ยท pub unsafe extern "C" fn esp_adc_cal_get_voltage(
channel: adc_channel_t,
chars: *const esp_adc_cal_characteristics_t,
voltage: *mut u32,
) -> esp_err_t
Expand description
@brief Reads an ADC and converts the reading to a voltage in mV
This function reads an ADC then converts the raw reading to a voltage in mV based on the characteristics provided. The ADC that is read is also determined by the characteristics.
@note The Characteristics structure must be initialized before this function is called (call esp_adc_cal_characterize())
@param[in] channel ADC Channel to read @param[in] chars Pointer to initialized ADC characteristics structure @param[out] voltage Pointer to store converted voltage
@return - ESP_OK: ADC read and converted to mV - ESP_ERR_INVALID_ARG: Error due to invalid arguments - ESP_ERR_INVALID_STATE: Reading result is invalid. Try to read again.