From 50adfe8eabcd35fa37c02aee3cabf8f2b1efb6d8 Mon Sep 17 00:00:00 2001 From: "pedro.minatel" Date: Tue, 6 Apr 2021 12:32:21 +0100 Subject: [PATCH] Added support for the ESP32-S3 in the blink example --- examples/get-started/blink/README.md | 25 ++++++++++++++----- .../get-started/blink/main/CMakeLists.txt | 2 +- .../get-started/blink/main/Kconfig.projbuild | 6 +++-- .../main/{blink.c => blink_example_main.c} | 0 4 files changed, 24 insertions(+), 9 deletions(-) rename examples/get-started/blink/main/{blink.c => blink_example_main.c} (100%) diff --git a/examples/get-started/blink/README.md b/examples/get-started/blink/README.md index b8b21da6a8..a6d3dd60b0 100644 --- a/examples/get-started/blink/README.md +++ b/examples/get-started/blink/README.md @@ -12,7 +12,7 @@ Before project configuration and build, be sure to set the correct chip target u ### Hardware Required -* A development board with ESP32/ESP32-S2/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.) +* A development board with ESP32/ESP32-S2/ESP32-S3/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.) * A USB cable for Power supply and programming Some development boards use an addressable LED instead of a regular one. These development boards include: @@ -23,6 +23,7 @@ Some development boards use an addressable LED instead of a regular one. These d | ESP32-C3-DevKitM-1 | Addressable | GPIO8 | | ESP32-S2-DevKitM-1 | Addressable | GPIO18 | | ESP32-S2-Saola-1 | Addressable | GPIO18 | +| ESP32-S3-Addax-1 | Addressable | GPIO47 | See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it. @@ -33,13 +34,12 @@ Open the project configuration menu (`idf.py menuconfig`). In the `Example Configuration` menu: * Select the LED type in the `Blink LED type` option. - * * Use `GPIO` for regular LED blink. - * * Use `RMT` for addressable LED blink. - * * * Use `RMT Channel` to select the RMT peripheral channel. + * Use `GPIO` for regular LED blink. + * Use `RMT` for addressable LED blink. + * Use `RMT Channel` to select the RMT peripheral channel. * Set the GPIO number used for the signal in the `Blink GPIO number` option. * Set the blinking period in the `Blink period in ms` option. - ### Build and Flash Run `idf.py -p PORT flash monitor` to build, flash and monitor the project. @@ -52,6 +52,19 @@ See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/l As you run the example, you will see the LED blinking, according to the previously defined period. For the addressable LED, you can also change the LED color by setting the `pStrip_a->set_pixel(pStrip_a, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the `blink.c` file. +``` +I (315) example: Example configured to blink addressable LED! +I (325) example: Turning the LED OFF! +I (1325) example: Turning the LED ON! +I (2325) example: Turning the LED OFF! +I (3325) example: Turning the LED ON! +I (4325) example: Turning the LED OFF! +I (5325) example: Turning the LED ON! +I (6325) example: Turning the LED OFF! +I (7325) example: Turning the LED ON! +I (8325) example: Turning the LED OFF! +``` + Note: The color order could be different according to the LED model. The pixel number indicates the pixel position in the LED strip. For a single LED, use 0. @@ -60,4 +73,4 @@ The pixel number indicates the pixel position in the LED strip. For a single LED * If the LED isn't blinking, check the GPIO or the LED type selection in the `Example Configuration` menu. -For any technical queries, please open an [issue] (https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon. +For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon. diff --git a/examples/get-started/blink/main/CMakeLists.txt b/examples/get-started/blink/main/CMakeLists.txt index 6f47c26eab..448f871365 100644 --- a/examples/get-started/blink/main/CMakeLists.txt +++ b/examples/get-started/blink/main/CMakeLists.txt @@ -1,2 +1,2 @@ -idf_component_register(SRCS "blink.c" +idf_component_register(SRCS "blink_example_main.c" INCLUDE_DIRS ".") diff --git a/examples/get-started/blink/main/Kconfig.projbuild b/examples/get-started/blink/main/Kconfig.projbuild index 98bc61b8a7..0944303b6c 100644 --- a/examples/get-started/blink/main/Kconfig.projbuild +++ b/examples/get-started/blink/main/Kconfig.projbuild @@ -4,6 +4,7 @@ menu "Example Configuration" prompt "Blink LED type" default BLINK_LED_RMT if IDF_TARGET_ESP32C3 default BLINK_LED_RMT if IDF_TARGET_ESP32S2 + default BLINK_LED_RMT if IDF_TARGET_ESP32S3 default BLINK_LED_GPIO help Defines the default peripheral for blink example @@ -23,18 +24,19 @@ menu "Example Configuration" Set the RMT peripheral channel. ESP32 RMT channel from 0 to 7 ESP32-S2 RMT channel from 0 to 3 + ESP32-S3 RMT channel from 0 to 3 ESP32-C3 RMT channel from 0 to 1 config BLINK_GPIO int "Blink GPIO number" - range 0 34 + range 0 48 default 8 if IDF_TARGET_ESP32C3 default 18 if IDF_TARGET_ESP32S2 + default 47 if IDF_TARGET_ESP32S3 default 5 help GPIO number (IOxx) to blink on and off or the RMT signal for the addressable LED. Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink. - GPIOs 35-39 are input-only so cannot be used as outputs. config BLINK_PERIOD int "Blink period in ms" diff --git a/examples/get-started/blink/main/blink.c b/examples/get-started/blink/main/blink_example_main.c similarity index 100% rename from examples/get-started/blink/main/blink.c rename to examples/get-started/blink/main/blink_example_main.c