esp_adc_cal_characterize() function
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.
Arguments
adc_num
ADC to characterize (ADC_UNIT_1 or ADC_UNIT_2)
atten
Attenuation to characterize
bit_width
Bit width configuration of ADC
default_vref
Default ADC reference voltage in mV (Only in ESP32, used if eFuse values is not available)
chars
Pointer to empty structure used to store ADC characteristics
Return value
- 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
Notes
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.
esp_adc_cal_characterize() calls 8 functions:
![]()
esp_adc_cal_characterize()
esp_adc_cal_characterize() reads 11 variables and writes 6 variables:
![]()
esp_adc_cal_characterize()