Function esp_idf_sys::esp_adc_cal_characterize
source ยท pub unsafe extern "C" fn esp_adc_cal_characterize(
adc_num: adc_unit_t,
atten: adc_atten_t,
bit_width: adc_bits_width_t,
default_vref: u32,
chars: *mut esp_adc_cal_characteristics_t,
) -> esp_adc_cal_value_t
Expand description
@brief Characterize an ADC at a particular attenuation
This function will characterize the ADC at a particular attenuation and generate the ADC-Voltage curve in the form of [y = coeff_a * x + coeff_b]. Characterization can be based on Two Point values, eFuse Vref, or default Vref and the calibration values will be prioritized in that order.
@note For ESP32, Two Point values and eFuse Vref calibration can be enabled/disabled using menuconfig. For ESP32s2, only Two Point values calibration and only ADC_WIDTH_BIT_13 is supported. The parameter default_vref is unused.
@param[in] adc_num ADC to characterize (ADC_UNIT_1 or ADC_UNIT_2) @param[in] atten Attenuation to characterize @param[in] bit_width Bit width configuration of ADC @param[in] default_vref Default ADC reference voltage in mV (Only in ESP32, used if eFuse values is not available) @param[out] chars Pointer to empty structure used to store ADC characteristics
@return - ESP_ADC_CAL_VAL_EFUSE_VREF: eFuse Vref used for characterization - ESP_ADC_CAL_VAL_EFUSE_TP: Two Point value used for characterization (only in Linear Mode) - ESP_ADC_CAL_VAL_DEFAULT_VREF: Default Vref used for characterization