Merge branch 'feature/adc_calibration_on_c2' into 'master'

esp_adc: support adc calibration on esp32c2

Closes IDF-5203 and IDF-5899

See merge request espressif/esp-idf!20044
This commit is contained in:
Armando (Dou Yiwen)
2022-10-18 10:50:59 +08:00
30 changed files with 532 additions and 148 deletions

View File

@@ -33,7 +33,7 @@ The ADC calibration driver provides ADC calibration scheme(s). From calibration
For those users who use their custom ADC calibration schemes, you could either modify this function :cpp:func:`adc_cali_check_scheme`, or just skip this step and call your custom creation function.
.. only:: esp32 or esp32s2
.. only:: esp32 or esp32s2 or esp32c2
ADC Calibration Line Fitting Scheme
```````````````````````````````````
@@ -120,7 +120,7 @@ For those users who use their custom ADC calibration schemes, you could either m
ESP_ERROR_CHECK(adc_cali_delete_scheme_curve_fitting(handle));
.. only:: esp32c2 or esp32h2
.. only:: esp32h2
There is no supported calibration scheme yet.
@@ -134,6 +134,11 @@ Result Conversion
After setting up the calibration characteristics, you can call :cpp:func:`adc_cali_raw_to_voltage` to convert the ADC raw result into calibrated result. The calibrated result is in the unit of mV. This function may fail due to invalid argument. Especailly, if this function returns :c:macro:`ESP_ERR_INVALID_STATE`, this means the calibration scheme isn't created. You need to create a calibration scheme handle, use :cpp:func:`adc_cali_check_scheme` to know the supported calibration scheme. On the other hand, you could also provide a custom calibration scheme and create the handle.
.. only:: esp32c2
.. note::
ADC calibration is only supported under :c:macro:`ADC_ATTEN_DB_0` and :c:macro:`ADC_ATTEN_DB_11`. Under :c:macro:`ADC_ATTEN_DB_0`, input voltage higher than 950 mV is not supported. Under :c:macro:`ADC_ATTEN_DB_11`, input voltage higher than 2800 mV is not supported.
Get Voltage
~~~~~~~~~~~

View File

@@ -205,11 +205,11 @@ To do further calbration to convert the ADC raw result to voltage in mV, please
Hardware Limitations
^^^^^^^^^^^^^^^^^^^^
- A specific ADC unit can only work under one operating mode at any one time, either Continuous Mode or Oneshot Mode. :cpp:func:`adc_continuous_start` has provided the protection.
- A specific ADC unit can only work under one operating mode at any one time, either continuous mode or oneshot mode. :cpp:func:`adc_continuous_start` has provided the protection.
- Random Number Generator uses ADC as an input source. When ADC continuous mode driver works, the random number generated from RNG will be less random.
.. only:: esp32s2 or esp32c3 or esp32s3
.. only:: esp32 or esp32s2 or esp32c3 or esp32s3
- ADC2 is also used by the Wi-Fi. :cpp:func:`adc_continuous_start` has provided the protection between Wi-Fi driver and ADC continuous mode driver.

View File

@@ -152,11 +152,11 @@ Hardware Limitations
.. only:: SOC_ADC_DMA_SUPPORTED
- A specific ADC unit can only work under one operating mode at any one time, either Continuous Mode or Oneshot Mode. :cpp:func:`adc_oneshot_read` has provided the protection.
- A specific ADC unit can only work under one operating mode at any one time, either continuous mode or oneshot mode. :cpp:func:`adc_oneshot_read` has provided the protection.
.. only:: esp32s2 or esp32c3 or esp32s3
.. only:: esp32 or esp32s2 or esp32c3 or esp32s3
- ADC2 is also used by the Wi-Fi. :cpp:func:`adc_oneshot_read` has provided the protection between Wi-Fi driver and ADC continuous mode driver.
- ADC2 is also used by the Wi-Fi. :cpp:func:`adc_oneshot_read` has provided the protection between Wi-Fi driver and ADC oneshot mode driver.
.. only:: esp32