N.B. you do not necessarily get a range all the way to 3.3V VCC!!!!
On the ESP32S2 using adc_cali_raw_to_voltage() the max voltage we could read was 2.643V with atten = ADC_ATTEN_DB_11
The ESP32 has an AtoD Vref of approx 1.1V, but this is nominal and it can be in the range 1.0 to 1.2V. An offset is calibrated at manufacture and stored in an eFuse. Its calibration function will allow for its actual Vref to be compensated for using this, but although in theory atten 11dB should give you at least min 3.3V (approx 3.5 x 1.0V Vref min = 3.5V), in our experience we found we got an ESP32S2 maxing out at 2.643V (raw value read was 8192). Couldn’t find an explanation for this, ended up just having to work around it.
This old Espressif page indicates a max range up to 2.45V
Is Vref created from a voltage reference diode or from VCC?
From this description in the ESP32 S2 datasheet “esp32-s2_datasheet_en.pdf” it appears its VCC:
ESP32-S2 has two 8-bit DAC channels that convert two digital signals into two analog voltage signal outputs. The two DAC channels support independent conversions. The design structure is composed of integrated resistor strings and a buffer. This dual DAC supports VDD3P3_RTC_IO power supply as input voltage reference.
VDD3P3_RTC_IO is the VCC pin.