]> granicus.if.org Git - esp-idf/commitdiff
driver(adc): add descriptions for the issue that starting ADC can trigger interrupt...
authorkooho <2229179028@qq.com>
Mon, 5 Feb 2018 13:51:32 +0000 (21:51 +0800)
committerWangjialin <wangjialin@espressif.com>
Fri, 11 May 2018 09:08:58 +0000 (17:08 +0800)
components/driver/include/driver/adc.h
components/driver/include/driver/gpio.h

index e6c6df1a403e2ff1263ed58de82a4f80eb6e8bc9..b5a9a9848e3b92fcdc9c703d7e4e9d179f667eaf 100644 (file)
@@ -192,6 +192,10 @@ esp_err_t adc1_config_channel_atten(adc1_channel_t channel, adc_atten_t atten);
 
 /**
  * @brief Take an ADC1 reading from a single channel.
+ * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on,
+ *       the input of GPIO36 and GPIO39 will be pulled down for about 80ns.
+ *       When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39.
+ *       Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.
  *
  * @note Call adc1_config_width() before the first time this
  * function is called.
@@ -210,6 +214,11 @@ int adc1_get_raw(adc1_channel_t channel);
 
 /** @cond */    //Doxygen command to hide deprecated function from API Reference
 /*
+ * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on,
+ *       the input of GPIO36 and GPIO39 will be pulled down for about 80ns.
+ *       When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39.
+ *       Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.
+ *       
  * @deprecated This function returns an ADC1 reading but is deprecated due to
  * a misleading name and has been changed to directly call the new function.
  * Use the new function adc1_get_raw() instead
@@ -288,6 +297,11 @@ void adc1_ulp_enable();
 /**
  * @brief Read Hall Sensor
  *
+ * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on,
+ *       the input of GPIO36 and GPIO39 will be pulled down for about 80ns.
+ *       When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39.
+ *       Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.
+ *
  * @note The Hall Sensor uses channels 0 and 3 of ADC1. Do not configure
  * these channels for use as ADC channels.
  *
@@ -349,6 +363,11 @@ esp_err_t adc2_config_channel_atten(adc2_channel_t channel, adc_atten_t atten);
 /**
  * @brief Take an ADC2 reading on a single channel
  *
+ * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on,
+ *       the input of GPIO36 and GPIO39 will be pulled down for about 80ns.
+ *       When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39.
+ *       Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.
+ *
  * @note For a given channel, ``adc2_config_channel_atten()``
  * must be called before the first time this function is called. If Wi-Fi is started via ``esp_wifi_start()``, this
  * function will always fail with ``ESP_ERR_TIMEOUT``.
index 2f272ef5e7d9cd679dcaa63222cb6834eeb40a5a..aed6427bf8763c343b964fc7d31edd21d16f3ad5 100644 (file)
@@ -265,6 +265,10 @@ esp_err_t gpio_set_intr_type(gpio_num_t gpio_num, gpio_int_type_t intr_type);
 /**
  * @brief  Enable GPIO module interrupt signal
  *
+ * @note Please do not use the interrupt of GPIO36 and GPIO39 when using ADC.
+ *       Please refer to the comments of `adc1_get_raw`.
+ *       Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.
+ *
  * @param  gpio_num GPIO number. If you want to enable an interrupt on e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16);
  *
  * @return