Skip to content

Commit 6e5a875

Browse files
authored
Merge pull request #9137 from dhalbert/doc-espressif-analogin-limitations
document Espressif AnalogIn limitations
2 parents a5830ce + 5a7ac6f commit 6e5a875

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

shared-bindings/analogio/AnalogIn.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ MP_WEAK const mcu_pin_obj_t *common_hal_analogio_analogin_validate_pin(mp_obj_t
5656
//| """Use the AnalogIn on the given pin. The reference voltage varies by
5757
//| platform so use ``reference_voltage`` to read the configured setting.
5858
//|
59-
//| :param ~microcontroller.Pin pin: the pin to read from"""
59+
//| :param ~microcontroller.Pin pin: the pin to read from
60+
//|
61+
//| **Limitations:** On Espressif ESP32, `AnalogIn` is not available when WiFi is in use:
62+
//| the hardware makes use of the ADC. Attempts to use `AnalogIn` will raise `espidf.IDFError`.
63+
//| On other Espressif chips, the ADC is available, but is shared with WiFi.
64+
//| WiFi use takes precedence and may temporarily cause `espidf.IDFError` to be raise.
65+
//| when you read a value. You can retry the read.
66+
//| """
6067
//| ...
6168
STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type,
6269
mp_uint_t n_args, size_t n_kw, const mp_obj_t *args) {

0 commit comments

Comments
 (0)