From d4d06477bae200fd97240f9a8a9a664ce2922536 Mon Sep 17 00:00:00 2001 From: DuRuofu Date: Sun, 16 Feb 2025 10:06:11 +0800 Subject: [PATCH] =?UTF-8?q?code:=20=E6=B7=BB=E5=8A=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blink_menuconfig/main/Kconfig.projbuild | 39 ++--------- .../03/blink_component/CMakeLists.txt | 6 ++ .../02.idf_basic/03/blink_component/README.md | 69 +++++++++++++++++++ .../components/led_blink/CMakeLists.txt | 4 ++ .../components/led_blink/Kconfig | 20 ++++++ .../components/led_blink/include/led_blink.h | 19 +++++ .../components/led_blink/led_blink.c | 24 +++++++ .../03/blink_component/main/CMakeLists.txt | 2 + .../03/blink_component/main/main.c | 26 +++++++ .../03/blink_component/sdkconfig.defaults | 2 + .../04/button_blink/CMakeLists.txt | 6 ++ code/02.idf_basic/04/button_blink/README.md | 69 +++++++++++++++++++ .../components/led_blink/CMakeLists.txt | 4 ++ .../button_blink/components/led_blink/Kconfig | 20 ++++++ .../components/led_blink/include/led_blink.h | 19 +++++ .../components/led_blink/led_blink.c | 24 +++++++ .../04/button_blink/dependencies.lock | 35 ++++++++++ .../04/button_blink/main/CMakeLists.txt | 2 + .../04/button_blink/main/blink_example_main.c | 49 +++++++++++++ .../04/button_blink/main/idf_component.yml | 17 +++++ .../04/button_blink/sdkconfig.defaults | 2 + 21 files changed, 424 insertions(+), 34 deletions(-) create mode 100644 code/02.idf_basic/03/blink_component/CMakeLists.txt create mode 100644 code/02.idf_basic/03/blink_component/README.md create mode 100644 code/02.idf_basic/03/blink_component/components/led_blink/CMakeLists.txt create mode 100644 code/02.idf_basic/03/blink_component/components/led_blink/Kconfig create mode 100644 code/02.idf_basic/03/blink_component/components/led_blink/include/led_blink.h create mode 100644 code/02.idf_basic/03/blink_component/components/led_blink/led_blink.c create mode 100644 code/02.idf_basic/03/blink_component/main/CMakeLists.txt create mode 100644 code/02.idf_basic/03/blink_component/main/main.c create mode 100644 code/02.idf_basic/03/blink_component/sdkconfig.defaults create mode 100644 code/02.idf_basic/04/button_blink/CMakeLists.txt create mode 100644 code/02.idf_basic/04/button_blink/README.md create mode 100644 code/02.idf_basic/04/button_blink/components/led_blink/CMakeLists.txt create mode 100644 code/02.idf_basic/04/button_blink/components/led_blink/Kconfig create mode 100644 code/02.idf_basic/04/button_blink/components/led_blink/include/led_blink.h create mode 100644 code/02.idf_basic/04/button_blink/components/led_blink/led_blink.c create mode 100644 code/02.idf_basic/04/button_blink/dependencies.lock create mode 100644 code/02.idf_basic/04/button_blink/main/CMakeLists.txt create mode 100644 code/02.idf_basic/04/button_blink/main/blink_example_main.c create mode 100644 code/02.idf_basic/04/button_blink/main/idf_component.yml create mode 100644 code/02.idf_basic/04/button_blink/sdkconfig.defaults diff --git a/code/02.idf_basic/02/blink_menuconfig/main/Kconfig.projbuild b/code/02.idf_basic/02/blink_menuconfig/main/Kconfig.projbuild index 58dad49..46cbfc9 100644 --- a/code/02.idf_basic/02/blink_menuconfig/main/Kconfig.projbuild +++ b/code/02.idf_basic/02/blink_menuconfig/main/Kconfig.projbuild @@ -1,49 +1,20 @@ -menu "Example Configuration" - - orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps" +menu "点灯配置" choice BLINK_LED - prompt "Blink LED type" + prompt "LED模式" default BLINK_LED_GPIO - help - Select the LED type. A normal level controlled LED or an addressable LED strip. - The default selection is based on the Espressif DevKit boards. - You can change the default selection according to your board. - config BLINK_LED_GPIO bool "GPIO" config BLINK_LED_STRIP bool "LED strip" endchoice - choice BLINK_LED_STRIP_BACKEND - depends on BLINK_LED_STRIP - prompt "LED strip backend peripheral" - default BLINK_LED_STRIP_BACKEND_RMT if SOC_RMT_SUPPORTED - default BLINK_LED_STRIP_BACKEND_SPI - help - Select the backend peripheral to drive the LED strip. - - config BLINK_LED_STRIP_BACKEND_RMT - depends on SOC_RMT_SUPPORTED - bool "RMT" - config BLINK_LED_STRIP_BACKEND_SPI - bool "SPI" - endchoice - config BLINK_GPIO - int "Blink GPIO number" - range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX - default 8 - help - GPIO number (IOxx) to blink on and off the LED. - Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink. + int "LED引脚号" + default 2 config BLINK_PERIOD - int "Blink period in ms" - range 10 3600000 + int "LED周期" default 1000 - help - Define the blinking period in milliseconds. endmenu diff --git a/code/02.idf_basic/03/blink_component/CMakeLists.txt b/code/02.idf_basic/03/blink_component/CMakeLists.txt new file mode 100644 index 0000000..489742a --- /dev/null +++ b/code/02.idf_basic/03/blink_component/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following five lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(blink) diff --git a/code/02.idf_basic/03/blink_component/README.md b/code/02.idf_basic/03/blink_component/README.md new file mode 100644 index 0000000..8e6e412 --- /dev/null +++ b/code/02.idf_basic/03/blink_component/README.md @@ -0,0 +1,69 @@ +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | + +# Blink Example + +(See the README.md file in the upper level 'examples' directory for more information about examples.) + +This example demonstrates how to blink a LED by using the GPIO driver or using the [led_strip](https://components.espressif.com/component/espressif/led_strip) library if the LED is addressable e.g. [WS2812](https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf). The `led_strip` library is installed via [component manager](main/idf_component.yml). + +## How to Use Example + +Before project configuration and build, be sure to set the correct chip target using `idf.py set-target `. + +### Hardware Required + +* A development board with normal LED or addressable LED on-board (e.g., ESP32-S3-DevKitC, ESP32-C6-DevKitC etc.) +* A USB cable for Power supply and programming + +See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it. + +### Configure the Project + +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 + * Use `LED strip` for addressable LED +* If the LED type is `LED strip`, select the backend peripheral + * `RMT` is only available for ESP targets with RMT peripheral supported + * `SPI` is available for all ESP targets +* 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. + +(To exit the serial monitor, type ``Ctrl-]``.) + +See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects. + +## Example Output + +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 `led_strip_set_pixel(led_strip, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the [source file](main/blink_example_main.c). + +```text +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. + +## Troubleshooting + +* 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. diff --git a/code/02.idf_basic/03/blink_component/components/led_blink/CMakeLists.txt b/code/02.idf_basic/03/blink_component/components/led_blink/CMakeLists.txt new file mode 100644 index 0000000..d47879c --- /dev/null +++ b/code/02.idf_basic/03/blink_component/components/led_blink/CMakeLists.txt @@ -0,0 +1,4 @@ +idf_component_register(SRCS "led_blink.c" + INCLUDE_DIRS "include" + REQUIRES "driver" + ) diff --git a/code/02.idf_basic/03/blink_component/components/led_blink/Kconfig b/code/02.idf_basic/03/blink_component/components/led_blink/Kconfig new file mode 100644 index 0000000..46cbfc9 --- /dev/null +++ b/code/02.idf_basic/03/blink_component/components/led_blink/Kconfig @@ -0,0 +1,20 @@ +menu "点灯配置" + + choice BLINK_LED + prompt "LED模式" + default BLINK_LED_GPIO + config BLINK_LED_GPIO + bool "GPIO" + config BLINK_LED_STRIP + bool "LED strip" + endchoice + + config BLINK_GPIO + int "LED引脚号" + default 2 + + config BLINK_PERIOD + int "LED周期" + default 1000 + +endmenu diff --git a/code/02.idf_basic/03/blink_component/components/led_blink/include/led_blink.h b/code/02.idf_basic/03/blink_component/components/led_blink/include/led_blink.h new file mode 100644 index 0000000..c39e07d --- /dev/null +++ b/code/02.idf_basic/03/blink_component/components/led_blink/include/led_blink.h @@ -0,0 +1,19 @@ +#ifndef LED_BLINK_H +#define LED_BLINK_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + + // Function declarations + void blink_led(uint8_t s_led_state); + void configure_led(void); + +#ifdef __cplusplus +} +#endif + +#endif /* LED_BLINK_H */ diff --git a/code/02.idf_basic/03/blink_component/components/led_blink/led_blink.c b/code/02.idf_basic/03/blink_component/components/led_blink/led_blink.c new file mode 100644 index 0000000..c152e9e --- /dev/null +++ b/code/02.idf_basic/03/blink_component/components/led_blink/led_blink.c @@ -0,0 +1,24 @@ +#include +#include "led_blink.h" +#include "driver/gpio.h" +#include "esp_log.h" +#include "sdkconfig.h" + +static const char *TAG = "led_blink"; + +#define BLINK_GPIO CONFIG_BLINK_GPIO + +void blink_led(uint8_t s_led_state) +{ + /* Set the GPIO level according to the state (LOW or HIGH)*/ + gpio_set_level(BLINK_GPIO, s_led_state); +} + +void configure_led(void) +{ + ESP_LOGI(TAG, "Example configured to blink GPIO LED!"); + gpio_reset_pin(BLINK_GPIO); + /* Set the GPIO as a push/pull output */ + gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT); +} + diff --git a/code/02.idf_basic/03/blink_component/main/CMakeLists.txt b/code/02.idf_basic/03/blink_component/main/CMakeLists.txt new file mode 100644 index 0000000..8a9d914 --- /dev/null +++ b/code/02.idf_basic/03/blink_component/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "main.c" + INCLUDE_DIRS ".") diff --git a/code/02.idf_basic/03/blink_component/main/main.c b/code/02.idf_basic/03/blink_component/main/main.c new file mode 100644 index 0000000..359154d --- /dev/null +++ b/code/02.idf_basic/03/blink_component/main/main.c @@ -0,0 +1,26 @@ + +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_log.h" +#include "sdkconfig.h" +#include "led_blink.h" + +static const char *TAG = "example"; + +static uint8_t s_led_state = 0; + +void app_main(void) +{ + + /* Configure the peripheral according to the LED type */ + configure_led(); + + while (1) { + ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF"); + blink_led(s_led_state); + /* Toggle the LED state */ + s_led_state = !s_led_state; + vTaskDelay(CONFIG_BLINK_PERIOD / portTICK_PERIOD_MS); + } +} diff --git a/code/02.idf_basic/03/blink_component/sdkconfig.defaults b/code/02.idf_basic/03/blink_component/sdkconfig.defaults new file mode 100644 index 0000000..66e7f24 --- /dev/null +++ b/code/02.idf_basic/03/blink_component/sdkconfig.defaults @@ -0,0 +1,2 @@ +CONFIG_BLINK_LED_GPIO=y +CONFIG_BLINK_GPIO=8 diff --git a/code/02.idf_basic/04/button_blink/CMakeLists.txt b/code/02.idf_basic/04/button_blink/CMakeLists.txt new file mode 100644 index 0000000..489742a --- /dev/null +++ b/code/02.idf_basic/04/button_blink/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following five lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(blink) diff --git a/code/02.idf_basic/04/button_blink/README.md b/code/02.idf_basic/04/button_blink/README.md new file mode 100644 index 0000000..8e6e412 --- /dev/null +++ b/code/02.idf_basic/04/button_blink/README.md @@ -0,0 +1,69 @@ +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | + +# Blink Example + +(See the README.md file in the upper level 'examples' directory for more information about examples.) + +This example demonstrates how to blink a LED by using the GPIO driver or using the [led_strip](https://components.espressif.com/component/espressif/led_strip) library if the LED is addressable e.g. [WS2812](https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf). The `led_strip` library is installed via [component manager](main/idf_component.yml). + +## How to Use Example + +Before project configuration and build, be sure to set the correct chip target using `idf.py set-target `. + +### Hardware Required + +* A development board with normal LED or addressable LED on-board (e.g., ESP32-S3-DevKitC, ESP32-C6-DevKitC etc.) +* A USB cable for Power supply and programming + +See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it. + +### Configure the Project + +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 + * Use `LED strip` for addressable LED +* If the LED type is `LED strip`, select the backend peripheral + * `RMT` is only available for ESP targets with RMT peripheral supported + * `SPI` is available for all ESP targets +* 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. + +(To exit the serial monitor, type ``Ctrl-]``.) + +See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects. + +## Example Output + +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 `led_strip_set_pixel(led_strip, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the [source file](main/blink_example_main.c). + +```text +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. + +## Troubleshooting + +* 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. diff --git a/code/02.idf_basic/04/button_blink/components/led_blink/CMakeLists.txt b/code/02.idf_basic/04/button_blink/components/led_blink/CMakeLists.txt new file mode 100644 index 0000000..d47879c --- /dev/null +++ b/code/02.idf_basic/04/button_blink/components/led_blink/CMakeLists.txt @@ -0,0 +1,4 @@ +idf_component_register(SRCS "led_blink.c" + INCLUDE_DIRS "include" + REQUIRES "driver" + ) diff --git a/code/02.idf_basic/04/button_blink/components/led_blink/Kconfig b/code/02.idf_basic/04/button_blink/components/led_blink/Kconfig new file mode 100644 index 0000000..46cbfc9 --- /dev/null +++ b/code/02.idf_basic/04/button_blink/components/led_blink/Kconfig @@ -0,0 +1,20 @@ +menu "点灯配置" + + choice BLINK_LED + prompt "LED模式" + default BLINK_LED_GPIO + config BLINK_LED_GPIO + bool "GPIO" + config BLINK_LED_STRIP + bool "LED strip" + endchoice + + config BLINK_GPIO + int "LED引脚号" + default 2 + + config BLINK_PERIOD + int "LED周期" + default 1000 + +endmenu diff --git a/code/02.idf_basic/04/button_blink/components/led_blink/include/led_blink.h b/code/02.idf_basic/04/button_blink/components/led_blink/include/led_blink.h new file mode 100644 index 0000000..c39e07d --- /dev/null +++ b/code/02.idf_basic/04/button_blink/components/led_blink/include/led_blink.h @@ -0,0 +1,19 @@ +#ifndef LED_BLINK_H +#define LED_BLINK_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + + // Function declarations + void blink_led(uint8_t s_led_state); + void configure_led(void); + +#ifdef __cplusplus +} +#endif + +#endif /* LED_BLINK_H */ diff --git a/code/02.idf_basic/04/button_blink/components/led_blink/led_blink.c b/code/02.idf_basic/04/button_blink/components/led_blink/led_blink.c new file mode 100644 index 0000000..c152e9e --- /dev/null +++ b/code/02.idf_basic/04/button_blink/components/led_blink/led_blink.c @@ -0,0 +1,24 @@ +#include +#include "led_blink.h" +#include "driver/gpio.h" +#include "esp_log.h" +#include "sdkconfig.h" + +static const char *TAG = "led_blink"; + +#define BLINK_GPIO CONFIG_BLINK_GPIO + +void blink_led(uint8_t s_led_state) +{ + /* Set the GPIO level according to the state (LOW or HIGH)*/ + gpio_set_level(BLINK_GPIO, s_led_state); +} + +void configure_led(void) +{ + ESP_LOGI(TAG, "Example configured to blink GPIO LED!"); + gpio_reset_pin(BLINK_GPIO); + /* Set the GPIO as a push/pull output */ + gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT); +} + diff --git a/code/02.idf_basic/04/button_blink/dependencies.lock b/code/02.idf_basic/04/button_blink/dependencies.lock new file mode 100644 index 0000000..4221981 --- /dev/null +++ b/code/02.idf_basic/04/button_blink/dependencies.lock @@ -0,0 +1,35 @@ +dependencies: + espressif/button: + component_hash: 30a3f495c3862d505ce6e41adbbd218b2750e9723ab2151feff00e9fe685b326 + dependencies: + - name: espressif/cmake_utilities + registry_url: https://components.espressif.com + require: private + version: 0.* + - name: idf + require: private + version: '>=4.0' + source: + registry_url: https://components.espressif.com/ + type: service + version: 3.5.0 + espressif/cmake_utilities: + component_hash: 351350613ceafba240b761b4ea991e0f231ac7a9f59a9ee901f751bddc0bb18f + dependencies: + - name: idf + require: private + version: '>=4.1' + source: + registry_url: https://components.espressif.com + type: service + version: 0.5.3 + idf: + source: + type: idf + version: 5.3.2 +direct_dependencies: +- espressif/button +- idf +manifest_hash: cd5d587773467581aa0d8a2da30c23979f275d9a6c30c1b3b2ed2008bef56871 +target: esp32 +version: 2.0.0 diff --git a/code/02.idf_basic/04/button_blink/main/CMakeLists.txt b/code/02.idf_basic/04/button_blink/main/CMakeLists.txt new file mode 100644 index 0000000..a7f0bac --- /dev/null +++ b/code/02.idf_basic/04/button_blink/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "blink_example_main.c" + INCLUDE_DIRS ".") diff --git a/code/02.idf_basic/04/button_blink/main/blink_example_main.c b/code/02.idf_basic/04/button_blink/main/blink_example_main.c new file mode 100644 index 0000000..9072dd6 --- /dev/null +++ b/code/02.idf_basic/04/button_blink/main/blink_example_main.c @@ -0,0 +1,49 @@ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_log.h" +#include "sdkconfig.h" +#include "led_blink.h" +#include "iot_button.h" + +static const char *TAG = "example"; + +static uint8_t s_led_state = 0; + +static void button_single_click_cb(void *arg, void *usr_data) +{ + ESP_LOGI(TAG, "BUTTON_SINGLE_CLICK"); + + ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF"); + blink_led(s_led_state); + /* Toggle the LED state */ + s_led_state = !s_led_state; +} + +void app_main(void) +{ + // create gpio button + button_config_t gpio_btn_cfg = { + .type = BUTTON_TYPE_GPIO, + .long_press_time = CONFIG_BUTTON_LONG_PRESS_TIME_MS, + .short_press_time = CONFIG_BUTTON_SHORT_PRESS_TIME_MS, + .gpio_button_config = { + .gpio_num = 0, + .active_level = 0, + }, + }; + button_handle_t gpio_btn = iot_button_create(&gpio_btn_cfg); + if (NULL == gpio_btn) + { + ESP_LOGE(TAG, "Button create failed"); + } + + /* Configure the peripheral according to the LED type */ + configure_led(); + + iot_button_register_cb(gpio_btn, BUTTON_SINGLE_CLICK, button_single_click_cb, NULL); + + while (1) { + vTaskDelay(CONFIG_BLINK_PERIOD / portTICK_PERIOD_MS); + } +} diff --git a/code/02.idf_basic/04/button_blink/main/idf_component.yml b/code/02.idf_basic/04/button_blink/main/idf_component.yml new file mode 100644 index 0000000..45aceb1 --- /dev/null +++ b/code/02.idf_basic/04/button_blink/main/idf_component.yml @@ -0,0 +1,17 @@ +## IDF Component Manager Manifest File +dependencies: + ## Required IDF version + idf: + version: '>=4.1.0' + # # Put list of dependencies here + # # For components maintained by Espressif: + # component: "~1.0.0" + # # For 3rd party components: + # username/component: ">=1.0.0,<2.0.0" + # username2/component2: + # version: "~1.0.0" + # # For transient dependencies `public` flag can be set. + # # `public` flag doesn't have an effect dependencies of the `main` component. + # # All dependencies of `main` are public by default. + # public: true + espressif/button: '*' diff --git a/code/02.idf_basic/04/button_blink/sdkconfig.defaults b/code/02.idf_basic/04/button_blink/sdkconfig.defaults new file mode 100644 index 0000000..66e7f24 --- /dev/null +++ b/code/02.idf_basic/04/button_blink/sdkconfig.defaults @@ -0,0 +1,2 @@ +CONFIG_BLINK_LED_GPIO=y +CONFIG_BLINK_GPIO=8