diff --git a/docs/en/api-reference/peripherals/adc.rst b/docs/en/api-reference/peripherals/adc.rst index b5876ffe1b..abba6594dc 100644 --- a/docs/en/api-reference/peripherals/adc.rst +++ b/docs/en/api-reference/peripherals/adc.rst @@ -76,7 +76,7 @@ Reading voltage on ADC1 channel 0 ({IDF_TARGET_ADC1_CH0}):: int val = adc1_get_raw(ADC1_CHANNEL_0); The input voltage in the above example is from 0 to 1.1 V (0 dB attenuation). The input range can be extended by setting a higher attenuation, see :cpp:type:`adc_atten_t`. -An example of using the ADC driver including calibration (discussed below) is available at esp-idf: :example:`peripherals/adc` +An example of using the ADC driver including calibration (discussed below) is available at esp-idf: :example:`peripherals/adc/adc` Reading voltage on ADC2 channel 7 ({IDF_TARGET_ADC2_CH7}):: @@ -95,7 +95,7 @@ Reading voltage on ADC2 channel 7 ({IDF_TARGET_ADC2_CH7}):: } The reading may fail due to collision with Wi-Fi, should check it. -An example using the ADC2 driver to read the output of DAC is available in esp-idf: :example:`peripherals/adc2` +An example using the ADC2 driver to read the output of DAC is available in esp-idf: :example:`peripherals/adc/adc2` .. only:: esp32 diff --git a/examples/peripherals/adc/CMakeLists.txt b/examples/peripherals/adc/adc/CMakeLists.txt similarity index 100% rename from examples/peripherals/adc/CMakeLists.txt rename to examples/peripherals/adc/adc/CMakeLists.txt diff --git a/examples/peripherals/adc/Makefile b/examples/peripherals/adc/adc/Makefile similarity index 100% rename from examples/peripherals/adc/Makefile rename to examples/peripherals/adc/adc/Makefile diff --git a/examples/peripherals/adc/README.md b/examples/peripherals/adc/adc/README.md similarity index 100% rename from examples/peripherals/adc/README.md rename to examples/peripherals/adc/adc/README.md diff --git a/examples/peripherals/adc/main/CMakeLists.txt b/examples/peripherals/adc/adc/main/CMakeLists.txt similarity index 100% rename from examples/peripherals/adc/main/CMakeLists.txt rename to examples/peripherals/adc/adc/main/CMakeLists.txt diff --git a/examples/peripherals/adc/main/adc1_example_main.c b/examples/peripherals/adc/adc/main/adc1_example_main.c similarity index 100% rename from examples/peripherals/adc/main/adc1_example_main.c rename to examples/peripherals/adc/adc/main/adc1_example_main.c diff --git a/examples/peripherals/adc/main/component.mk b/examples/peripherals/adc/adc/main/component.mk similarity index 100% rename from examples/peripherals/adc/main/component.mk rename to examples/peripherals/adc/adc/main/component.mk diff --git a/examples/peripherals/adc2/CMakeLists.txt b/examples/peripherals/adc/adc2/CMakeLists.txt similarity index 100% rename from examples/peripherals/adc2/CMakeLists.txt rename to examples/peripherals/adc/adc2/CMakeLists.txt diff --git a/examples/peripherals/adc2/Makefile b/examples/peripherals/adc/adc2/Makefile similarity index 100% rename from examples/peripherals/adc2/Makefile rename to examples/peripherals/adc/adc2/Makefile diff --git a/examples/peripherals/adc2/README.md b/examples/peripherals/adc/adc2/README.md similarity index 100% rename from examples/peripherals/adc2/README.md rename to examples/peripherals/adc/adc2/README.md diff --git a/examples/peripherals/adc2/main/CMakeLists.txt b/examples/peripherals/adc/adc2/main/CMakeLists.txt similarity index 100% rename from examples/peripherals/adc2/main/CMakeLists.txt rename to examples/peripherals/adc/adc2/main/CMakeLists.txt diff --git a/examples/peripherals/adc2/main/Kconfig.projbuild b/examples/peripherals/adc/adc2/main/Kconfig.projbuild similarity index 100% rename from examples/peripherals/adc2/main/Kconfig.projbuild rename to examples/peripherals/adc/adc2/main/Kconfig.projbuild diff --git a/examples/peripherals/adc2/main/adc2_example_main.c b/examples/peripherals/adc/adc2/main/adc2_example_main.c similarity index 100% rename from examples/peripherals/adc2/main/adc2_example_main.c rename to examples/peripherals/adc/adc2/main/adc2_example_main.c diff --git a/examples/peripherals/adc2/main/component.mk b/examples/peripherals/adc/adc2/main/component.mk similarity index 100% rename from examples/peripherals/adc2/main/component.mk rename to examples/peripherals/adc/adc2/main/component.mk diff --git a/examples/peripherals/adc_dma_demo/CMakeLists.txt b/examples/peripherals/adc/adc_dma_demo/CMakeLists.txt similarity index 100% rename from examples/peripherals/adc_dma_demo/CMakeLists.txt rename to examples/peripherals/adc/adc_dma_demo/CMakeLists.txt diff --git a/examples/peripherals/adc_dma_demo/main/CMakeLists.txt b/examples/peripherals/adc/adc_dma_demo/main/CMakeLists.txt similarity index 100% rename from examples/peripherals/adc_dma_demo/main/CMakeLists.txt rename to examples/peripherals/adc/adc_dma_demo/main/CMakeLists.txt diff --git a/examples/peripherals/adc_dma_demo/main/adc_dma_example_main.c b/examples/peripherals/adc/adc_dma_demo/main/adc_dma_example_main.c similarity index 100% rename from examples/peripherals/adc_dma_demo/main/adc_dma_example_main.c rename to examples/peripherals/adc/adc_dma_demo/main/adc_dma_example_main.c diff --git a/examples/peripherals/adc_dma_demo/README.md b/examples/peripherals/adc_dma_demo/README.md deleted file mode 100644 index 0b969030e5..0000000000 --- a/examples/peripherals/adc_dma_demo/README.md +++ /dev/null @@ -1,55 +0,0 @@ -| Supported Targets | ESP32-C3 | -| ----------------- | -------- | - -# ADC DMA Example - -(See the README.md file in the upper level 'examples' directory for more information about examples.) - -This example shows how to use DMA to read voltage from a GPIO pin via ADC controller. - -## How to use example - -### Hardware Required - -* A development board with ESP32C3 SoC -* A USB cable for power supply and programming - -In this example, we use `ADC_UNIT_1` by default, we need to connect a voltage source (0 ~ 3.3v) to GPIO1. If another ADC unit is selected in your application, you need to change the GPIO pin (please refer to the `ESP32C3 Technical Reference Manual`). - -### Configure the project - -``` -idf.py menuconfig -``` - -### Build and Flash - -Build the project and flash it to the board, then run monitor tool to view serial output: - -``` -idf.py -p PORT flash monitor -``` - -(To exit the serial monitor, type ``Ctrl-]``.) - -See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects. - -## Example Output - -Running this example, you will see the following log output on the serial monitor: - -[unit_channel_data]() -``` -[0_1_54e](4e 25 00 00) -[0_1_548](48 25 00 00) -[0_1_556](56 25 00 00) -``` - -## Troubleshooting - -* program upload failure - - * Hardware connection is not correct: run `idf.py -p PORT monitor`, and reboot your board to see if there are any output logs. - * The baud rate for downloading is too high: lower your baud rate in the `menuconfig` menu, and try again. - -For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.