diff options
author | purewack <bobimaster15@gmail.com> | 2025-01-02 11:44:00 +0000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-06-05 17:01:51 +1000 |
commit | 5f058e9863c0770aa8a4defe23f70919cea94160 (patch) | |
tree | 141b7593c0fa4c57e5543f8eef35212268015a4e /docs/esp32/quickref.rst | |
parent | 2c2f0b292afbeb41a23a742c3cd74a714e9c03c0 (diff) | |
download | micropython-master.tar.gz micropython-master.zip |
This commit updates the ADC to use the new driver `esp_adc/adc_oneshot.h`.
There are several errata notes about not being able to change the bit-width
of the ADCs certain chips. The only chip that can switch resolution to a
lower one is the normal ESP32. ESP32 C2 and S3 are stuck at 12 bits, while
S2 is at 13 bits.
On the S2, you can change the resolution, but it has no effect on the
resolution, rather, it prevents attenuation from working at all!
The resolution is set to the maximum possible for each SoC, with the ESP32
being the only one not throwing errors when trying to set the bit-width to
9, 10, 11 or 12 bits using `ADC.width(bits)`.
Signed-off-by: Damian Nowacki (purewack) bobimaster15@gmail.com
Diffstat (limited to 'docs/esp32/quickref.rst')
-rw-r--r-- | docs/esp32/quickref.rst | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/docs/esp32/quickref.rst b/docs/esp32/quickref.rst index 63180b470a..c394414a76 100644 --- a/docs/esp32/quickref.rst +++ b/docs/esp32/quickref.rst @@ -544,14 +544,27 @@ Legacy methods: Equivalent to ``ADC.block().init(bits=bits)``. +The only chip that can switch resolution to a lower one is the normal esp32. +The C2 & S3 are stuck at 12 bits, while the S2 is at 13 bits. + For compatibility, the ``ADC`` object also provides constants matching the -supported ADC resolutions: +supported ADC resolutions, per chip: +ESP32: - ``ADC.WIDTH_9BIT`` = 9 - ``ADC.WIDTH_10BIT`` = 10 - ``ADC.WIDTH_11BIT`` = 11 - ``ADC.WIDTH_12BIT`` = 12 +ESP32 C3 & S3: + - ``ADC.WIDTH_12BIT`` = 12 + +ESP32 S2: + - ``ADC.WIDTH_13BIT`` = 13 + +.. method:: ADC.deinit() + + Provided to deinit the adc driver. Software SPI bus ---------------- |