From 15a43f87610f1ea6db0250ce976a126bd036d3a4 Mon Sep 17 00:00:00 2001 From: InfiniteYuan1 Date: Wed, 14 Nov 2018 18:55:30 +0800 Subject: [PATCH] update components/platforms/alink/component.mk components/spi_devices/epaper/epaper.c components/spi_devices/xpt2046/include/iot_xpt2046.h examples/hmi/lvgl_coffee/main/app_main.cpp examples/smart_device/ examples/touch_pad_evb/Makefile add CMakeList.txt of components add CMake build for example(aws_iot_demo,check_pedestrian_flow,empty_project,esp32_azure_iot_kit,eth2wifi,hmi,lowpower_evb,oled_screen_module,touch_pad_evb) add cmake support for ulp co-processor add CMake build CI update lvgl ugfx CMake update example README.md update solution README.md add CMakeLists.txt for unit-test-app update .gitlab-ci.yml --- .gitlab-ci.yml | 22 +- CMakeLists.txt | 8 + README.md | 232 +++++++++++++++++- components/CMakeLists.txt | 19 ++ components/__config/CMakeLists.txt | 2 + components/features/dac_audio/CMakeLists.txt | 19 ++ components/features/infrared/CMakeLists.txt | 19 ++ components/features/touchpad/CMakeLists.txt | 41 ++++ .../features/ulp_monitor/CMakeLists.txt | 22 ++ .../lowpower_framework/CMakeLists.txt | 19 ++ components/general/adc/CMakeLists.txt | 24 ++ components/general/base_class/CMakeLists.txt | 6 + components/general/button/CMakeLists.txt | 21 ++ .../general/button/button/CMakeLists.txt | 7 + components/general/debugs/CMakeLists.txt | 19 ++ components/general/led/CMakeLists.txt | 24 ++ .../general/led/status_led/CMakeLists.txt | 7 + components/general/light/CMakeLists.txt | 24 ++ components/general/ota/CMakeLists.txt | 22 ++ components/general/param/CMakeLists.txt | 22 ++ components/general/power_meter/CMakeLists.txt | 21 ++ .../power_meter/power_meter/CMakeLists.txt | 7 + components/general/relay/CMakeLists.txt | 24 ++ components/general/relay/relay/CMakeLists.txt | 11 + .../general/weekly_timer/CMakeLists.txt | 19 ++ components/hmi/gdrivers/CMakeLists.txt | 207 ++++++++++++++++ components/hmi/lvgl_gui/CMakeLists.txt | 146 +++++++++++ components/hmi/ugfx_gui/CMakeLists.txt | 62 +++++ components/i2c_devices/i2c_bus/CMakeLists.txt | 7 + .../i2c_devices/others/at24c02/CMakeLists.txt | 22 ++ .../i2c_devices/others/ch450/CMakeLists.txt | 20 ++ .../i2c_devices/others/ht16c21/CMakeLists.txt | 20 ++ .../others/is31fl3xxx/CMakeLists.txt | 28 +++ .../others/mcp23017/CMakeLists.txt | 24 ++ .../i2c_devices/others/ssd1306/CMakeLists.txt | 26 ++ .../sensor/apds9960/CMakeLists.txt | 24 ++ .../i2c_devices/sensor/bh1750/CMakeLists.txt | 24 ++ .../i2c_devices/sensor/bme280/CMakeLists.txt | 24 ++ .../i2c_devices/sensor/ft5x06/CMakeLists.txt | 22 ++ .../i2c_devices/sensor/hdc2010/CMakeLists.txt | 24 ++ .../i2c_devices/sensor/hts221/CMakeLists.txt | 24 ++ .../sensor/lis2dh12/CMakeLists.txt | 24 ++ .../i2c_devices/sensor/mpu6050/CMakeLists.txt | 22 ++ .../sensor/mvh3004d/CMakeLists.txt | 24 ++ .../sensor/veml6040/CMakeLists.txt | 24 ++ components/i2s_devices/ili9806/CMakeLists.txt | 22 ++ .../i2s_devices/lcd_common/CMakeLists.txt | 7 + components/i2s_devices/nt35510/CMakeLists.txt | 22 ++ .../motor/servo/servo_motor/CMakeLists.txt | 20 ++ components/motor/stepper/a4988/CMakeLists.txt | 20 ++ components/network/mqtt/CMakeLists.txt | 36 +++ components/network/tcp/CMakeLists.txt | 20 ++ components/network/udp/CMakeLists.txt | 20 ++ components/platforms/alink/CMakeLists.txt | 53 ++++ components/platforms/alink/component.mk | 2 +- components/spi_devices/epaper/CMakeLists.txt | 19 ++ components/spi_devices/epaper/epaper.c | 2 - components/spi_devices/lcd/CMakeLists.txt | 44 ++++ components/spi_devices/xpt2046/CMakeLists.txt | 19 ++ .../spi_devices/xpt2046/include/iot_xpt2046.h | 1 - components/wifi/iot_blufi/CMakeLists.txt | 17 ++ components/wifi/iot_espnow/CMakeLists.txt | 17 ++ components/wifi/smart_config/CMakeLists.txt | 17 ++ components/wifi/wifi_conn/CMakeLists.txt | 22 ++ examples/aws_iot_demo/CMakeLists.txt | 18 ++ examples/aws_iot_demo/README.md | 6 +- examples/aws_iot_demo/main/CMakeLists.txt | 32 +++ .../aws_iot_demo/main/certs/aws-root-ca.pem | 28 +++ examples/check_pedestrian_flow/CMakeLists.txt | 18 ++ .../check_pedestrian_flow/main/CMakeLists.txt | 6 + examples/check_pedestrian_flow/readme_cn.md | 5 + examples/check_pedestrian_flow/readme_en.md | 5 + examples/empty_project/CMakeLists.txt | 18 ++ .../components/example1/CMakeLists.txt | 6 + .../components/example2/CMakeLists.txt | 5 + examples/empty_project/main/CMakeLists.txt | 6 + examples/esp32_azure_iot_kit/CMakeLists.txt | 18 ++ .../esp32_azure_iot_kit/main/CMakeLists.txt | 6 + examples/eth2wifi/CMakeLists.txt | 18 ++ examples/eth2wifi/README.md | 2 +- examples/eth2wifi/main/CMakeLists.txt | 6 + examples/hmi/lvgl_coffee/CMakeLists.txt | 18 ++ examples/hmi/lvgl_coffee/lvgl_coffee_cn.md | 6 +- examples/hmi/lvgl_coffee/lvgl_coffee_en.md | 6 +- examples/hmi/lvgl_coffee/main/CMakeLists.txt | 9 + examples/hmi/lvgl_coffee/main/app_main.cpp | 4 +- examples/hmi/lvgl_example/CMakeLists.txt | 18 ++ examples/hmi/lvgl_example/lvgl_example_cn.md | 6 +- examples/hmi/lvgl_example/lvgl_example_en.md | 6 +- examples/hmi/lvgl_example/main/CMakeLists.txt | 7 + examples/hmi/lvgl_thermostat/CMakeLists.txt | 18 ++ .../hmi/lvgl_thermostat/lvgl_thermostat_cn.md | 6 +- .../hmi/lvgl_thermostat/lvgl_thermostat_en.md | 6 +- .../hmi/lvgl_thermostat/main/CMakeLists.txt | 9 + examples/hmi/lvgl_wificonfig/CMakeLists.txt | 18 ++ .../hmi/lvgl_wificonfig/lvgl_wificonfig_cn.md | 6 +- .../hmi/lvgl_wificonfig/lvgl_wificonfig_en.md | 6 +- .../hmi/lvgl_wificonfig/main/CMakeLists.txt | 7 + examples/hmi/mp3_example/CMakeLists.txt | 27 ++ examples/hmi/mp3_example/main/CMakeLists.txt | 6 + examples/hmi/mp3_example/mp3_example_cn.md | 10 +- examples/hmi/mp3_example/mp3_example_en.md | 10 +- examples/hmi/ugfx_bubbles/CMakeLists.txt | 18 ++ examples/hmi/ugfx_bubbles/main/CMakeLists.txt | 7 + examples/hmi/ugfx_bubbles/ugfx_bubbles_cn.md | 6 +- examples/hmi/ugfx_bubbles/ugfx_bubbles_en.md | 6 +- examples/hmi/ugfx_example/CMakeLists.txt | 18 ++ examples/hmi/ugfx_example/main/CMakeLists.txt | 7 + examples/hmi/ugfx_example/ugfx_example_cn.md | 6 +- examples/hmi/ugfx_example/ugfx_example_en.md | 6 +- examples/hmi/ugfx_justget/CMakeLists.txt | 18 ++ examples/hmi/ugfx_justget/main/CMakeLists.txt | 8 + examples/hmi/ugfx_justget/ugfx_justget_cn.md | 6 +- examples/hmi/ugfx_justget/ugfx_justget_en.md | 6 +- examples/hmi/ugfx_keyboard/CMakeLists.txt | 18 ++ .../hmi/ugfx_keyboard/main/CMakeLists.txt | 8 + .../hmi/ugfx_keyboard/ugfx_keyboard_cn.md | 6 +- .../hmi/ugfx_keyboard/ugfx_keyboard_en.md | 6 +- examples/hmi/ugfx_minesweeper/CMakeLists.txt | 18 ++ .../hmi/ugfx_minesweeper/main/CMakeLists.txt | 7 + .../ugfx_minesweeper/ugfx_minesweeper_cn.md | 6 +- .../ugfx_minesweeper/ugfx_minesweeper_en.md | 6 +- examples/hmi/ugfx_sokoban/CMakeLists.txt | 18 ++ examples/hmi/ugfx_sokoban/main/CMakeLists.txt | 8 + examples/hmi/ugfx_sokoban/ugfx_sokoban_cn.md | 6 +- examples/hmi/ugfx_sokoban/ugfx_sokoban_en.md | 6 +- examples/lowpower_evb/CMakeLists.txt | 18 ++ .../lowpower_evb_callback/CMakeLists.txt | 8 + .../lowpower_evb_peripherals/CMakeLists.txt | 12 + .../lowpower_evb_ulp/CMakeLists.txt | 33 +++ .../lowpower_evb_ulp/lowpower_evb_ulp_opt.cpp | 6 +- .../lowpower_evb_wifi/CMakeLists.txt | 8 + examples/lowpower_evb/main/CMakeLists.txt | 6 + examples/oled_screen_module/CMakeLists.txt | 18 ++ .../oled_screen_module/main/CMakeLists.txt | 10 + examples/oled_screen_module/readme_cn.md | 13 + examples/oled_screen_module/readme_en.md | 13 + .../alink_smart_device_demo/CMakeLists.txt | 18 ++ .../alink_smart_device_demo/Makefile | 4 +- .../components/abstract/CMakeLists.txt | 12 + .../{ => components}/abstract/cloud/cloud.c | 0 .../abstract/cloud/component.mk | 0 .../abstract/cloud/include/cloud.h | 0 .../{ => components}/abstract/component.mk | 0 .../abstract/device/component.mk | 0 .../{ => components}/abstract/device/device.c | 0 .../abstract/device/include/device.h | 0 .../abstract/parse/component.mk | 0 .../abstract/parse/include/parse.h | 0 .../{ => components}/abstract/parse/parse.c | 0 .../components/products/CMakeLists.txt | 10 + .../products}/component.mk | 2 + .../products/light_device}/component.mk | 0 .../light_device/include/light_config.h | 0 .../light_device/include/light_device.h | 0 .../products/light_device/light_device.c | 0 .../products/plug_device}/component.mk | 0 .../plug_device/include/plug_config.h | 0 .../plug_device/include/plug_device.h | 0 .../products/plug_device/plug_device.c | 0 .../main/CMakeLists.txt | 9 + .../alink_smart_device_demo/readme_cn.md | 2 +- .../alink_smart_device_demo/readme_en.md | 2 +- examples/touch_pad_evb/CMakeLists.txt | 20 ++ examples/touch_pad_evb/Makefile | 2 +- examples/touch_pad_evb/main/CMakeLists.txt | 17 ++ examples/ulp_examples/ulp_adc/CMakeLists.txt | 18 ++ .../ulp_examples/ulp_adc/main/CMakeLists.txt | 29 +++ .../ulp_detect_brownout/CMakeLists.txt | 18 ++ .../ulp_detect_brownout/main/CMakeLists.txt | 29 +++ .../ulp_hall_sensor/CMakeLists.txt | 18 ++ .../ulp_hall_sensor/main/CMakeLists.txt | 29 +++ .../ulp_examples/ulp_hall_sensor/readme_cn.md | 6 + .../ulp_examples/ulp_hall_sensor/readme_en.md | 6 + .../ulp_i2c_bitbang/CMakeLists.txt | 18 ++ .../ulp_i2c_bitbang/main/CMakeLists.txt | 31 +++ .../ulp_examples/ulp_i2c_bitbang/readme_cn.md | 6 + .../ulp_examples/ulp_rtc_gpio/CMakeLists.txt | 18 ++ examples/ulp_examples/ulp_rtc_gpio/README.md | 2 +- .../ulp_rtc_gpio/main/CMakeLists.txt | 29 +++ .../ulp_send_interrupt/CMakeLists.txt | 18 +- .../ulp_send_interrupt/main/CMakeLists.txt | 9 +- examples/ulp_examples/ulp_spi/CMakeLists.txt | 18 ++ .../ulp_examples/ulp_spi/main/CMakeLists.txt | 31 +++ .../ulp_examples/ulp_tsens/CMakeLists.txt | 18 ++ examples/ulp_examples/ulp_tsens/README.md | 6 + .../ulp_tsens/main/CMakeLists.txt | 29 +++ .../ulp_watering_device/CMakeLists.txt | 18 ++ .../ulp_watering_device/main/CMakeLists.txt | 29 +++ .../ulp_watering_device/readme_cn.md | 2 +- .../ulp_watering_device/readme_en.md | 2 +- tools/unit-test-app/CMakeLists.txt | 18 ++ 192 files changed, 3054 insertions(+), 120 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 components/CMakeLists.txt create mode 100644 components/__config/CMakeLists.txt create mode 100644 components/features/dac_audio/CMakeLists.txt create mode 100644 components/features/infrared/CMakeLists.txt create mode 100644 components/features/touchpad/CMakeLists.txt create mode 100644 components/features/ulp_monitor/CMakeLists.txt create mode 100644 components/framework/lowpower_framework/CMakeLists.txt create mode 100644 components/general/adc/CMakeLists.txt create mode 100644 components/general/base_class/CMakeLists.txt create mode 100644 components/general/button/CMakeLists.txt create mode 100644 components/general/button/button/CMakeLists.txt create mode 100644 components/general/debugs/CMakeLists.txt create mode 100644 components/general/led/CMakeLists.txt create mode 100644 components/general/led/status_led/CMakeLists.txt create mode 100644 components/general/light/CMakeLists.txt create mode 100644 components/general/ota/CMakeLists.txt create mode 100644 components/general/param/CMakeLists.txt create mode 100644 components/general/power_meter/CMakeLists.txt create mode 100644 components/general/power_meter/power_meter/CMakeLists.txt create mode 100644 components/general/relay/CMakeLists.txt create mode 100644 components/general/relay/relay/CMakeLists.txt create mode 100644 components/general/weekly_timer/CMakeLists.txt create mode 100644 components/hmi/gdrivers/CMakeLists.txt create mode 100644 components/hmi/lvgl_gui/CMakeLists.txt create mode 100644 components/hmi/ugfx_gui/CMakeLists.txt create mode 100644 components/i2c_devices/i2c_bus/CMakeLists.txt create mode 100644 components/i2c_devices/others/at24c02/CMakeLists.txt create mode 100644 components/i2c_devices/others/ch450/CMakeLists.txt create mode 100644 components/i2c_devices/others/ht16c21/CMakeLists.txt create mode 100644 components/i2c_devices/others/is31fl3xxx/CMakeLists.txt create mode 100644 components/i2c_devices/others/mcp23017/CMakeLists.txt create mode 100644 components/i2c_devices/others/ssd1306/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/apds9960/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/bh1750/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/bme280/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/ft5x06/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/hdc2010/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/hts221/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/lis2dh12/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/mpu6050/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/mvh3004d/CMakeLists.txt create mode 100644 components/i2c_devices/sensor/veml6040/CMakeLists.txt create mode 100644 components/i2s_devices/ili9806/CMakeLists.txt create mode 100644 components/i2s_devices/lcd_common/CMakeLists.txt create mode 100644 components/i2s_devices/nt35510/CMakeLists.txt create mode 100644 components/motor/servo/servo_motor/CMakeLists.txt create mode 100644 components/motor/stepper/a4988/CMakeLists.txt create mode 100644 components/network/mqtt/CMakeLists.txt create mode 100644 components/network/tcp/CMakeLists.txt create mode 100644 components/network/udp/CMakeLists.txt create mode 100644 components/platforms/alink/CMakeLists.txt create mode 100644 components/spi_devices/epaper/CMakeLists.txt create mode 100644 components/spi_devices/lcd/CMakeLists.txt create mode 100644 components/spi_devices/xpt2046/CMakeLists.txt create mode 100644 components/wifi/iot_blufi/CMakeLists.txt create mode 100644 components/wifi/iot_espnow/CMakeLists.txt create mode 100644 components/wifi/smart_config/CMakeLists.txt create mode 100644 components/wifi/wifi_conn/CMakeLists.txt create mode 100644 examples/aws_iot_demo/CMakeLists.txt create mode 100644 examples/aws_iot_demo/main/CMakeLists.txt create mode 100644 examples/aws_iot_demo/main/certs/aws-root-ca.pem create mode 100644 examples/check_pedestrian_flow/CMakeLists.txt create mode 100644 examples/check_pedestrian_flow/main/CMakeLists.txt create mode 100644 examples/empty_project/CMakeLists.txt create mode 100644 examples/empty_project/components/example1/CMakeLists.txt create mode 100644 examples/empty_project/components/example2/CMakeLists.txt create mode 100644 examples/empty_project/main/CMakeLists.txt create mode 100644 examples/esp32_azure_iot_kit/CMakeLists.txt create mode 100644 examples/esp32_azure_iot_kit/main/CMakeLists.txt create mode 100644 examples/eth2wifi/CMakeLists.txt create mode 100644 examples/eth2wifi/main/CMakeLists.txt create mode 100644 examples/hmi/lvgl_coffee/CMakeLists.txt create mode 100644 examples/hmi/lvgl_coffee/main/CMakeLists.txt create mode 100644 examples/hmi/lvgl_example/CMakeLists.txt create mode 100644 examples/hmi/lvgl_example/main/CMakeLists.txt create mode 100644 examples/hmi/lvgl_thermostat/CMakeLists.txt create mode 100644 examples/hmi/lvgl_thermostat/main/CMakeLists.txt create mode 100644 examples/hmi/lvgl_wificonfig/CMakeLists.txt create mode 100644 examples/hmi/lvgl_wificonfig/main/CMakeLists.txt create mode 100644 examples/hmi/mp3_example/CMakeLists.txt create mode 100644 examples/hmi/mp3_example/main/CMakeLists.txt create mode 100644 examples/hmi/ugfx_bubbles/CMakeLists.txt create mode 100644 examples/hmi/ugfx_bubbles/main/CMakeLists.txt create mode 100644 examples/hmi/ugfx_example/CMakeLists.txt create mode 100644 examples/hmi/ugfx_example/main/CMakeLists.txt create mode 100644 examples/hmi/ugfx_justget/CMakeLists.txt create mode 100644 examples/hmi/ugfx_justget/main/CMakeLists.txt create mode 100644 examples/hmi/ugfx_keyboard/CMakeLists.txt create mode 100644 examples/hmi/ugfx_keyboard/main/CMakeLists.txt create mode 100644 examples/hmi/ugfx_minesweeper/CMakeLists.txt create mode 100644 examples/hmi/ugfx_minesweeper/main/CMakeLists.txt create mode 100644 examples/hmi/ugfx_sokoban/CMakeLists.txt create mode 100644 examples/hmi/ugfx_sokoban/main/CMakeLists.txt create mode 100644 examples/lowpower_evb/CMakeLists.txt create mode 100644 examples/lowpower_evb/components/lowpower_evb_callback/CMakeLists.txt create mode 100644 examples/lowpower_evb/components/lowpower_evb_peripherals/CMakeLists.txt create mode 100644 examples/lowpower_evb/components/lowpower_evb_ulp/CMakeLists.txt create mode 100644 examples/lowpower_evb/components/lowpower_evb_wifi/CMakeLists.txt create mode 100644 examples/lowpower_evb/main/CMakeLists.txt create mode 100644 examples/oled_screen_module/CMakeLists.txt create mode 100644 examples/oled_screen_module/main/CMakeLists.txt create mode 100644 examples/smart_device/alink_smart_device_demo/CMakeLists.txt create mode 100644 examples/smart_device/alink_smart_device_demo/components/abstract/CMakeLists.txt rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/cloud/cloud.c (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/cloud/component.mk (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/cloud/include/cloud.h (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/component.mk (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/device/component.mk (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/device/device.c (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/device/include/device.h (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/parse/component.mk (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/parse/include/parse.h (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/abstract/parse/parse.c (100%) create mode 100644 examples/smart_device/alink_smart_device_demo/components/products/CMakeLists.txt rename examples/smart_device/alink_smart_device_demo/{products/plug_device => components/products}/component.mk (54%) rename examples/smart_device/alink_smart_device_demo/{products => components/products/light_device}/component.mk (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/products/light_device/include/light_config.h (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/products/light_device/include/light_device.h (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/products/light_device/light_device.c (100%) rename examples/smart_device/alink_smart_device_demo/{products/light_device => components/products/plug_device}/component.mk (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/products/plug_device/include/plug_config.h (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/products/plug_device/include/plug_device.h (100%) rename examples/smart_device/alink_smart_device_demo/{ => components}/products/plug_device/plug_device.c (100%) create mode 100644 examples/smart_device/alink_smart_device_demo/main/CMakeLists.txt create mode 100644 examples/touch_pad_evb/CMakeLists.txt create mode 100644 examples/touch_pad_evb/main/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_adc/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_adc/main/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_detect_brownout/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_detect_brownout/main/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_hall_sensor/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_hall_sensor/main/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_i2c_bitbang/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_i2c_bitbang/main/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_rtc_gpio/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_rtc_gpio/main/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_spi/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_spi/main/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_tsens/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_tsens/main/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_watering_device/CMakeLists.txt create mode 100644 examples/ulp_examples/ulp_watering_device/main/CMakeLists.txt create mode 100644 tools/unit-test-app/CMakeLists.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9be706182..00021e7fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,18 @@ - stages: - build before_script: - export PATH="/opt/xtensa-esp32-elf/bin:$PATH" - export PATH="/opt/esp32ulp-elf-binutils/bin:$PATH" + - export PATH="$CI_PROJECT_DIR/submodule/esp-idf/tools:$PATH" + - python -m pip install --user -r $IDF_PATH/requirements.txt - mkdir -p ~/.ssh - chmod 700 ~/.ssh - echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64 - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - - git submodule update --init --recursive + - git submodule update -f --init --recursive variables: IDF_PATH: "$CI_PROJECT_DIR/submodule/esp-idf" @@ -25,30 +26,30 @@ build: script: - cd examples/check_pedestrian_flow - make defconfig - - make -j8 + - idf.py build - cd ../eth2wifi - make defconfig - - make -j8 + - idf.py build - cd ../oled_screen_module - make defconfig - - make -j8 + - idf.py build - cd ../smart_device/alink_smart_device_demo - make defconfig - - make -j8 + - idf.py build - cd .. - cd ../empty_project - make defconfig - - make -j8 + - idf.py build - cd ../hmi/ugfx_example - make defconfig - - make -j8 + - idf.py build - cd ../lvgl_example - make defconfig - - make -j8 + - idf.py build - cd ../ - cd ../touch_pad_evb - make defconfig - - make -j8 + - idf.py build - cd ../ulp_examples/ulp_watering_device - make defconfig - make -j8 @@ -68,3 +69,4 @@ build: - make defconfig - make IOT_TEST_ALL=1 -j8 + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..c510bffe2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,8 @@ +# The following 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.5) + +# Overwrite the IDF_PATH to the esp-idf path in submodule. +set(ENV{IDF_PATH} "$ENV{IOT_SOLUTION_PATH}/submodule/esp-idf/") + +include($ENV{IOT_SOLUTION_PATH}/components/CMakeLists.txt) \ No newline at end of file diff --git a/README.md b/README.md index b66642296..56345586f 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ --- -##

Preparation

+##

Preparation(Make)

* To clone this repository by @@ -215,12 +215,42 @@ * You can refer to the Makefile in example if you want to build your own application. * To run the example project, please refer to: - * [example](#example) - * [unit-test](#unit-test) + * [example](#example-make) + * [unit-test](#unit-test-make) --- -## Build system and dependency +##

Preparation(CMake)

+ +* Add to PATH the path to the tools directory inside the IDF_PATH directory.[Add IDF_PATH & idf.py PATH to User Profile(CMake)](https://docs.espressif.com/projects/esp-idf/en/latest/get-started-cmake/add-idf_path-to-profile.html) +* To clone this repository by + + ``` + git clone --recursive https://github.com/espressif/esp-iot-solution + ``` + +* To initialize the submodules + + ``` + git submodule update --init --recursive + ``` + +* Set IOT_SOLUTION_PATH, for example: + + ``` + export IOT_SOLUTION_PATH=~/esp/esp-iot-solution + ``` + +* esp-iot-solution project will over `write` the `IDF_PATH` to the submodule in makefile by default +* You can refer to the Makefile in example if you want to build your own application. +* To run the example project, please refer to: + + * [example](#example-cmake) + * [unit-test](#unit-test-cmake) + +--- + +## Build system and dependency (Make) * We can regard IoT solution project as a platform that contains different device drivers and features * `Add-on project`: If you want to use those drivers and build your project base on the framework, you need to include the IoT components into your project. @@ -263,6 +293,75 @@ --- +## Build system and dependency (CMake) + +* We can regard IoT solution project as a platform that contains different device drivers and features +* `Add-on project`: If you want to use those drivers and build your project base on the framework, you need to include the IoT components into your project. + + ``` + # The following 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.5) + + #If IOT_SOLUTION_PATH is not defined, use relative path as default value + set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") + if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) + endif() + file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) + set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + + include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) + + project(empty-project) + ``` + + As we can see, in the Makefile of your project, you need to include the Makefile under $(IOT_SOLUTION_PATH) directory so that the build system can involve all the components and drivers you need. + + `Note: In this way, the build system will replace the IDF_PATH with the directory of idf repository in submodule during the build process.` + + If you don't want the replacement to happen(which means to use the ESP_IDF value from your system environment), you can modify as the following Makefile does: + + ``` + # The following 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.5) + + #If IOT_SOLUTION_PATH is not defined, use relative path as default value + set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") + if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) + endif() + file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) + set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + + include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) + + project(empty-project) + ``` + +* `Stand-alone component`: if you just want to pick one of the component and put it into your existing project, you just need to copy the single component to your project components directory. But you can also append the component list in your project Makefile like this: + + ``` + set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} ${IOT_SOLUTION_PATH}/components/the_one_you_want_to_use") + ``` + +* `Components control`: Usually we don't need all the device drivers to be compiled into our project, we can choose the necessary ones in menuconfig: + + ``` + idf.py menuconfig --> IoT Solution settings --> IoT Components Management + ``` + + Those components that are not enabled, will not be compiled into the project, which alos means, you need to enable the components you would like to use. + +--- + ## Framework * `components` @@ -287,14 +386,17 @@ ├── components ├── documents ├── examples + │ └── aws_iot_demo │ └── check_pedestrian_flow │ └── empty_project + │ └── esp32_azure_iot_kit │ └── eth2wifi + │ └── hmi + │ └── lowpower_evb │ └── oled_screen_module │ └── smart_device │ └── touch_pad_evb - │ └── ulp_rtc_gpio - │ └── ulp_watering_device + │ └── ulp_examples ├── submodule │ └── esp-idf └── tools @@ -303,7 +405,7 @@ --- -## Usage +## Usage (Make) * This code is based on esp-idf project. * This repository contains esp-idf code as submodule. @@ -326,7 +428,30 @@ Exit miniterm by typing Ctrl-]. --- -##

Unit-test

+## Usage (CMake) + +* This code is based on esp-idf project. +* This repository contains esp-idf code as submodule. +* To clone this repository by **git clone --recurisve https://github.com/espressif/esp-iot-solution.git** +* Change to the directory of examples (such as examples/smart_device) in esp-iot-solution, run `idf.py menuconfig` to configure the project. +* Compiling the Project by `idf.py build` + + > ... will compile app, bootloader and generate a partition table based on the config. + +* Flashing the Project +* Flash the binaries by `idf.py flash` + + > This will flash the entire project (app, bootloader and partition table) to a new chip. The settings for serial port flashing can be configured with `idf.py menuconfig`. + > You don't need to run `idf.py all` before running `idf.py flash`, `idf.py flash` will automatically rebuild anything which needs it. + +* Viewing Serial Output by `idf.py monitor` target will use the already-installed [miniterm](http://pyserial.readthedocs.io/en/latest/tools.html#module-serial.tools.miniterm) (a part of pyserial) to display serial output from the ESP32 on the terminal console. +Exit miniterm by typing Ctrl-]. +* To flash and monitor output in one pass, you can run: `idf.py flash monitor` +* You can use unit-test in esp-iot-solution to test all the components. + +--- + +##

Unit-test (Make)

[back to top](#preparation) @@ -370,7 +495,51 @@ Exit miniterm by typing Ctrl-]. --- -##

Example

+##

Unit-test (CMake)

+ +[back to top](#preparation) + +### To use uint-test, follow these steps: + +* Change to the directory of unit-test-app + + ``` + cd YOUR_IOT_SOLUTION_PATH/tools/unit-test-app + ``` + +* Use the default sdkconfig and compile unit-test-app by `make IOT_TEST_ALL=1 -j8` + + ``` + make defconfig + make IOT_TEST_ALL=1 + ``` + +* Flash the images by `make flash` + + ``` + make IOT_TEST_ALL=1 flash + ``` + +* Reset the chip and see the uart log using an uart tool such as minicom +* All kinds of components will be shown by uart + + ``` + Here's the test menu, pick your combo: + (1) "Sensor BH1750 test" [bh1750][iot][sensor] + (2) "Button test" [button][iot] + (3) "Button cpp test" [button_cpp][iot] + (4) "Dac audio test" [dac_audio][iot][audio] + (5) "Debug cmd test" [debug][iot] + (6) "Deep sleep gpio test" [deep_sleep][rtc_gpio][current][iot] + (7) "Deep sleep touch test" [deep_sleep][touch][current][iot] + ...... + ``` + +* You need to send the index of the unit you want to test by uart. Test code of the unit you select will be run + +--- + +##

Example (Make)

[back to top](#preparation) @@ -394,12 +563,51 @@ Exit miniterm by typing Ctrl-]. --- -##

Empty project

+##

Example (CMake)

+ +[back to top](#preparation) + +### To run the Examples projects, follow the steps below: + +* Change the directory to example +* choose one example project you want to run, we take smart_device here. +* Change the directory to the example project under example directory, take smart_device example as example here: + + ``` + cd YOUR_IOT_SOLUTION_PATH/example/smart_device/alink_smart_device_demo + ``` + +* Run `idf.py menuconfig` to set the project parameters in + + ``` + idf.py menuconfig --> IoT Example - smart_device + ``` + +* Run `idf.py` to compile the project, or `idf.py flash` to compile and flash the module. + +--- + +##

Empty project (Make)

+ +[back to top](#preparation) + +* You can start your own appliction code base on the empty_project. +* By default, you just need to run `make` under the example/empty_project directory. The makefile will set all the path by default. +* Meanwhile, you can copy the example project to anywhere you want, in this case, you will have to set the `IOT_SOLUTION_PATH` so that the build system shall know where to find the code and link the files. +* Set iot path:(replace 'YOUR_PATH' below), you can also add `IOT_SOLUTION_PATH ` to your environment PATH + + ``` + export IOT_SOLUTION_PATH = "YOUR_PATH/esp-iot-solution" + ``` + +--- + +##

Empty project (CMake)

[back to top](#preparation) -* You can start your own appliction code base on the empty-project. -* By default, you just need to run `make` under the example/smart_device directory. The makefile will set all the path by default. +* You can start your own appliction code base on the empty_project. +* By default, you just need to run `idf.py build` under the example/empty_project directory. The makefile will set all the path by default. * Meanwhile, you can copy the example project to anywhere you want, in this case, you will have to set the `IOT_SOLUTION_PATH` so that the build system shall know where to find the code and link the files. * Set iot path:(replace 'YOUR_PATH' below), you can also add `IOT_SOLUTION_PATH ` to your environment PATH diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt new file mode 100644 index 000000000..928799624 --- /dev/null +++ b/components/CMakeLists.txt @@ -0,0 +1,19 @@ + +set(IOT_COMPONENT_DIRS ${IOT_COMPONENT_DIRS} + $ENV{IOT_SOLUTION_PATH}/components + $ENV{IOT_SOLUTION_PATH}/components/features + $ENV{IOT_SOLUTION_PATH}/components/general + $ENV{IOT_SOLUTION_PATH}/components/wifi + $ENV{IOT_SOLUTION_PATH}/components/spi_devices + $ENV{IOT_SOLUTION_PATH}/components/i2c_devices + $ENV{IOT_SOLUTION_PATH}/components/i2c_devices/sensor + $ENV{IOT_SOLUTION_PATH}/components/i2c_devices/others + $ENV{IOT_SOLUTION_PATH}/components/network + $ENV{IOT_SOLUTION_PATH}/components/platforms + $ENV{IOT_SOLUTION_PATH}/components/motor/stepper + $ENV{IOT_SOLUTION_PATH}/components/motor/servo + $ENV{IOT_SOLUTION_PATH}/components/framework + $ENV{IOT_SOLUTION_PATH}/components/i2s_devices + $ENV{IOT_SOLUTION_PATH}/components/hmi ) + +set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} ${IOT_COMPONENT_DIRS}") diff --git a/components/__config/CMakeLists.txt b/components/__config/CMakeLists.txt new file mode 100644 index 000000000..4f3b0c729 --- /dev/null +++ b/components/__config/CMakeLists.txt @@ -0,0 +1,2 @@ + +register_config_only_component() \ No newline at end of file diff --git a/components/features/dac_audio/CMakeLists.txt b/components/features/dac_audio/CMakeLists.txt new file mode 100644 index 000000000..55e53df26 --- /dev/null +++ b/components/features/dac_audio/CMakeLists.txt @@ -0,0 +1,19 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "dac_audio.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_DAC_AUDIO_ENABLE) + set(COMPONENT_SRCS "dac_audio.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty dac_audio component due to configuration") + endif() +endif() + +register_component() diff --git a/components/features/infrared/CMakeLists.txt b/components/features/infrared/CMakeLists.txt new file mode 100644 index 000000000..057eea99f --- /dev/null +++ b/components/features/infrared/CMakeLists.txt @@ -0,0 +1,19 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "ir_nec.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_IR_ENABLE) + set(COMPONENT_SRCS "ir_nec.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty infrared component due to configuration") + endif() +endif() + +register_component() diff --git a/components/features/touchpad/CMakeLists.txt b/components/features/touchpad/CMakeLists.txt new file mode 100644 index 000000000..3d9d2e13e --- /dev/null +++ b/components/features/touchpad/CMakeLists.txt @@ -0,0 +1,41 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "touchpad_obj.cpp" + "touchpad.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + + if(CONFIG_IOT_TOUCH_ENABLE) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "scope_debug/touch_tune_tool.c") + + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "scope_debug") + endif() +else() + if(CONFIG_IOT_TOUCH_ENABLE) + set(COMPONENT_SRCS "touchpad_obj.cpp" + "touchpad.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + + if(CONFIG_IOT_TOUCH_ENABLE) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "scope_debug/touch_tune_tool.c") + + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "scope_debug") + endif() + + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty infrared component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES nvs_flash) + +register_component() diff --git a/components/features/ulp_monitor/CMakeLists.txt b/components/features/ulp_monitor/CMakeLists.txt new file mode 100644 index 000000000..7333a7976 --- /dev/null +++ b/components/features/ulp_monitor/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "ulp_monitor.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_ULP_ENABLE) + set(COMPONENT_SRCS "ulp_monitor.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty ulp component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES ulp) + +register_component() diff --git a/components/framework/lowpower_framework/CMakeLists.txt b/components/framework/lowpower_framework/CMakeLists.txt new file mode 100644 index 000000000..56d7bbdb6 --- /dev/null +++ b/components/framework/lowpower_framework/CMakeLists.txt @@ -0,0 +1,19 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "lowpower_framework.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_LOWPOWER_APP_FRAMEWORK_ENABLE) + set(COMPONENT_SRCS "lowpower_framework.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty lowpower_framework component due to configuration") + endif() +endif() + +register_component() diff --git a/components/general/adc/CMakeLists.txt b/components/general/adc/CMakeLists.txt new file mode 100644 index 000000000..78a83f1b0 --- /dev/null +++ b/components/general/adc/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "adc/adc.c" + "adc/adc_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "adc/include") +else() + if(CONFIG_IOT_ADC_ENABLE) + set(COMPONENT_SRCS "adc/adc.c" + "adc/adc_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "adc/include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty adc component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES esp_adc_cal) + +register_component() diff --git a/components/general/base_class/CMakeLists.txt b/components/general/base_class/CMakeLists.txt new file mode 100644 index 000000000..0642d748a --- /dev/null +++ b/components/general/base_class/CMakeLists.txt @@ -0,0 +1,6 @@ + +set(COMPONENT_SRCS "controllable_obj.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS "include") + +register_component() diff --git a/components/general/button/CMakeLists.txt b/components/general/button/CMakeLists.txt new file mode 100644 index 000000000..c9fe8a6f8 --- /dev/null +++ b/components/general/button/CMakeLists.txt @@ -0,0 +1,21 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "button/button.c" + "button/button_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "button/include") +else() + if(CONFIG_IOT_BUTTON_ENABLE) + set(COMPONENT_SRCS "button/button.c" + "button/button_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "button/include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty button component due to configuration") + endif() +endif() + +register_component() diff --git a/components/general/button/button/CMakeLists.txt b/components/general/button/button/CMakeLists.txt new file mode 100644 index 000000000..6c385ee21 --- /dev/null +++ b/components/general/button/button/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "button.c" + "button_obj.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/components/general/debugs/CMakeLists.txt b/components/general/debugs/CMakeLists.txt new file mode 100644 index 000000000..e029cc4b7 --- /dev/null +++ b/components/general/debugs/CMakeLists.txt @@ -0,0 +1,19 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "debugs.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_DEBUG_ENABLE) + set(COMPONENT_SRCS "debugs.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty debugs component due to configuration") + endif() +endif() + +register_component() diff --git a/components/general/led/CMakeLists.txt b/components/general/led/CMakeLists.txt new file mode 100644 index 000000000..be64eae42 --- /dev/null +++ b/components/general/led/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "status_led/led.c" + "status_led/led_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "status_led/include") +else() + if(CONFIG_IOT_LED_ENABLE) + set(COMPONENT_SRCS "status_led/led.c" + "status_led/led_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "status_led/include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty led component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES base_class) + +register_component() diff --git a/components/general/led/status_led/CMakeLists.txt b/components/general/led/status_led/CMakeLists.txt new file mode 100644 index 000000000..38618b03a --- /dev/null +++ b/components/general/led/status_led/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "led.c" + "led_obj.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/components/general/light/CMakeLists.txt b/components/general/light/CMakeLists.txt new file mode 100644 index 000000000..e62d0b122 --- /dev/null +++ b/components/general/light/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "light.c" + "light_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_LIGHT_ENABLE) + set(COMPONENT_SRCS "light.c" + "light_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty light component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES base_class) + +register_component() diff --git a/components/general/ota/CMakeLists.txt b/components/general/ota/CMakeLists.txt new file mode 100644 index 000000000..1facfe101 --- /dev/null +++ b/components/general/ota/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "ota.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_OTA_FUNC_ENABLE) + set(COMPONENT_SRCS "ota.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty ota component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES app_update) + +register_component() diff --git a/components/general/param/CMakeLists.txt b/components/general/param/CMakeLists.txt new file mode 100644 index 000000000..543157f93 --- /dev/null +++ b/components/general/param/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "param.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_PARAM_ENABLE) + set(COMPONENT_SRCS "param.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty param component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES nvs_flash) + +register_component() diff --git a/components/general/power_meter/CMakeLists.txt b/components/general/power_meter/CMakeLists.txt new file mode 100644 index 000000000..a88d1b13b --- /dev/null +++ b/components/general/power_meter/CMakeLists.txt @@ -0,0 +1,21 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "power_meter/power_meter.c" + "power_meter/power_meter_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "power_meter/include") +else() + if(CONFIG_IOT_POWER_METER_ENABLE) + set(COMPONENT_SRCS "power_meter/power_meter.c" + "power_meter/power_meter_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "power_meter/include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty power_meter component due to configuration") + endif() +endif() + +register_component() diff --git a/components/general/power_meter/power_meter/CMakeLists.txt b/components/general/power_meter/power_meter/CMakeLists.txt new file mode 100644 index 000000000..6086c47c3 --- /dev/null +++ b/components/general/power_meter/power_meter/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "power_meter.c" + "power_meter_obj.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/components/general/relay/CMakeLists.txt b/components/general/relay/CMakeLists.txt new file mode 100644 index 000000000..ebe3405fd --- /dev/null +++ b/components/general/relay/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "relay/relay.c" + "relay/relay_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "relay/include") +else() + if(CONFIG_IOT_RELAY_ENABLE) + set(COMPONENT_SRCS "relay/relay.c" + "relay/relay_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS "relay/include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty relay component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES base_class) + +register_component() diff --git a/components/general/relay/relay/CMakeLists.txt b/components/general/relay/relay/CMakeLists.txt new file mode 100644 index 000000000..3d5fe069d --- /dev/null +++ b/components/general/relay/relay/CMakeLists.txt @@ -0,0 +1,11 @@ + +set(COMPONENT_SRCS "relay.c" + "relay_obj.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS "." + "include") + +# requirements can't depend on config +set(COMPONENT_REQUIRES base_class) + +register_component() diff --git a/components/general/weekly_timer/CMakeLists.txt b/components/general/weekly_timer/CMakeLists.txt new file mode 100644 index 000000000..840a0ae0a --- /dev/null +++ b/components/general/weekly_timer/CMakeLists.txt @@ -0,0 +1,19 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "weekly_timer.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") +else() + if(CONFIG_IOT_WEEKLY_TIMER_ENABLE) + set(COMPONENT_SRCS "weekly_timer.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty weekly_timer component due to configuration") + endif() +endif() + +register_component() diff --git a/components/hmi/gdrivers/CMakeLists.txt b/components/hmi/gdrivers/CMakeLists.txt new file mode 100644 index 000000000..0b47e530c --- /dev/null +++ b/components/hmi/gdrivers/CMakeLists.txt @@ -0,0 +1,207 @@ + +if(CONFIG_UGFX_GUI_ENABLE) + if(NOT CONFIG_UGFX_USE_CUSTOM_DRIVER) + + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "include") + + #Display driver mode + if(CONFIG_UGFX_LCD_DRIVER_FRAMEBUFFER_MODE) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/framebuffer/gdisp_lld_framebuffer.c" + ) + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/framebuffer") + endif() + + #Display driver + if(CONFIG_UGFX_DRIVER_ILI9341) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/ILI9341/gdisp_lld_ILI9341.c" + "gdisp/ILI9341/ILI9341_adapter.cpp" + ) + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/ILI9341") + endif() + + if(CONFIG_UGFX_DRIVER_ST7789) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/ST7789/gdisp_lld_ST7789.c" + "gdisp/ST7789/ST7789_adapter.cpp" + ) + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/ST7789") + endif() + + if(CONFIG_UGFX_DRIVER_SSD1306) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/SSD1306/gdisp_lld_SSD1306.c" + "gdisp/SSD1306/SSD1306_adapter.cpp" + ) + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/SSD1306") + endif() + + if(CONFIG_UGFX_DRIVER_NT35510) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/NT35510/gdisp_lld_NT35510.c" + "gdisp/NT35510/NT35510_adapter.cpp" + ) + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/NT35510") + endif() + + #Input driver + #Touch driver + if(CONFIG_UGFX_DRIVER_TOUCH_SCREEN_ENABLE) + if(CONFIG_UGFX_DRIVER_TOUCH_XPT2046) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "ginput/touch/XPT2046/gmouse_lld_XPT2046.c" + "ginput/touch/XPT2046/XPT2046_adapter.cpp") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "ginput/touch/XPT2046") + endif() + + if(CONFIG_UGFX_DRIVER_TOUCH_FT5X06) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "ginput/touch/FT5X06/gmouse_lld_FT5x06.c" + "ginput/touch/FT5X06/lvgl_indev_adapter.c") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "ginput/touch/FT5X06") + endif() + endif() + + #Toggle driver + if(CONFIG_UGFX_DRIVER_TOGGLE_ENABLE) + if(CONFIG_UGFX_DRIVER_TOGGLE_BUTTON) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "ginput/toggle/button/ginput_lld_toggle_button.c") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "ginput/toggle/button") + endif() + + if(CONFIG_UGFX_DRIVER_TOGGLE_TOUCHPAD) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "ginput/toggle/touchpad/ginput_lld_toggle_touchpad.c") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "ginput/toggle/touchpad") + endif() + endif() + + #Audio driver + if(CONFIG_UGFX_DRIVER_AUDIO_ENABLE) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gaudio/dac_audio/gaudio_play_dac_audio.c" + ) + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gaudio/dac_audio") + endif() + + endif() +else() + if(CONFIG_LVGL_GUI_ENABLE) + if(NOT CONFIG_LVGL_USE_CUSTOM_DRIVER) + set(COMPONENT_SRCS "") + + set(COMPONENT_ADD_INCLUDEDIRS "include") + + #Display driver mode + if(CONFIG_LVGL_LCD_DRIVER_FRAMEBUFFER_MODE) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/framebuffer/gdisp_lld_framebuffer.c") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/framebuffer") + endif() + + #Display driver + if(CONFIG_LVGL_DRIVER_ILI9341) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/ILI9341/gdisp_lld_ILI9341.c" + "gdisp/ILI9341/ILI9341_adapter.cpp") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/ILI9341") + endif() + + if(CONFIG_LVGL_DRIVER_ST7789) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/ST7789/gdisp_lld_ST7789.c" + "gdisp/ST7789/ST7789_adapter.cpp") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/ST7789") + endif() + + if(CONFIG_LVGL_DRIVER_SSD1306) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/SSD1306/gdisp_lld_SSD1306.c" + "gdisp/SSD1306/SSD1306_adapter.cpp") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/SSD1306") + endif() + + if(CONFIG_LVGL_DRIVER_NT35510) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gdisp/NT35510/gdisp_lld_NT35510.c" + "gdisp/NT35510/NT35510_adapter.cpp") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gdisp/NT35510") + endif() + + #Input driver + #Touch driver + if(CONFIG_LVGL_DRIVER_TOUCH_SCREEN_ENABLE) + if(CONFIG_LVGL_DRIVER_TOUCH_XPT2046) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "ginput/touch/XPT2046/gmouse_lld_XPT2046.c" + "ginput/touch/XPT2046/XPT2046_adapter.cpp") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "ginput/touch/XPT2046") + endif() + + if(CONFIG_LVGL_DRIVER_TOUCH_FT5X06) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "ginput/touch/FT5X06/gmouse_lld_FT5x06.c" + "ginput/touch/FT5X06/lvgl_indev_adapter.c") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "ginput/touch/FT5X06") + endif() + endif() + + #Toggle driver + if(CONFIG_LVGL_DRIVER_TOGGLE_ENABLE) + if(CONFIG_LVGL_DRIVER_TOGGLE_BUTTON) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "ginput/toggle/button/ginput_lld_toggle_button.c") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "ginput/toggle/button") + endif() + + if(CONFIG_LVGL_DRIVER_TOGGLE_TOUCHPAD) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "ginput/toggle/touchpad/ginput_lld_toggle_touchpad.c") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "ginput/toggle/touchpad") + endif() + endif() + + #Audio driver + if(CONFIG_LVGL_DRIVER_AUDIO_ENABLE) + set(COMPONENT_SRCS "${COMPONENT_SRCS}" + "gaudio/dac_audio/gaudio_play_dac_audio.c") + set(COMPONENT_ADD_INCLUDEDIRS "${COMPONENT_ADD_INCLUDEDIRS}" + "gaudio/dac_audio") + endif() + + endif() + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + endif() +endif() + +# The values of COMPONENT_REQUIRES and COMPONENT_PRIV_REQUIRES should not +# depend on any configuration choices (CONFIG_xxx macros). +# This is because requirements are expanded before configuration is loaded. +# Other component variables (like include paths or source files) can depend on configuration choices. +set(COMPONENT_REQUIRES lvgl_gui ugfx_gui nt35510 ssd1306 lcd xpt2046 ft5x06 touchpad) + +register_component() diff --git a/components/hmi/lvgl_gui/CMakeLists.txt b/components/hmi/lvgl_gui/CMakeLists.txt new file mode 100644 index 000000000..51073c7e4 --- /dev/null +++ b/components/hmi/lvgl_gui/CMakeLists.txt @@ -0,0 +1,146 @@ + +if(NOT CONFIG_LVGL_GUI_ENABLE) + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty lvgl component due to configuration") +else() + # can use this also + set(COMPONENT_SRCDIRS . lvgl/lv_core lvgl/lv_draw lvgl/lv_fonts lvgl/lv_hal lvgl/lv_misc lvgl/lv_objx lvgl/lv_themes) + + # set(COMPONENT_SRCS "lv_calibration.c" + # "lvgl.c" + # "lvgl/lv_core/lv_group.c" + # "lvgl/lv_core/lv_indev.c" + # "lvgl/lv_core/lv_lang.c" + # "lvgl/lv_core/lv_obj.c" + # "lvgl/lv_core/lv_refr.c" + # "lvgl/lv_core/lv_style.c" + # "lvgl/lv_core/lv_vdb.c" + + # "lvgl/lv_draw/lv_draw_arc.c" + # "lvgl/lv_draw/lv_draw_img.c" + # "lvgl/lv_draw/lv_draw_label.c" + # "lvgl/lv_draw/lv_draw_line.c" + # "lvgl/lv_draw/lv_draw_rbasic.c" + # "lvgl/lv_draw/lv_draw_rect.c" + # "lvgl/lv_draw/lv_draw_triangle.c" + # "lvgl/lv_draw/lv_draw_vbasic.c" + # "lvgl/lv_draw/lv_draw.c" + + # "lvgl/lv_fonts/lv_font_builtin.c" + # "lvgl/lv_fonts/lv_font_dejavu_10.c" + # "lvgl/lv_fonts/lv_font_dejavu_20.c" + # "lvgl/lv_fonts/lv_font_dejavu_30.c" + # "lvgl/lv_fonts/lv_font_dejavu_40.c" + # "lvgl/lv_fonts/lv_font_dejavu_10_cyrillic.c" + # "lvgl/lv_fonts/lv_font_dejavu_20_cyrillic.c" + # "lvgl/lv_fonts/lv_font_dejavu_30_cyrillic.c" + # "lvgl/lv_fonts/lv_font_dejavu_40_cyrillic.c" + # "lvgl/lv_fonts/lv_font_dejavu_10_latin_sup.c" + # "lvgl/lv_fonts/lv_font_dejavu_20_latin_sup.c" + # "lvgl/lv_fonts/lv_font_dejavu_30_latin_sup.c" + # "lvgl/lv_fonts/lv_font_dejavu_40_latin_sup.c" + # "lvgl/lv_fonts/lv_font_symbol_10.c" + # "lvgl/lv_fonts/lv_font_symbol_20.c" + # "lvgl/lv_fonts/lv_font_symbol_30.c" + # "lvgl/lv_fonts/lv_font_symbol_40.c" + # "lvgl/lv_fonts/lv_font_monospace_8.c" + + # "lvgl/lv_hal/lv_hal_disp.c" + # "lvgl/lv_hal/lv_hal_indev.c" + # "lvgl/lv_hal/lv_hal_tick.c" + + # "lvgl/lv_misc/lv_font.c" + # "lvgl/lv_misc/lv_circ.c" + # "lvgl/lv_misc/lv_area.c" + # "lvgl/lv_misc/lv_task.c" + # "lvgl/lv_misc/lv_fs.c" + # "lvgl/lv_misc/lv_anim.c" + # "lvgl/lv_misc/lv_mem.c" + # "lvgl/lv_misc/lv_ll.c" + # "lvgl/lv_misc/lv_color.c" + # "lvgl/lv_misc/lv_txt.c" + # "lvgl/lv_misc/lv_ufs.c" + # "lvgl/lv_misc/lv_math.c" + # "lvgl/lv_misc/lv_log.c" + # "lvgl/lv_misc/lv_gc.c" + + # "lvgl/lv_objx/lv_arc.c" + # "lvgl/lv_objx/lv_bar.c" + # "lvgl/lv_objx/lv_cb.c" + # "lvgl/lv_objx/lv_ddlist.c" + # "lvgl/lv_objx/lv_kb.c" + # "lvgl/lv_objx/lv_line.c" + # "lvgl/lv_objx/lv_mbox.c" + # "lvgl/lv_objx/lv_preload.c" + # "lvgl/lv_objx/lv_roller.c" + # "lvgl/lv_objx/lv_table.c" + # "lvgl/lv_objx/lv_tabview.c" + # "lvgl/lv_objx/lv_tileview.c" + # "lvgl/lv_objx/lv_btn.c" + # "lvgl/lv_objx/lv_calendar.c" + # "lvgl/lv_objx/lv_chart.c" + # "lvgl/lv_objx/lv_canvas.c" + # "lvgl/lv_objx/lv_gauge.c" + # "lvgl/lv_objx/lv_label.c" + # "lvgl/lv_objx/lv_list.c" + # "lvgl/lv_objx/lv_slider.c" + # "lvgl/lv_objx/lv_ta.c" + # "lvgl/lv_objx/lv_spinbox.c" + # "lvgl/lv_objx/lv_btnm.c" + # "lvgl/lv_objx/lv_cont.c" + # "lvgl/lv_objx/lv_img.c" + # "lvgl/lv_objx/lv_imgbtn.c" + # "lvgl/lv_objx/lv_led.c" + # "lvgl/lv_objx/lv_lmeter.c" + # "lvgl/lv_objx/lv_page.c" + # "lvgl/lv_objx/lv_sw.c" + # "lvgl/lv_objx/lv_win.c" + + # "lvgl/lv_themes/lv_theme_alien.c" + # "lvgl/lv_themes/lv_theme.c" + # "lvgl/lv_themes/lv_theme_default.c" + # "lvgl/lv_themes/lv_theme_night.c" + # "lvgl/lv_themes/lv_theme_templ.c" + # "lvgl/lv_themes/lv_theme_zen.c" + # "lvgl/lv_themes/lv_theme_material.c" + # "lvgl/lv_themes/lv_theme_nemo.c" + # "lvgl/lv_themes/lv_theme_mono.c") + + set(COMPONENT_ADD_INCLUDEDIRS "." + "include" + "lvgl" + "lvgl/lv_core" + "lvgl/lv_draw" + "lvgl/lv_fonts" + "lvgl/lv_hal" + "lvgl/lv_misc" + "lvgl/lv_objx" + "lvgl/lv_themes") + + set(COMPONENT_PRIV_INCLUDEDIRS "." + "include" + "lvgl" + "lvgl/lv_core" + "lvgl/lv_draw" + "lvgl/lv_fonts" + "lvgl/lv_hal" + "lvgl/lv_misc" + "lvgl/lv_objx" + "lvgl/lv_themes") + + # if(CONFIG_LVGL_USE_CUSTOM_DRIVER) + # set(COMPONENT_REQUIRES $(call dequote,$(CONFIG_LVGL_CUSTOM_DRIVER_COMPONENT_NAME))) + # else() + # set(COMPONENT_REQUIRES gdrivers param) + # endif() + +endif() + +# The values of COMPONENT_REQUIRES and COMPONENT_PRIV_REQUIRES should not +# depend on any configuration choices (CONFIG_xxx macros). +# This is because requirements are expanded before configuration is loaded. +# Other component variables (like include paths or source files) can depend on configuration choices. +set(COMPONENT_REQUIRES gdrivers param) + +register_component() diff --git a/components/hmi/ugfx_gui/CMakeLists.txt b/components/hmi/ugfx_gui/CMakeLists.txt new file mode 100644 index 000000000..25d02c592 --- /dev/null +++ b/components/hmi/ugfx_gui/CMakeLists.txt @@ -0,0 +1,62 @@ + +if(NOT CONFIG_UGFX_GUI_ENABLE) + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty ugfx component due to configuration") +else() + set(COMPONENT_SRCS "mk.c" + "gos_freertos_priv.c") + + set(COMPONENT_ADD_INCLUDEDIRS "." + "include" + "ugfx" + "ugfx/src" + "ugfx/src/gadc" + "ugfx/src/gaudio" + "ugfx/src/gdisp" + "ugfx/src/gdriver" + "ugfx/src/gevent" + "ugfx/src/gfile" + "ugfx/src/ginput" + "ugfx/src/gmisc" + "ugfx/src/gos" + "ugfx/src/gqueue" + "ugfx/src/gtimer" + "ugfx/src/gtrans" + "ugfx/src/gwin") + + set(COMPONENT_PRIV_INCLUDEDIRS "." + "include" + "ugfx" + "ugfx/src" + "ugfx/src/gadc" + "ugfx/src/gaudio" + "ugfx/src/gdisp" + "ugfx/src/gdriver" + "ugfx/src/gevent" + "ugfx/src/gfile" + "ugfx/src/ginput" + "ugfx/src/gmisc" + "ugfx/src/gos" + "ugfx/src/gqueue" + "ugfx/src/gtimer" + "ugfx/src/gtrans" + "ugfx/src/gwin") + + # if(CONFIG_UGFX_USE_CUSTOM_DRIVER) + # set(COMPONENT_REQUIRES $(call dequote,$(CONFIG_UGFX_CUSTOM_DRIVER_COMPONENT_NAME))) + # else() + # set(COMPONENT_REQUIRES gdrivers) + # endif() + + set(COMPONENT_PRIV_INCLUDEDIRS ${COMPONENT_PRIV_INCLUDEDIRS} ${PROJECT_PATH}/${CONFIG_UGFX_PROJ_RESOURCE_PATH}) + +endif() + +# The values of COMPONENT_REQUIRES and COMPONENT_PRIV_REQUIRES should not +# depend on any configuration choices (CONFIG_xxx macros). +# This is because requirements are expanded before configuration is loaded. +# Other component variables (like include paths or source files) can depend on configuration choices. +set(COMPONENT_REQUIRES gdrivers param) + +register_component() diff --git a/components/i2c_devices/i2c_bus/CMakeLists.txt b/components/i2c_devices/i2c_bus/CMakeLists.txt new file mode 100644 index 000000000..450b71da1 --- /dev/null +++ b/components/i2c_devices/i2c_bus/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "i2c_bus.c" + "i2c_bus_obj.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/components/i2c_devices/others/at24c02/CMakeLists.txt b/components/i2c_devices/others/at24c02/CMakeLists.txt new file mode 100644 index 000000000..7186e229b --- /dev/null +++ b/components/i2c_devices/others/at24c02/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "at24c02.c" + "at24c02_obj.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_AT24C02_ENABLE) + set(COMPONENT_SRCS "at24c02.c" + "at24c02_obj.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty at24c02 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/others/ch450/CMakeLists.txt b/components/i2c_devices/others/ch450/CMakeLists.txt new file mode 100644 index 000000000..cdc9a9af8 --- /dev/null +++ b/components/i2c_devices/others/ch450/CMakeLists.txt @@ -0,0 +1,20 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "ch450.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_CH450_ENABLE) + set(COMPONENT_SRCS "ch450.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty ch450 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/others/ht16c21/CMakeLists.txt b/components/i2c_devices/others/ht16c21/CMakeLists.txt new file mode 100644 index 000000000..238e58e61 --- /dev/null +++ b/components/i2c_devices/others/ht16c21/CMakeLists.txt @@ -0,0 +1,20 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "ht16c21.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_HT16C21_ENABLE) + set(COMPONENT_SRCS "ht16c21.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty ht16c21 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/others/is31fl3xxx/CMakeLists.txt b/components/i2c_devices/others/is31fl3xxx/CMakeLists.txt new file mode 100644 index 000000000..532ef3550 --- /dev/null +++ b/components/i2c_devices/others/is31fl3xxx/CMakeLists.txt @@ -0,0 +1,28 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "is31fl3736.c" + "is31fl3736_obj.cpp" + "is31fl3218.c" + "is31fl3218_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_IS31FL3XXX_ENABLE) + set(COMPONENT_SRCS "is31fl3736.c" + "is31fl3736_obj.cpp" + "is31fl3218.c" + "is31fl3218_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty is31fl3xxx component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/others/mcp23017/CMakeLists.txt b/components/i2c_devices/others/mcp23017/CMakeLists.txt new file mode 100644 index 000000000..1358c94ae --- /dev/null +++ b/components/i2c_devices/others/mcp23017/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "mcp23017.c" + "mcp23017_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_MCP23017_ENABLE) + set(COMPONENT_SRCS "mcp23017.c" + "mcp23017_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty mcp23017 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/others/ssd1306/CMakeLists.txt b/components/i2c_devices/others/ssd1306/CMakeLists.txt new file mode 100644 index 000000000..76ed64c07 --- /dev/null +++ b/components/i2c_devices/others/ssd1306/CMakeLists.txt @@ -0,0 +1,26 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "ssd1306.c" + "ssd1306_fonts.c" + "ssd1306_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_OLED_ENABLE) + set(COMPONENT_SRCS "ssd1306.c" + "ssd1306_fonts.c" + "ssd1306_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty ssd1306 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/apds9960/CMakeLists.txt b/components/i2c_devices/sensor/apds9960/CMakeLists.txt new file mode 100644 index 000000000..7f29ad421 --- /dev/null +++ b/components/i2c_devices/sensor/apds9960/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "apds9960.c" + "apds9960_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_APDS9960_ENABLE) + set(COMPONENT_SRCS "apds9960.c" + "apds9960_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty apds9960 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/bh1750/CMakeLists.txt b/components/i2c_devices/sensor/bh1750/CMakeLists.txt new file mode 100644 index 000000000..ed88631ec --- /dev/null +++ b/components/i2c_devices/sensor/bh1750/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "bh1750.c" + "bh1750_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_BH1750_ENABLE) + set(COMPONENT_SRCS "bh1750.c" + "bh1750_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty bh1750 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/bme280/CMakeLists.txt b/components/i2c_devices/sensor/bme280/CMakeLists.txt new file mode 100644 index 000000000..48cf1fb25 --- /dev/null +++ b/components/i2c_devices/sensor/bme280/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "bme280.c" + "bme280_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_BME280_ENABLE) + set(COMPONENT_SRCS "bme280.c" + "bme280_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty bme280 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/ft5x06/CMakeLists.txt b/components/i2c_devices/sensor/ft5x06/CMakeLists.txt new file mode 100644 index 000000000..bfe9e978d --- /dev/null +++ b/components/i2c_devices/sensor/ft5x06/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "ft5x06.c") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_FT5X06_ENABLE) + set(COMPONENT_SRCS "ft5x06.c") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty ft5x06 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/hdc2010/CMakeLists.txt b/components/i2c_devices/sensor/hdc2010/CMakeLists.txt new file mode 100644 index 000000000..515c1b8a5 --- /dev/null +++ b/components/i2c_devices/sensor/hdc2010/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "hdc2010.c" + "hdc2010_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_HDC2010_ENABLE) + set(COMPONENT_SRCS "hdc2010.c" + "hdc2010_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty hdc2010 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/hts221/CMakeLists.txt b/components/i2c_devices/sensor/hts221/CMakeLists.txt new file mode 100644 index 000000000..ee42a5be9 --- /dev/null +++ b/components/i2c_devices/sensor/hts221/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "hts221.c" + "hts221_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_HTS221_ENABLE) + set(COMPONENT_SRCS "hts221.c" + "hts221_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty hts221 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/lis2dh12/CMakeLists.txt b/components/i2c_devices/sensor/lis2dh12/CMakeLists.txt new file mode 100644 index 000000000..042fd6e9f --- /dev/null +++ b/components/i2c_devices/sensor/lis2dh12/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "lis2dh12.c" + "lis2dh12_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_LIS2DH12_ENABLE) + set(COMPONENT_SRCS "lis2dh12.c" + "lis2dh12_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty lis2dh12 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/mpu6050/CMakeLists.txt b/components/i2c_devices/sensor/mpu6050/CMakeLists.txt new file mode 100644 index 000000000..ed39a797f --- /dev/null +++ b/components/i2c_devices/sensor/mpu6050/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "mpu6050.c") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_MPU6050_ENABLE) + set(COMPONENT_SRCS "mpu6050.c") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty mpu6050 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/mvh3004d/CMakeLists.txt b/components/i2c_devices/sensor/mvh3004d/CMakeLists.txt new file mode 100644 index 000000000..781e31a24 --- /dev/null +++ b/components/i2c_devices/sensor/mvh3004d/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "mvh3004d.c" + "mvh3004d_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_MVH3004D_ENABLE) + set(COMPONENT_SRCS "mvh3004d.c" + "mvh3004d_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty mvh3004d component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2c_devices/sensor/veml6040/CMakeLists.txt b/components/i2c_devices/sensor/veml6040/CMakeLists.txt new file mode 100644 index 000000000..92a0d0ed5 --- /dev/null +++ b/components/i2c_devices/sensor/veml6040/CMakeLists.txt @@ -0,0 +1,24 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "veml6040.c" + "veml6040_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_VEML6040_ENABLE) + set(COMPONENT_SRCS "veml6040.c" + "veml6040_obj.cpp") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty veml6040 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/i2s_devices/ili9806/CMakeLists.txt b/components/i2s_devices/ili9806/CMakeLists.txt new file mode 100644 index 000000000..74602e87f --- /dev/null +++ b/components/i2s_devices/ili9806/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "ili9806.c") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_LCD_ILI9806_ENABLE) + set(COMPONENT_SRCS "ili9806.c") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty ili9806 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES lcd_common) + +register_component() diff --git a/components/i2s_devices/lcd_common/CMakeLists.txt b/components/i2s_devices/lcd_common/CMakeLists.txt new file mode 100644 index 000000000..4ef1b09cc --- /dev/null +++ b/components/i2s_devices/lcd_common/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "i2s_lcd.c" + "i2s_lcd_com.c") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/components/i2s_devices/nt35510/CMakeLists.txt b/components/i2s_devices/nt35510/CMakeLists.txt new file mode 100644 index 000000000..1fdb396c7 --- /dev/null +++ b/components/i2s_devices/nt35510/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "nt35510.c") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_LCD_NT35510_ENABLE) + set(COMPONENT_SRCS "nt35510.c") + + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty nt35510 component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES lcd_common) + +register_component() diff --git a/components/motor/servo/servo_motor/CMakeLists.txt b/components/motor/servo/servo_motor/CMakeLists.txt new file mode 100644 index 000000000..ec7300d5a --- /dev/null +++ b/components/motor/servo/servo_motor/CMakeLists.txt @@ -0,0 +1,20 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "servo.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_SERVO_ENABLE) + set(COMPONENT_SRCS "servo.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty servo component due to configuration") + endif() +endif() + +# requirements can't depend on config +# set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/motor/stepper/a4988/CMakeLists.txt b/components/motor/stepper/a4988/CMakeLists.txt new file mode 100644 index 000000000..c090ad506 --- /dev/null +++ b/components/motor/stepper/a4988/CMakeLists.txt @@ -0,0 +1,20 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "a4988.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_STEPPER_A4988_ENABLE) + set(COMPONENT_SRCS "a4988.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty a4988 component due to configuration") + endif() +endif() + +# requirements can't depend on config +# set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/network/mqtt/CMakeLists.txt b/components/network/mqtt/CMakeLists.txt new file mode 100644 index 000000000..d8cf7428d --- /dev/null +++ b/components/network/mqtt/CMakeLists.txt @@ -0,0 +1,36 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "espmqtt/mqtt_client.c" + "espmqtt/lib/mqtt_msg.c" + "espmqtt/lib/mqtt_outbox.c" + "espmqtt/lib/platform_esp32_idf.c" + "espmqtt/lib/transport_ssl.c" + "espmqtt/lib/transport_tcp.c" + "espmqtt/lib/transport_ws.c" + "espmqtt/lib/transport.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include espmqtt/lib/include") +else() + if(CONFIG_IOT_MQTT_ENABLE) + set(COMPONENT_SRCS "espmqtt/mqtt_client.c" + "espmqtt/lib/mqtt_msg.c" + "espmqtt/lib/mqtt_outbox.c" + "espmqtt/lib/platform_esp32_idf.c" + "espmqtt/lib/transport_ssl.c" + "espmqtt/lib/transport_tcp.c" + "espmqtt/lib/transport_ws.c" + "espmqtt/lib/transport.c") + + set(COMPONENT_ADD_INCLUDEDIRS "include espmqtt/lib/include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty mqtt component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES lwip nghttp mbedtls) + +register_component() diff --git a/components/network/tcp/CMakeLists.txt b/components/network/tcp/CMakeLists.txt new file mode 100644 index 000000000..585c0c2ac --- /dev/null +++ b/components/network/tcp/CMakeLists.txt @@ -0,0 +1,20 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "iot_tcp.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_TCP_CLASS_ENABLE) + set(COMPONENT_SRCS "iot_tcp.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty tcp component due to configuration") + endif() +endif() + +# requirements can't depend on config +# set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/network/udp/CMakeLists.txt b/components/network/udp/CMakeLists.txt new file mode 100644 index 000000000..346de233c --- /dev/null +++ b/components/network/udp/CMakeLists.txt @@ -0,0 +1,20 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "iot_udp.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_UDP_CLASS_ENABLE) + set(COMPONENT_SRCS "iot_udp.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty udp component due to configuration") + endif() +endif() + +# requirements can't depend on config +# set(COMPONENT_REQUIRES i2c_bus) + +register_component() diff --git a/components/platforms/alink/CMakeLists.txt b/components/platforms/alink/CMakeLists.txt new file mode 100644 index 000000000..ca304bc95 --- /dev/null +++ b/components/platforms/alink/CMakeLists.txt @@ -0,0 +1,53 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "adaptation/alink_network.c" + "adaptation/alink_os.c" + "adaptation/alink_product.c" + "adaptation/alink_ssl.c" + "adaptation/alink_upgrade.c" + "adaptation/alink_wifi.c" + + "esp32-alink/application/esp_alink_main.c" + "esp32-alink/application/esp_data_transport.c" + "esp32-alink/application/esp_info_store.c" + "esp32-alink/application/esp_json_parser.c") + + set(COMPONENT_ADD_INCLUDEDIRS "esp32-alink/include" + "esp32-alink/adaptation/include") +else() + if(CONFIG_IOT_ALINK_ENABLE) + set(COMPONENT_SRCS "adaptation/alink_network.c" + "adaptation/alink_os.c" + "adaptation/alink_product.c" + "adaptation/alink_ssl.c" + "adaptation/alink_upgrade.c" + "adaptation/alink_wifi.c" + + "esp32-alink/application/esp_alink_main.c" + "esp32-alink/application/esp_data_transport.c" + "esp32-alink/application/esp_info_store.c" + "esp32-alink/application/esp_json_parser.c") + + set(COMPONENT_ADD_INCLUDEDIRS "esp32-alink/include" + "esp32-alink/adaptation/include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty esp32-alink component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES esp32 app_update json openssl nvs_flash) + +register_component() + +if(CONFIG_ALINK_VERSION_EMBED) +target_link_libraries(alink "-L${COMPONENT_PATH}/esp32-alink/lib") +target_link_libraries(alink alink_agent tfspal) +endif() +if(CONFIG_ALINK_VERSION_SDS) +target_link_libraries(alink "-L${COMPONENT_PATH}/esp32-alink/lib") +target_link_libraries(alink alink_agent_sds tfspal) +endif() diff --git a/components/platforms/alink/component.mk b/components/platforms/alink/component.mk index 7b2ec4e90..566455ab7 100755 --- a/components/platforms/alink/component.mk +++ b/components/platforms/alink/component.mk @@ -6,7 +6,7 @@ ifndef CONFIG_IOT_SOLUTION_EMBED COMPONENT_ADD_INCLUDEDIRS := esp32-alink/include esp32-alink/adaptation/include -COMPONENT_SRCDIRS := esp32-alink/adaptation esp32-alink/application +COMPONENT_SRCDIRS := adaptation esp32-alink/application ifdef CONFIG_ALINK_VERSION_EMBED LIBS := alink_agent tfspal endif diff --git a/components/spi_devices/epaper/CMakeLists.txt b/components/spi_devices/epaper/CMakeLists.txt new file mode 100644 index 000000000..3fe76caab --- /dev/null +++ b/components/spi_devices/epaper/CMakeLists.txt @@ -0,0 +1,19 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "epaper.c" + "epaper_font.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_EINK_ENABLE) + set(COMPONENT_SRCS "epaper.c" + "epaper_font.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty epaper component due to configuration") + endif() +endif() + +register_component() diff --git a/components/spi_devices/epaper/epaper.c b/components/spi_devices/epaper/epaper.c index 9775eb0f8..29a74b373 100644 --- a/components/spi_devices/epaper/epaper.c +++ b/components/spi_devices/epaper/epaper.c @@ -18,8 +18,6 @@ #include #include "driver/gpio.h" #include "driver/spi_master.h" -#include "driver/i2c.h" -#include "iot_i2c_bus.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" diff --git a/components/spi_devices/lcd/CMakeLists.txt b/components/spi_devices/lcd/CMakeLists.txt new file mode 100644 index 000000000..a7cd1aa5b --- /dev/null +++ b/components/spi_devices/lcd/CMakeLists.txt @@ -0,0 +1,44 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "adaptation.cpp" + "font7s.c" + "glcdfont.c" + "iot_lcd.cpp" + "spi_lcd.c" + "Adafruit-GFX-Library/Adafruit_GFX.cpp" + # "Adafruit-GFX-Library/Adafruit_SPITFT.cpp" + "Adafruit-GFX-Library/glcdfont.c") + + set(COMPONENT_ADD_INCLUDEDIRS "." + "include" + "Adafruit-GFX-Library/Fonts" + "Adafruit-GFX-Library") +else() + if(CONFIG_IOT_LCD_ENABLE) + set(COMPONENT_SRCS "adaptation.cpp" + "font7s.c" + "glcdfont.c" + "iot_lcd.cpp" + "spi_lcd.c" + "Adafruit-GFX-Library/Adafruit_GFX.cpp" + # "Adafruit-GFX-Library/Adafruit_SPITFT.cpp" + "Adafruit-GFX-Library/glcdfont.c") + + set(COMPONENT_ADD_INCLUDEDIRS "." + "include" + "Adafruit-GFX-Library/Fonts" + "Adafruit-GFX-Library") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty lcd component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES spi_flash) + +register_component() + +add_compile_options(-D__AVR_ATtiny85__) diff --git a/components/spi_devices/xpt2046/CMakeLists.txt b/components/spi_devices/xpt2046/CMakeLists.txt new file mode 100644 index 000000000..704ed90ec --- /dev/null +++ b/components/spi_devices/xpt2046/CMakeLists.txt @@ -0,0 +1,19 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "iot_xpt.c" + "xpt2046_obj.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_TOUCH_SCREEN_ENABLE) + set(COMPONENT_SRCS "iot_xpt.c" + "xpt2046_obj.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty xpt2046 component due to configuration") + endif() +endif() + +register_component() diff --git a/components/spi_devices/xpt2046/include/iot_xpt2046.h b/components/spi_devices/xpt2046/include/iot_xpt2046.h index 7a4d425d1..c1ba12783 100644 --- a/components/spi_devices/xpt2046/include/iot_xpt2046.h +++ b/components/spi_devices/xpt2046/include/iot_xpt2046.h @@ -19,7 +19,6 @@ #include "stdio.h" #include "driver/gpio.h" #include "driver/spi_master.h" -#include "esp_partition.h" #include "freertos/semphr.h" #include "esp_log.h" diff --git a/components/wifi/iot_blufi/CMakeLists.txt b/components/wifi/iot_blufi/CMakeLists.txt new file mode 100644 index 000000000..48d21971e --- /dev/null +++ b/components/wifi/iot_blufi/CMakeLists.txt @@ -0,0 +1,17 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "iot_blufi.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_BLUFI_ABSTRACT_ENABLE) + set(COMPONENT_SRCS "iot_blufi.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty iot_blufi component due to configuration") + endif() +endif() + +register_component() diff --git a/components/wifi/iot_espnow/CMakeLists.txt b/components/wifi/iot_espnow/CMakeLists.txt new file mode 100644 index 000000000..b92c43161 --- /dev/null +++ b/components/wifi/iot_espnow/CMakeLists.txt @@ -0,0 +1,17 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "iot_espnow.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_ESPNOW_ENABLE) + set(COMPONENT_SRCS "iot_espnow.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty iot_espnow component due to configuration") + endif() +endif() + +register_component() diff --git a/components/wifi/smart_config/CMakeLists.txt b/components/wifi/smart_config/CMakeLists.txt new file mode 100644 index 000000000..2eb5c98dd --- /dev/null +++ b/components/wifi/smart_config/CMakeLists.txt @@ -0,0 +1,17 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "smart_config.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_SMARTCONFIG_ABSTRACT_ENABLE) + set(COMPONENT_SRCS "smart_config.c") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty smart_config component due to configuration") + endif() +endif() + +register_component() diff --git a/components/wifi/wifi_conn/CMakeLists.txt b/components/wifi/wifi_conn/CMakeLists.txt new file mode 100644 index 000000000..4623a0542 --- /dev/null +++ b/components/wifi/wifi_conn/CMakeLists.txt @@ -0,0 +1,22 @@ + +# componet standalone mode +if(NOT CONFIG_IOT_SOLUTION_EMBED) + set(COMPONENT_SRCS "wifi.c" + "wifi_obj.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") +else() + if(CONFIG_IOT_WIFI_ABSTRACT_ENABLE) + set(COMPONENT_SRCS "wifi.c" + "wifi_obj.cpp") + set(COMPONENT_ADD_INCLUDEDIRS ". include") + else() + set(COMPONENT_SRCS "") + set(COMPONENT_ADD_INCLUDEDIRS "") + message(STATUS "Building empty wifi_conn component due to configuration") + endif() +endif() + +# requirements can't depend on config +set(COMPONENT_REQUIRES nvs_flash) + +register_component() diff --git a/examples/aws_iot_demo/CMakeLists.txt b/examples/aws_iot_demo/CMakeLists.txt new file mode 100644 index 000000000..8a734e85c --- /dev/null +++ b/examples/aws_iot_demo/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(aws-iot-demo) diff --git a/examples/aws_iot_demo/README.md b/examples/aws_iot_demo/README.md index ffd8bddf9..de6516350 100644 --- a/examples/aws_iot_demo/README.md +++ b/examples/aws_iot_demo/README.md @@ -18,15 +18,15 @@ 您的 AWS IOT 帐户具有唯一终端主机名。要找到它,请打开 AWS IOT 控制台,然后单击左下方的“设置”按钮。端点主机名显示在此页面的“自定义端点”标题下。 - 之后我们在电脑终端运行 `make menuconfig` 并进入 `component config` -> `Amazon Web Service IoT Config` -> `AWS IoT MQTT Hostname`,在这里我们输入上一步找到的主机名。 + 之后我们在电脑终端运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 并进入 `component config` -> `Amazon Web Service IoT Config` -> `AWS IoT MQTT Hostname`,在这里我们输入上一步找到的主机名。 - 设置客户端 ID - 在电脑终端中运行 `make menuconfig`,在 `Example Configuration` 下,设置 `AWS IOT Client ID` 的值 + 在电脑终端中运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake),在 `Example Configuration` 下,设置 `AWS IOT Client ID` 的值 - 本地验证证书是否配置正确 运行 `openssl s_client -showcerts -connect hostname:8883 < /dev/null` 命令去验证证书是否正确 - 正确配置 ESP32 网络连接 - - 在电脑终端运行 `make menuconfig` 命令,在 `Example Configuration` 目录中配置 `WiFi SSID` 和 `WiFi Password` + - 在电脑终端运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 命令,在 `Example Configuration` 目录中配置 `WiFi SSID` 和 `WiFi Password` # 监视来自设备的数据 diff --git a/examples/aws_iot_demo/main/CMakeLists.txt b/examples/aws_iot_demo/main/CMakeLists.txt new file mode 100644 index 000000000..6cf8beb9f --- /dev/null +++ b/examples/aws_iot_demo/main/CMakeLists.txt @@ -0,0 +1,32 @@ + +set(COMPONENT_SRCS "aws_main.cpp" + "aws_iot_lcd.cpp" + "aws_iot_task.cpp" + "image.c") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() + +if(CONFIG_EXAMPLE_EMBEDDED_CERTS) +target_add_binary_data(${COMPONENT_NAME} "certs/aws-root-ca.pem" TEXT) + +if(NOT IDF_CI_BUILD) + add_custom_command(OUTPUT certs/certificate.pem.crt certs/private.pem.key + COMMAND echo "Dummy certificate data for continuous integration" > + certs/certificate.pem.crt + COMMAND echo "Dummy certificate data for continuous integration" > + certs/private.pem.key + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM) + add_custom_target(example_certificates DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt ${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key) + + add_dependencies(${COMPONENT_NAME} example_certificates) + + target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/certificate.pem.crt" TEXT) + target_add_binary_data(${COMPONENT_NAME} "${CMAKE_CURRENT_BINARY_DIR}/certs/private.pem.key" TEXT) +else() + target_add_binary_data(${COMPONENT_NAME} "certs/certificate.pem.crt" TEXT) + target_add_binary_data(${COMPONENT_NAME} "certs/private.pem.key" TEXT) +endif() +endif() \ No newline at end of file diff --git a/examples/aws_iot_demo/main/certs/aws-root-ca.pem b/examples/aws_iot_demo/main/certs/aws-root-ca.pem new file mode 100644 index 000000000..a9490be3a --- /dev/null +++ b/examples/aws_iot_demo/main/certs/aws-root-ca.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 +nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex +t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz +SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG +BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ +rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ +NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH +BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv +MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE +p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y +5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK +WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ +4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- \ No newline at end of file diff --git a/examples/check_pedestrian_flow/CMakeLists.txt b/examples/check_pedestrian_flow/CMakeLists.txt new file mode 100644 index 000000000..7fecdd3f8 --- /dev/null +++ b/examples/check_pedestrian_flow/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(check-pedestrian-flow) diff --git a/examples/check_pedestrian_flow/main/CMakeLists.txt b/examples/check_pedestrian_flow/main/CMakeLists.txt new file mode 100644 index 000000000..d64976dd8 --- /dev/null +++ b/examples/check_pedestrian_flow/main/CMakeLists.txt @@ -0,0 +1,6 @@ +set(COMPONENT_SRCS "app_main.c" + "onenet.c") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() \ No newline at end of file diff --git a/examples/check_pedestrian_flow/readme_cn.md b/examples/check_pedestrian_flow/readme_cn.md index b02529379..5e80c7496 100644 --- a/examples/check_pedestrian_flow/readme_cn.md +++ b/examples/check_pedestrian_flow/readme_cn.md @@ -117,9 +117,14 @@ $ export PATH=/opt/xtensa-esp32-elf/bin/:$PATH 编译成功后,会自动烧写程序,同时自动运行程序。 +Make: ``` $ make flash monitor +``` +CMake: +``` +$ idf.py flash monitor ``` ## 2. 结果展示 diff --git a/examples/check_pedestrian_flow/readme_en.md b/examples/check_pedestrian_flow/readme_en.md index da6dd0ac4..8af389bdd 100644 --- a/examples/check_pedestrian_flow/readme_en.md +++ b/examples/check_pedestrian_flow/readme_en.md @@ -121,9 +121,14 @@ $ export PATH=/opt/xtensa-esp32-elf/bin/:$PATH After success of compilation, the program will be downloaded and executed automatically. +Make: ``` $ make flash monitor +``` +CMake: +``` +$ idf.py flash monitor ``` ## 2. Result Demonstration diff --git a/examples/empty_project/CMakeLists.txt b/examples/empty_project/CMakeLists.txt new file mode 100644 index 000000000..9ff11214f --- /dev/null +++ b/examples/empty_project/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(empty-project) diff --git a/examples/empty_project/components/example1/CMakeLists.txt b/examples/empty_project/components/example1/CMakeLists.txt new file mode 100644 index 000000000..533fa6aa4 --- /dev/null +++ b/examples/empty_project/components/example1/CMakeLists.txt @@ -0,0 +1,6 @@ + +set(COMPONENT_SRCS "example1.c") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/examples/empty_project/components/example2/CMakeLists.txt b/examples/empty_project/components/example2/CMakeLists.txt new file mode 100644 index 000000000..ea50b4fe0 --- /dev/null +++ b/examples/empty_project/components/example2/CMakeLists.txt @@ -0,0 +1,5 @@ +set(COMPONENT_SRCS "example2.c") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +register_component() diff --git a/examples/empty_project/main/CMakeLists.txt b/examples/empty_project/main/CMakeLists.txt new file mode 100644 index 000000000..ce64ab7e9 --- /dev/null +++ b/examples/empty_project/main/CMakeLists.txt @@ -0,0 +1,6 @@ + +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/esp32_azure_iot_kit/CMakeLists.txt b/examples/esp32_azure_iot_kit/CMakeLists.txt new file mode 100644 index 000000000..3e65d42f1 --- /dev/null +++ b/examples/esp32_azure_iot_kit/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(esp32_azure_iot_kit) diff --git a/examples/esp32_azure_iot_kit/main/CMakeLists.txt b/examples/esp32_azure_iot_kit/main/CMakeLists.txt new file mode 100644 index 000000000..ce64ab7e9 --- /dev/null +++ b/examples/esp32_azure_iot_kit/main/CMakeLists.txt @@ -0,0 +1,6 @@ + +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/eth2wifi/CMakeLists.txt b/examples/eth2wifi/CMakeLists.txt new file mode 100644 index 000000000..86e25c266 --- /dev/null +++ b/examples/eth2wifi/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(eth2wifi_demo) diff --git a/examples/eth2wifi/README.md b/examples/eth2wifi/README.md index 41e12128f..520c2ceb8 100644 --- a/examples/eth2wifi/README.md +++ b/examples/eth2wifi/README.md @@ -1,6 +1,6 @@ # Ethernet to WiFi data forwarding demo -The demo can enable ethernet to WiFi data forwarding function. You can choose Ethernet to WiFi station or Ethernet to WiFi softap via ```make menuconfig```. +The demo can enable ethernet to WiFi data forwarding function. You can choose Ethernet to WiFi station or Ethernet to WiFi softap via `make menuconfig`(Make) or `idf.py menuconfig`(CMake). ### Ethernet to wifi station data forwarding demo It's like a wireless adapter. You can connect the ESP32 with PC through ethernet, and the PC can access the Internet, if esp32 wifi station connected the router which can access the Internet. diff --git a/examples/eth2wifi/main/CMakeLists.txt b/examples/eth2wifi/main/CMakeLists.txt new file mode 100644 index 000000000..40ad245c4 --- /dev/null +++ b/examples/eth2wifi/main/CMakeLists.txt @@ -0,0 +1,6 @@ + +set(COMPONENT_SRCS "ethernet2wifi_demo_main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/lvgl_coffee/CMakeLists.txt b/examples/hmi/lvgl_coffee/CMakeLists.txt new file mode 100644 index 000000000..4f0258017 --- /dev/null +++ b/examples/hmi/lvgl_coffee/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(lvgl_coffee) diff --git a/examples/hmi/lvgl_coffee/lvgl_coffee_cn.md b/examples/hmi/lvgl_coffee/lvgl_coffee_cn.md index d2541cdcd..a22f9e69d 100644 --- a/examples/hmi/lvgl_coffee/lvgl_coffee_cn.md +++ b/examples/hmi/lvgl_coffee/lvgl_coffee_cn.md @@ -36,9 +36,9 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/lvgl_coffee` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/lvgl_coffee/lvgl_coffee_en.md b/examples/hmi/lvgl_coffee/lvgl_coffee_en.md index 422c3ff4f..22a56c02d 100644 --- a/examples/hmi/lvgl_coffee/lvgl_coffee_en.md +++ b/examples/hmi/lvgl_coffee/lvgl_coffee_en.md @@ -36,9 +36,9 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/lvgl_coffee` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/lvgl_coffee/main/CMakeLists.txt b/examples/hmi/lvgl_coffee/main/CMakeLists.txt new file mode 100644 index 000000000..cf1fb55aa --- /dev/null +++ b/examples/hmi/lvgl_coffee/main/CMakeLists.txt @@ -0,0 +1,9 @@ + +set(COMPONENT_SRCS "app_main.cpp" + "coffee_bean.c" + "coffee_cup.c" + "coffee_flower.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/lvgl_coffee/main/app_main.cpp b/examples/hmi/lvgl_coffee/main/app_main.cpp index 5fce48cac..a2e6b466a 100644 --- a/examples/hmi/lvgl_coffee/main/app_main.cpp +++ b/examples/hmi/lvgl_coffee/main/app_main.cpp @@ -343,7 +343,7 @@ static void create_tab(lv_obj_t *parent, uint8_t wp_img_id, uint8_t coffee_type_ lv_obj_animate(precent_label[id], LV_ANIM_FLOAT_BOTTOM | LV_ANIM_OUT, 400, 0, NULL); /* animation of hide the object */ } -static void tabview_lod_action(lv_obj_t *tabview, uint16_t tab_action_id) +static void tabview_load_action(lv_obj_t *tabview, uint16_t tab_action_id) { tab_id = tab_action_id; } @@ -359,7 +359,7 @@ static void littlevgl_coffee(void) tab[0] = lv_tabview_add_tab(tabview, "RIS"); /* add RIS tab */ tab[1] = lv_tabview_add_tab(tabview, "ESP"); /* add ESP tab */ tab[2] = lv_tabview_add_tab(tabview, "AME"); /* add AME tab */ - lv_tabview_set_tab_load_action(tabview, tabview_lod_action); + lv_tabview_set_tab_load_action(tabview, tabview_load_action); lv_obj_set_protect(tabview, LV_PROTECT_PARENT | LV_PROTECT_POS | LV_PROTECT_FOLLOW); lv_tabview_set_anim_time(tabview, 0); diff --git a/examples/hmi/lvgl_example/CMakeLists.txt b/examples/hmi/lvgl_example/CMakeLists.txt new file mode 100644 index 000000000..8a8721227 --- /dev/null +++ b/examples/hmi/lvgl_example/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(lvgl_example) diff --git a/examples/hmi/lvgl_example/lvgl_example_cn.md b/examples/hmi/lvgl_example/lvgl_example_cn.md index b1d61d054..9c052c171 100644 --- a/examples/hmi/lvgl_example/lvgl_example_cn.md +++ b/examples/hmi/lvgl_example/lvgl_example_cn.md @@ -36,9 +36,9 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/lvgl_example` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/lvgl_example/lvgl_example_en.md b/examples/hmi/lvgl_example/lvgl_example_en.md index 20e62948b..438a0709f 100644 --- a/examples/hmi/lvgl_example/lvgl_example_en.md +++ b/examples/hmi/lvgl_example/lvgl_example_en.md @@ -36,9 +36,9 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/lvgl_example` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/lvgl_example/main/CMakeLists.txt b/examples/hmi/lvgl_example/main/CMakeLists.txt new file mode 100644 index 000000000..3f799913c --- /dev/null +++ b/examples/hmi/lvgl_example/main/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "app_main.cpp" + "lv_test_theme.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/lvgl_thermostat/CMakeLists.txt b/examples/hmi/lvgl_thermostat/CMakeLists.txt new file mode 100644 index 000000000..291341805 --- /dev/null +++ b/examples/hmi/lvgl_thermostat/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(lvgl_thermostat) diff --git a/examples/hmi/lvgl_thermostat/lvgl_thermostat_cn.md b/examples/hmi/lvgl_thermostat/lvgl_thermostat_cn.md index 7ac7fb7fb..7131fedb0 100644 --- a/examples/hmi/lvgl_thermostat/lvgl_thermostat_cn.md +++ b/examples/hmi/lvgl_thermostat/lvgl_thermostat_cn.md @@ -36,9 +36,9 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/lvgl_thermostat` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/lvgl_thermostat/lvgl_thermostat_en.md b/examples/hmi/lvgl_thermostat/lvgl_thermostat_en.md index ae443c313..21081e845 100644 --- a/examples/hmi/lvgl_thermostat/lvgl_thermostat_en.md +++ b/examples/hmi/lvgl_thermostat/lvgl_thermostat_en.md @@ -36,9 +36,9 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/lvgl_thermostat` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/lvgl_thermostat/main/CMakeLists.txt b/examples/hmi/lvgl_thermostat/main/CMakeLists.txt new file mode 100644 index 000000000..2e8b1db21 --- /dev/null +++ b/examples/hmi/lvgl_thermostat/main/CMakeLists.txt @@ -0,0 +1,9 @@ + +set(COMPONENT_SRCS "app_main.cpp" + "img_day.c" + "img_night.c" + "img_snow.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/lvgl_wificonfig/CMakeLists.txt b/examples/hmi/lvgl_wificonfig/CMakeLists.txt new file mode 100644 index 000000000..a56260c94 --- /dev/null +++ b/examples/hmi/lvgl_wificonfig/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(lvgl_wificonfig) diff --git a/examples/hmi/lvgl_wificonfig/lvgl_wificonfig_cn.md b/examples/hmi/lvgl_wificonfig/lvgl_wificonfig_cn.md index d7096e098..94e5f9ae2 100644 --- a/examples/hmi/lvgl_wificonfig/lvgl_wificonfig_cn.md +++ b/examples/hmi/lvgl_wificonfig/lvgl_wificonfig_cn.md @@ -36,9 +36,9 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/lvgl_wificonfig` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/lvgl_wificonfig/lvgl_wificonfig_en.md b/examples/hmi/lvgl_wificonfig/lvgl_wificonfig_en.md index d23bf7cf3..c025774a6 100644 --- a/examples/hmi/lvgl_wificonfig/lvgl_wificonfig_en.md +++ b/examples/hmi/lvgl_wificonfig/lvgl_wificonfig_en.md @@ -36,9 +36,9 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/lvgl_wificonfig` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/lvgl_wificonfig/main/CMakeLists.txt b/examples/hmi/lvgl_wificonfig/main/CMakeLists.txt new file mode 100644 index 000000000..e78c783ac --- /dev/null +++ b/examples/hmi/lvgl_wificonfig/main/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "app_main.c" + "password_eye_20.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/mp3_example/CMakeLists.txt b/examples/hmi/mp3_example/CMakeLists.txt new file mode 100644 index 000000000..be05c30ae --- /dev/null +++ b/examples/hmi/mp3_example/CMakeLists.txt @@ -0,0 +1,27 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +#add ADF_PATH +# set(ADF_VER $(shell cd $ENV{ADF_PATH} && git describe --always --tags --dirty)) +# set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS}" "$ENV{ADF_PATH}/components") +# component_compile_options(-D ADF_VER=\"$(ADF_VER)\") + +# When using these commands, +# place them after the register_component() line in the component CMakeLists file. +# component_compile_options/set_source_files_properties + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(lvgl_mp3) diff --git a/examples/hmi/mp3_example/main/CMakeLists.txt b/examples/hmi/mp3_example/main/CMakeLists.txt new file mode 100644 index 000000000..860b53050 --- /dev/null +++ b/examples/hmi/mp3_example/main/CMakeLists.txt @@ -0,0 +1,6 @@ + +set(COMPONENT_SRCS "app_main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/mp3_example/mp3_example_cn.md b/examples/hmi/mp3_example/mp3_example_cn.md index 1ec3f0966..a463b1ff4 100644 --- a/examples/hmi/mp3_example/mp3_example_cn.md +++ b/examples/hmi/mp3_example/mp3_example_cn.md @@ -54,15 +54,15 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/mp3_example` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ### 使用 ESP-ADF 播放 MP3 音频文件 - 根据 [Get Started](https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html) 搭建 ESP-ADF 开发环境、Example 中使用了 ADF_PATH 环境变量 -- 运行 `make menuconfig` 选择使用 ADF 播放音频文件,目录:`IoT Example - LittlevGL MP3 Example->Use esp-adf to play song` -- 保存配置并运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 选择使用 ADF 播放音频文件,目录:`IoT Example - LittlevGL MP3 Example->Use esp-adf to play song` +- 保存配置并运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 #### SD-Card、Audio 使用 diff --git a/examples/hmi/mp3_example/mp3_example_en.md b/examples/hmi/mp3_example/mp3_example_en.md index ea46562f2..7afaa5076 100644 --- a/examples/hmi/mp3_example/mp3_example_en.md +++ b/examples/hmi/mp3_example/mp3_example_en.md @@ -54,15 +54,15 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/mp3_example` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ### Play MP3 files with ESP-ADF - Build ESP-ADF development environment according to [Get Started](https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html). The environment variable `ADF_PATH` is used in the example. -- Run `make menuconfig` and select ADF for playing the audio files. To do this, please go to `IoT Example - LittlevGL MP3 Example->Use esp-adf to play song`. -- Save the configuration and run `make -j8 flash` to build the example and flash it to the device. +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) and select ADF for playing the audio files. To do this, please go to `IoT Example - LittlevGL MP3 Example->Use esp-adf to play song`. +- Save the configuration and run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device. #### SD-Card and audio related notes diff --git a/examples/hmi/ugfx_bubbles/CMakeLists.txt b/examples/hmi/ugfx_bubbles/CMakeLists.txt new file mode 100644 index 000000000..59a10005e --- /dev/null +++ b/examples/hmi/ugfx_bubbles/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ugfx_bubbles) diff --git a/examples/hmi/ugfx_bubbles/main/CMakeLists.txt b/examples/hmi/ugfx_bubbles/main/CMakeLists.txt new file mode 100644 index 000000000..e885006f2 --- /dev/null +++ b/examples/hmi/ugfx_bubbles/main/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "main.c" + "ugfx_bubble.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/ugfx_bubbles/ugfx_bubbles_cn.md b/examples/hmi/ugfx_bubbles/ugfx_bubbles_cn.md index ea37e4c8b..bd8142e62 100644 --- a/examples/hmi/ugfx_bubbles/ugfx_bubbles_cn.md +++ b/examples/hmi/ugfx_bubbles/ugfx_bubbles_cn.md @@ -36,9 +36,9 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/ugfx_bubbles` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/ugfx_bubbles/ugfx_bubbles_en.md b/examples/hmi/ugfx_bubbles/ugfx_bubbles_en.md index 2b7e9795f..0d1f6b036 100644 --- a/examples/hmi/ugfx_bubbles/ugfx_bubbles_en.md +++ b/examples/hmi/ugfx_bubbles/ugfx_bubbles_en.md @@ -36,9 +36,9 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/ugfx_bubbles` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/ugfx_example/CMakeLists.txt b/examples/hmi/ugfx_example/CMakeLists.txt new file mode 100644 index 000000000..4acc6a2b5 --- /dev/null +++ b/examples/hmi/ugfx_example/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ugfx_example) diff --git a/examples/hmi/ugfx_example/main/CMakeLists.txt b/examples/hmi/ugfx_example/main/CMakeLists.txt new file mode 100644 index 000000000..843d661b9 --- /dev/null +++ b/examples/hmi/ugfx_example/main/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "ugfx_example.c" + "ugfx_gui_gwin.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/ugfx_example/ugfx_example_cn.md b/examples/hmi/ugfx_example/ugfx_example_cn.md index 12debc275..84a180d9e 100644 --- a/examples/hmi/ugfx_example/ugfx_example_cn.md +++ b/examples/hmi/ugfx_example/ugfx_example_cn.md @@ -37,9 +37,9 @@ D7 | 27 | D15 | 4 ## 运行示例 - 进入到 `examples/hmi/ugfx_example` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/ugfx_example/ugfx_example_en.md b/examples/hmi/ugfx_example/ugfx_example_en.md index 67f7de37e..1526595c6 100644 --- a/examples/hmi/ugfx_example/ugfx_example_en.md +++ b/examples/hmi/ugfx_example/ugfx_example_en.md @@ -37,9 +37,9 @@ D7 | 27 | D15 | 4 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/ugfx_example` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/ugfx_justget/CMakeLists.txt b/examples/hmi/ugfx_justget/CMakeLists.txt new file mode 100644 index 000000000..dc224bb29 --- /dev/null +++ b/examples/hmi/ugfx_justget/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ugfx_justget) diff --git a/examples/hmi/ugfx_justget/main/CMakeLists.txt b/examples/hmi/ugfx_justget/main/CMakeLists.txt new file mode 100644 index 000000000..a118bef25 --- /dev/null +++ b/examples/hmi/ugfx_justget/main/CMakeLists.txt @@ -0,0 +1,8 @@ + +set(COMPONENT_SRCS "jg10.c" + "main.c" + "ugfx_justget.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/ugfx_justget/ugfx_justget_cn.md b/examples/hmi/ugfx_justget/ugfx_justget_cn.md index 627c79b65..352b531f5 100644 --- a/examples/hmi/ugfx_justget/ugfx_justget_cn.md +++ b/examples/hmi/ugfx_justget/ugfx_justget_cn.md @@ -36,9 +36,9 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/ugfx_justget` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/ugfx_justget/ugfx_justget_en.md b/examples/hmi/ugfx_justget/ugfx_justget_en.md index 1285763e9..f36c44f0a 100644 --- a/examples/hmi/ugfx_justget/ugfx_justget_en.md +++ b/examples/hmi/ugfx_justget/ugfx_justget_en.md @@ -36,9 +36,9 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/ugfx_justget` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/ugfx_keyboard/CMakeLists.txt b/examples/hmi/ugfx_keyboard/CMakeLists.txt new file mode 100644 index 000000000..b78d5df01 --- /dev/null +++ b/examples/hmi/ugfx_keyboard/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ugfx_keyboard) diff --git a/examples/hmi/ugfx_keyboard/main/CMakeLists.txt b/examples/hmi/ugfx_keyboard/main/CMakeLists.txt new file mode 100644 index 000000000..de2517302 --- /dev/null +++ b/examples/hmi/ugfx_keyboard/main/CMakeLists.txt @@ -0,0 +1,8 @@ + +set(COMPONENT_SRCS "gui.c" + "main.c" + "ugfx_keyboard.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/ugfx_keyboard/ugfx_keyboard_cn.md b/examples/hmi/ugfx_keyboard/ugfx_keyboard_cn.md index cb5148b83..138875416 100644 --- a/examples/hmi/ugfx_keyboard/ugfx_keyboard_cn.md +++ b/examples/hmi/ugfx_keyboard/ugfx_keyboard_cn.md @@ -36,9 +36,9 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/ugfx_keyboard` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/ugfx_keyboard/ugfx_keyboard_en.md b/examples/hmi/ugfx_keyboard/ugfx_keyboard_en.md index bf0db2687..3057662df 100644 --- a/examples/hmi/ugfx_keyboard/ugfx_keyboard_en.md +++ b/examples/hmi/ugfx_keyboard/ugfx_keyboard_en.md @@ -36,9 +36,9 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/ugfx_keyboard` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/ugfx_minesweeper/CMakeLists.txt b/examples/hmi/ugfx_minesweeper/CMakeLists.txt new file mode 100644 index 000000000..ab19ff446 --- /dev/null +++ b/examples/hmi/ugfx_minesweeper/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ugfx_minesweeper) diff --git a/examples/hmi/ugfx_minesweeper/main/CMakeLists.txt b/examples/hmi/ugfx_minesweeper/main/CMakeLists.txt new file mode 100644 index 000000000..a7989f949 --- /dev/null +++ b/examples/hmi/ugfx_minesweeper/main/CMakeLists.txt @@ -0,0 +1,7 @@ + +set(COMPONENT_SRCS "ugfx_minesweeper.c" + "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/ugfx_minesweeper/ugfx_minesweeper_cn.md b/examples/hmi/ugfx_minesweeper/ugfx_minesweeper_cn.md index eedd4869a..a78ce09fb 100644 --- a/examples/hmi/ugfx_minesweeper/ugfx_minesweeper_cn.md +++ b/examples/hmi/ugfx_minesweeper/ugfx_minesweeper_cn.md @@ -36,9 +36,9 @@ IRQ | 33 ## 运行示例 - 进入到 `examples/hmi/ugfx_minesweeper` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/ugfx_minesweeper/ugfx_minesweeper_en.md b/examples/hmi/ugfx_minesweeper/ugfx_minesweeper_en.md index 8cc55d82a..5b537b814 100644 --- a/examples/hmi/ugfx_minesweeper/ugfx_minesweeper_en.md +++ b/examples/hmi/ugfx_minesweeper/ugfx_minesweeper_en.md @@ -36,9 +36,9 @@ IRQ | 33 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/ugfx_minesweeper` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/hmi/ugfx_sokoban/CMakeLists.txt b/examples/hmi/ugfx_sokoban/CMakeLists.txt new file mode 100644 index 000000000..53570d6f3 --- /dev/null +++ b/examples/hmi/ugfx_sokoban/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ugfx_sokoban) diff --git a/examples/hmi/ugfx_sokoban/main/CMakeLists.txt b/examples/hmi/ugfx_sokoban/main/CMakeLists.txt new file mode 100644 index 000000000..6233f7763 --- /dev/null +++ b/examples/hmi/ugfx_sokoban/main/CMakeLists.txt @@ -0,0 +1,8 @@ + +set(COMPONENT_SRCS "sokoban.c" + "ugfx_sokoban.c" + "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/hmi/ugfx_sokoban/ugfx_sokoban_cn.md b/examples/hmi/ugfx_sokoban/ugfx_sokoban_cn.md index 4d176e0ab..71c2c2959 100644 --- a/examples/hmi/ugfx_sokoban/ugfx_sokoban_cn.md +++ b/examples/hmi/ugfx_sokoban/ugfx_sokoban_cn.md @@ -37,9 +37,9 @@ D7 | 27 | D15 | 4 ## 运行示例 - 进入到 `examples/hmi/ugfx_sokoban` 目录下 -- 运行 `make defconfig` 使用默认配置 -- 运行 `make menuconfig` 进行烧录相关配置 -- 运行 `make -j8 flash` 编译、烧录程序到设备 +- 运行 `make defconfig`(Make) 或者 `idf.py defconfig`(CMake) 使用默认配置 +- 运行 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 进行烧录相关配置 +- 运行 `make -j8 flash`(Make) 或者 `idf.py flash`(CMake) 编译、烧录程序到设备 ## 示例结果 diff --git a/examples/hmi/ugfx_sokoban/ugfx_sokoban_en.md b/examples/hmi/ugfx_sokoban/ugfx_sokoban_en.md index 49cce5ed2..2991db3da 100644 --- a/examples/hmi/ugfx_sokoban/ugfx_sokoban_en.md +++ b/examples/hmi/ugfx_sokoban/ugfx_sokoban_en.md @@ -37,9 +37,9 @@ D7 | 27 | D15 | 4 ## Run the Example - Open Terminal and navigate to the directory `examples/hmi/ugfx_sokoban` -- Run `make defconfig` to apply the default configuration -- Run `make menuconfig` to set up the flashing-related configuration -- Run `make -j8 flash` to build the example and flash it to the device +- Run `make defconfig`(Make) or `idf.py defconfig`(CMake) to apply the default configuration +- Run `make menuconfig`(Make) or `idf.py menuconfig`(CMake) to set up the flashing-related configuration +- Run `make -j8 flash`(Make) or `idf.py flash`(CMake) to build the example and flash it to the device ## Example Demonstration diff --git a/examples/lowpower_evb/CMakeLists.txt b/examples/lowpower_evb/CMakeLists.txt new file mode 100644 index 000000000..784a59358 --- /dev/null +++ b/examples/lowpower_evb/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(lowpower_evb_demo) diff --git a/examples/lowpower_evb/components/lowpower_evb_callback/CMakeLists.txt b/examples/lowpower_evb/components/lowpower_evb_callback/CMakeLists.txt new file mode 100644 index 000000000..dd05e65db --- /dev/null +++ b/examples/lowpower_evb/components/lowpower_evb_callback/CMakeLists.txt @@ -0,0 +1,8 @@ + +set(COMPONENT_SRCS "lowpower_evb_callback.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +set(COMPONENT_REQUIRES wifi_conn tcp smart_config lowpower_framework lowpower_evb_peripherals lowpower_evb_ulp lowpower_evb_wifi) + +register_component() diff --git a/examples/lowpower_evb/components/lowpower_evb_peripherals/CMakeLists.txt b/examples/lowpower_evb/components/lowpower_evb_peripherals/CMakeLists.txt new file mode 100644 index 000000000..676ef98e0 --- /dev/null +++ b/examples/lowpower_evb/components/lowpower_evb_peripherals/CMakeLists.txt @@ -0,0 +1,12 @@ + +set(COMPONENT_SRCS "lowpower_evb_adc.cpp" + "lowpower_evb_epaper.cpp" + "lowpower_evb_power.cpp" + "lowpower_evb_sensor.cpp" + "lowpower_evb_status_led.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +set(COMPONENT_REQUIRES esp_adc_cal epaper hts221 ulp led bh1750) + +register_component() diff --git a/examples/lowpower_evb/components/lowpower_evb_ulp/CMakeLists.txt b/examples/lowpower_evb/components/lowpower_evb_ulp/CMakeLists.txt new file mode 100644 index 000000000..ac9424e05 --- /dev/null +++ b/examples/lowpower_evb/components/lowpower_evb_ulp/CMakeLists.txt @@ -0,0 +1,33 @@ + +set(COMPONENT_SRCS "lowpower_evb_ulp_opt.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +set(COMPONENT_REQUIRES soc lowpower_framework ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/bh1750.S" + "ulp/hts221.S" + "ulp/i2c_dev.S" + "ulp/i2c.S" + "ulp/stack.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "lowpower_evb_ulp_opt.cpp") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/lowpower_evb/components/lowpower_evb_ulp/lowpower_evb_ulp_opt.cpp b/examples/lowpower_evb/components/lowpower_evb_ulp/lowpower_evb_ulp_opt.cpp index fc0e1ec05..6b994f29c 100644 --- a/examples/lowpower_evb/components/lowpower_evb_ulp/lowpower_evb_ulp_opt.cpp +++ b/examples/lowpower_evb/components/lowpower_evb_ulp/lowpower_evb_ulp_opt.cpp @@ -17,11 +17,11 @@ #include "soc/sens_reg.h" #include "driver/rtc_io.h" #include "esp32/ulp.h" -#include "lowpower_evb_ulp.h" +#include "ulp_lowpower_evb_ulp.h" #include "lowpower_evb_ulp_opt.h" -extern const uint8_t ulp_main_bin_start[] asm("_binary_lowpower_evb_ulp_bin_start"); -extern const uint8_t ulp_main_bin_end[] asm("_binary_lowpower_evb_ulp_bin_end"); +extern const uint8_t ulp_main_bin_start[] asm("_binary_ulp_lowpower_evb_ulp_bin_start"); +extern const uint8_t ulp_main_bin_end[] asm("_binary_ulp_lowpower_evb_ulp_bin_end"); /* This function is called once after power-on reset, to load ULP program into * RTC memory. diff --git a/examples/lowpower_evb/components/lowpower_evb_wifi/CMakeLists.txt b/examples/lowpower_evb/components/lowpower_evb_wifi/CMakeLists.txt new file mode 100644 index 000000000..7f88e7ff4 --- /dev/null +++ b/examples/lowpower_evb/components/lowpower_evb_wifi/CMakeLists.txt @@ -0,0 +1,8 @@ + +set(COMPONENT_SRCS "lowpower_evb_wifi.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +set(COMPONENT_REQUIRES lowpower_framework smart_config button param) + +register_component() diff --git a/examples/lowpower_evb/main/CMakeLists.txt b/examples/lowpower_evb/main/CMakeLists.txt new file mode 100644 index 000000000..b09a1d3c9 --- /dev/null +++ b/examples/lowpower_evb/main/CMakeLists.txt @@ -0,0 +1,6 @@ + +set(COMPONENT_SRCS "main.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() \ No newline at end of file diff --git a/examples/oled_screen_module/CMakeLists.txt b/examples/oled_screen_module/CMakeLists.txt new file mode 100644 index 000000000..b1b856a18 --- /dev/null +++ b/examples/oled_screen_module/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(screen_demo) diff --git a/examples/oled_screen_module/main/CMakeLists.txt b/examples/oled_screen_module/main/CMakeLists.txt new file mode 100644 index 000000000..b0a7a3ef9 --- /dev/null +++ b/examples/oled_screen_module/main/CMakeLists.txt @@ -0,0 +1,10 @@ + +set(COMPONENT_SRCS "app_oled.cpp" + "app_power.cpp" + "main.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ". include") + +set(COMPONENT_REQUIRES touchpad ssd1306 apds9960 hts221 wifi_conn) + +register_component() diff --git a/examples/oled_screen_module/readme_cn.md b/examples/oled_screen_module/readme_cn.md index 4dd4153d1..c7d83cbdc 100644 --- a/examples/oled_screen_module/readme_cn.md +++ b/examples/oled_screen_module/readme_cn.md @@ -117,17 +117,30 @@ VDD33 为 LDO VOUT 3.3V 端,做为 ESP32、外设、 flash 电源;VDD33\_Per 执行以下指令进行编译配置,如串口号和串口下载速度可以在 `Serial flasher config` 这一菜单选项中进行配置(如果不需配置, 可跳过这一步)。 +Make: ``` cd YOUR_IOT_SOLUTION_PATH/examples/oled_screen_module make menuconfig ``` +CMake: +``` + cd YOUR_IOT_SOLUTION_PATH/examples/oled_screen_module + idf.py menuconfig +``` + * 编译,烧写与运行 执行下面指令,编译 oled\_screen\_module,以下命令中的 flash 是下载命令,monitor 表示开启系统打印,可根据实际情况选择添加。 +Make: ``` make flash monitor ``` +CMake: +``` + idf.py flash monitor +``` + > 注:下载程序时,如果无法自动开始下载,可以尝试手动进入下载模式。下载固件完成后,按开发板上的 reset 键重新运行程序,可以查看串口打印。 diff --git a/examples/oled_screen_module/readme_en.md b/examples/oled_screen_module/readme_en.md index 62993db71..02ba9d9d4 100644 --- a/examples/oled_screen_module/readme_en.md +++ b/examples/oled_screen_module/readme_en.md @@ -117,17 +117,30 @@ After downloading all the submodules, you can compile and run the oled_screen_mo Run the following command to configure the serial port settings. Set the port number and download speed by configuring `Serial flasher config` option. +Make: ``` cd YOUR_IOT_SOLUTION_PATH/examples/oled_screen_module make menuconfig ``` +CMake: +``` + cd YOUR_IOT_SOLUTION_PATH/examples/oled_screen_module + idf.py menuconfig +``` + * Compile, download and run the program. Run the following command to compile `oled_screen_module`. `flash` in the command enables downloading, while the optional `monitor` enables system printing. +Make: ``` make flash monitor ``` +CMake: +``` + idf.py flash monitor +``` + > Note: If the program cannot be downloaded automatically, you can download it mannually. After downloading, press the reset button on the board to run the program and check the logs on the serial port. diff --git a/examples/smart_device/alink_smart_device_demo/CMakeLists.txt b/examples/smart_device/alink_smart_device_demo/CMakeLists.txt new file mode 100644 index 000000000..726a289ec --- /dev/null +++ b/examples/smart_device/alink_smart_device_demo/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(smart_device) diff --git a/examples/smart_device/alink_smart_device_demo/Makefile b/examples/smart_device/alink_smart_device_demo/Makefile index c1fbb6f25..384853ffe 100644 --- a/examples/smart_device/alink_smart_device_demo/Makefile +++ b/examples/smart_device/alink_smart_device_demo/Makefile @@ -6,8 +6,6 @@ PROJECT_NAME := smart_device #If IOT_SOLUTION_PATH is not defined, use relative path as default value IOT_SOLUTION_PATH ?= $(abspath $(shell pwd)/../../) - -EXTRA_COMPONENT_DIRS := $(shell pwd)/abstract -EXTRA_COMPONENT_DIRS += $(shell pwd)/products + include $(IOT_SOLUTION_PATH)/Makefile include $(IDF_PATH)/make/project.mk \ No newline at end of file diff --git a/examples/smart_device/alink_smart_device_demo/components/abstract/CMakeLists.txt b/examples/smart_device/alink_smart_device_demo/components/abstract/CMakeLists.txt new file mode 100644 index 000000000..8796a4740 --- /dev/null +++ b/examples/smart_device/alink_smart_device_demo/components/abstract/CMakeLists.txt @@ -0,0 +1,12 @@ + +set(COMPONENT_SRCS "cloud/cloud.c" + "device/device.c" + "parse/parse.c") + +set(COMPONENT_ADD_INCLUDEDIRS "cloud/include" + "device/include" + "parse/include") + +set(COMPONENT_REQUIRES alink button light products) + +register_component() diff --git a/examples/smart_device/alink_smart_device_demo/abstract/cloud/cloud.c b/examples/smart_device/alink_smart_device_demo/components/abstract/cloud/cloud.c similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/cloud/cloud.c rename to examples/smart_device/alink_smart_device_demo/components/abstract/cloud/cloud.c diff --git a/examples/smart_device/alink_smart_device_demo/abstract/cloud/component.mk b/examples/smart_device/alink_smart_device_demo/components/abstract/cloud/component.mk similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/cloud/component.mk rename to examples/smart_device/alink_smart_device_demo/components/abstract/cloud/component.mk diff --git a/examples/smart_device/alink_smart_device_demo/abstract/cloud/include/cloud.h b/examples/smart_device/alink_smart_device_demo/components/abstract/cloud/include/cloud.h similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/cloud/include/cloud.h rename to examples/smart_device/alink_smart_device_demo/components/abstract/cloud/include/cloud.h diff --git a/examples/smart_device/alink_smart_device_demo/abstract/component.mk b/examples/smart_device/alink_smart_device_demo/components/abstract/component.mk similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/component.mk rename to examples/smart_device/alink_smart_device_demo/components/abstract/component.mk diff --git a/examples/smart_device/alink_smart_device_demo/abstract/device/component.mk b/examples/smart_device/alink_smart_device_demo/components/abstract/device/component.mk similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/device/component.mk rename to examples/smart_device/alink_smart_device_demo/components/abstract/device/component.mk diff --git a/examples/smart_device/alink_smart_device_demo/abstract/device/device.c b/examples/smart_device/alink_smart_device_demo/components/abstract/device/device.c similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/device/device.c rename to examples/smart_device/alink_smart_device_demo/components/abstract/device/device.c diff --git a/examples/smart_device/alink_smart_device_demo/abstract/device/include/device.h b/examples/smart_device/alink_smart_device_demo/components/abstract/device/include/device.h similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/device/include/device.h rename to examples/smart_device/alink_smart_device_demo/components/abstract/device/include/device.h diff --git a/examples/smart_device/alink_smart_device_demo/abstract/parse/component.mk b/examples/smart_device/alink_smart_device_demo/components/abstract/parse/component.mk similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/parse/component.mk rename to examples/smart_device/alink_smart_device_demo/components/abstract/parse/component.mk diff --git a/examples/smart_device/alink_smart_device_demo/abstract/parse/include/parse.h b/examples/smart_device/alink_smart_device_demo/components/abstract/parse/include/parse.h similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/parse/include/parse.h rename to examples/smart_device/alink_smart_device_demo/components/abstract/parse/include/parse.h diff --git a/examples/smart_device/alink_smart_device_demo/abstract/parse/parse.c b/examples/smart_device/alink_smart_device_demo/components/abstract/parse/parse.c similarity index 100% rename from examples/smart_device/alink_smart_device_demo/abstract/parse/parse.c rename to examples/smart_device/alink_smart_device_demo/components/abstract/parse/parse.c diff --git a/examples/smart_device/alink_smart_device_demo/components/products/CMakeLists.txt b/examples/smart_device/alink_smart_device_demo/components/products/CMakeLists.txt new file mode 100644 index 000000000..41c4f37b9 --- /dev/null +++ b/examples/smart_device/alink_smart_device_demo/components/products/CMakeLists.txt @@ -0,0 +1,10 @@ + +set(COMPONENT_SRCS "plug_device/plug_device.c" + "light_device/light_device.c") + +set(COMPONENT_ADD_INCLUDEDIRS "plug_device/include" + "light_device/include") + +set(COMPONENT_REQUIRES touchpad button led light power_meter param relay) + +register_component() diff --git a/examples/smart_device/alink_smart_device_demo/products/plug_device/component.mk b/examples/smart_device/alink_smart_device_demo/components/products/component.mk similarity index 54% rename from examples/smart_device/alink_smart_device_demo/products/plug_device/component.mk rename to examples/smart_device/alink_smart_device_demo/components/products/component.mk index 0b9d7585e..7e75b36bd 100644 --- a/examples/smart_device/alink_smart_device_demo/products/plug_device/component.mk +++ b/examples/smart_device/alink_smart_device_demo/components/products/component.mk @@ -3,3 +3,5 @@ # # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) +COMPONENT_ADD_INCLUDEDIRS := include light_device/include plug_device/include +COMPONENT_SRCDIRS := light_device plug_device diff --git a/examples/smart_device/alink_smart_device_demo/products/component.mk b/examples/smart_device/alink_smart_device_demo/components/products/light_device/component.mk similarity index 100% rename from examples/smart_device/alink_smart_device_demo/products/component.mk rename to examples/smart_device/alink_smart_device_demo/components/products/light_device/component.mk diff --git a/examples/smart_device/alink_smart_device_demo/products/light_device/include/light_config.h b/examples/smart_device/alink_smart_device_demo/components/products/light_device/include/light_config.h similarity index 100% rename from examples/smart_device/alink_smart_device_demo/products/light_device/include/light_config.h rename to examples/smart_device/alink_smart_device_demo/components/products/light_device/include/light_config.h diff --git a/examples/smart_device/alink_smart_device_demo/products/light_device/include/light_device.h b/examples/smart_device/alink_smart_device_demo/components/products/light_device/include/light_device.h similarity index 100% rename from examples/smart_device/alink_smart_device_demo/products/light_device/include/light_device.h rename to examples/smart_device/alink_smart_device_demo/components/products/light_device/include/light_device.h diff --git a/examples/smart_device/alink_smart_device_demo/products/light_device/light_device.c b/examples/smart_device/alink_smart_device_demo/components/products/light_device/light_device.c similarity index 100% rename from examples/smart_device/alink_smart_device_demo/products/light_device/light_device.c rename to examples/smart_device/alink_smart_device_demo/components/products/light_device/light_device.c diff --git a/examples/smart_device/alink_smart_device_demo/products/light_device/component.mk b/examples/smart_device/alink_smart_device_demo/components/products/plug_device/component.mk similarity index 100% rename from examples/smart_device/alink_smart_device_demo/products/light_device/component.mk rename to examples/smart_device/alink_smart_device_demo/components/products/plug_device/component.mk diff --git a/examples/smart_device/alink_smart_device_demo/products/plug_device/include/plug_config.h b/examples/smart_device/alink_smart_device_demo/components/products/plug_device/include/plug_config.h similarity index 100% rename from examples/smart_device/alink_smart_device_demo/products/plug_device/include/plug_config.h rename to examples/smart_device/alink_smart_device_demo/components/products/plug_device/include/plug_config.h diff --git a/examples/smart_device/alink_smart_device_demo/products/plug_device/include/plug_device.h b/examples/smart_device/alink_smart_device_demo/components/products/plug_device/include/plug_device.h similarity index 100% rename from examples/smart_device/alink_smart_device_demo/products/plug_device/include/plug_device.h rename to examples/smart_device/alink_smart_device_demo/components/products/plug_device/include/plug_device.h diff --git a/examples/smart_device/alink_smart_device_demo/products/plug_device/plug_device.c b/examples/smart_device/alink_smart_device_demo/components/products/plug_device/plug_device.c similarity index 100% rename from examples/smart_device/alink_smart_device_demo/products/plug_device/plug_device.c rename to examples/smart_device/alink_smart_device_demo/components/products/plug_device/plug_device.c diff --git a/examples/smart_device/alink_smart_device_demo/main/CMakeLists.txt b/examples/smart_device/alink_smart_device_demo/main/CMakeLists.txt new file mode 100644 index 000000000..37640f6a3 --- /dev/null +++ b/examples/smart_device/alink_smart_device_demo/main/CMakeLists.txt @@ -0,0 +1,9 @@ + +set(COMPONENT_SRCS "alink_key_trigger.c" + "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +set(COMPONENT_REQUIRES alink touchpad button ssd1306 apds9960 hts221 wifi_conn abstract products) + +register_component() diff --git a/examples/smart_device/alink_smart_device_demo/readme_cn.md b/examples/smart_device/alink_smart_device_demo/readme_cn.md index d18f4ed01..79f3260e9 100644 --- a/examples/smart_device/alink_smart_device_demo/readme_cn.md +++ b/examples/smart_device/alink_smart_device_demo/readme_cn.md @@ -9,7 +9,7 @@ * 阿里智能厂测包:下载请点击[这里](https://open.aliplus.com/download/?spm=0.0.0.0.7OBTZm) ## 2. 相关配置 -可以通过 `make menuconfig` 修改 Alink embed 工程的一些相关配置: +可以通过 `make menuconfig`(Make) 或者 `idf.py menuconfig`(CMake) 修改 Alink embed 工程的一些相关配置: * 在 `IoT Solution settings -> IoT Components Management -> Platforms and Clouds -> ALINK ENABLE -> ALINK_SETTINGS` 下可以选择 Alink 的版本(embed 或 sds),并配置 Alink sdk 内部的一些关键参数,例如连接路由的超时时间,一些关键任务的优先级和使用的栈空间的大小,log 等级等等。 diff --git a/examples/smart_device/alink_smart_device_demo/readme_en.md b/examples/smart_device/alink_smart_device_demo/readme_en.md index 662751627..137546335 100644 --- a/examples/smart_device/alink_smart_device_demo/readme_en.md +++ b/examples/smart_device/alink_smart_device_demo/readme_en.md @@ -9,7 +9,7 @@ * Aliyun App (beta): [Download it here](https://open.aliplus.com/download/?spm=0.0.0.0.7OBTZm) ## 2. How to configure parameters -The configuration of the Alink embed project can be modified at `make menuconfig`: +The configuration of the Alink embed project can be modified at `make menuconfig`(Make) or `idf.py menuconfig`(CMake): * Go to `IoT Solution settings -> IoT Components Management -> Platforms and Clouds -> ALINK ENABLE -> ALINK_SETTINGS`, select the version of Alink (embed or SDS), and configure the key parameters of the Alink SDK, such as the connection timeout, the priority level for key tasks, the size of the used stack, the log level and so on. diff --git a/examples/touch_pad_evb/CMakeLists.txt b/examples/touch_pad_evb/CMakeLists.txt new file mode 100644 index 000000000..6b3bf0364 --- /dev/null +++ b/examples/touch_pad_evb/CMakeLists.txt @@ -0,0 +1,20 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +# set(COMPONENT_PRIV_INCLUDEDIRS ${PROJECT_PATH}/abstract ${PROJECT_PATH}/products) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(touch_pad_evb) diff --git a/examples/touch_pad_evb/Makefile b/examples/touch_pad_evb/Makefile index b8ea87366..f11cc484f 100644 --- a/examples/touch_pad_evb/Makefile +++ b/examples/touch_pad_evb/Makefile @@ -3,7 +3,7 @@ # project subdirectory. # -PROJECT_NAME := empty_project +PROJECT_NAME := touch_pad_evb #If IOT_SOLUTION_PATH is not defined, use relative path as default value IOT_SOLUTION_PATH ?= $(abspath $(shell pwd)/../../) diff --git a/examples/touch_pad_evb/main/CMakeLists.txt b/examples/touch_pad_evb/main/CMakeLists.txt new file mode 100644 index 000000000..86b2c99e4 --- /dev/null +++ b/examples/touch_pad_evb/main/CMakeLists.txt @@ -0,0 +1,17 @@ + +set(COMPONENT_SRCS "evb_adc.c" + "evb_rgb_led.cpp" + "evb_seg_led.c" + "evb_touch_button.cpp" + "evb_touch_matrix.cpp" + "evb_touch_seq_slide.cpp" + "evb_touch_slide.cpp" + "evb_touch_spring.cpp" + "evb_touch_wheel.cpp" + "main.cpp") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +set(COMPONENT_REQUIRES touchpad led esp_adc_cal ch450 light) + +register_component() diff --git a/examples/ulp_examples/ulp_adc/CMakeLists.txt b/examples/ulp_examples/ulp_adc/CMakeLists.txt new file mode 100644 index 000000000..8904bfdf6 --- /dev/null +++ b/examples/ulp_examples/ulp_adc/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ulp-adc-example) diff --git a/examples/ulp_examples/ulp_adc/main/CMakeLists.txt b/examples/ulp_examples/ulp_adc/main/CMakeLists.txt new file mode 100644 index 000000000..edd60353f --- /dev/null +++ b/examples/ulp_examples/ulp_adc/main/CMakeLists.txt @@ -0,0 +1,29 @@ +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +# requirements can't depend on config +set(COMPONENT_REQUIRES soc nvs_flash ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/adc.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "main.c") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/ulp_examples/ulp_detect_brownout/CMakeLists.txt b/examples/ulp_examples/ulp_detect_brownout/CMakeLists.txt new file mode 100644 index 000000000..1db00de64 --- /dev/null +++ b/examples/ulp_examples/ulp_detect_brownout/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ulp-detect-brownout) diff --git a/examples/ulp_examples/ulp_detect_brownout/main/CMakeLists.txt b/examples/ulp_examples/ulp_detect_brownout/main/CMakeLists.txt new file mode 100644 index 000000000..b16fd1b0e --- /dev/null +++ b/examples/ulp_examples/ulp_detect_brownout/main/CMakeLists.txt @@ -0,0 +1,29 @@ +set(COMPONENT_SRCS "ulp_detect_brownout_main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +# requirements can't depend on config +set(COMPONENT_REQUIRES soc nvs_flash ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/brownout_detect.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "ulp_detect_brownout_main.c") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/ulp_examples/ulp_hall_sensor/CMakeLists.txt b/examples/ulp_examples/ulp_hall_sensor/CMakeLists.txt new file mode 100644 index 000000000..b78e60e69 --- /dev/null +++ b/examples/ulp_examples/ulp_hall_sensor/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ulp-hall-sensor) diff --git a/examples/ulp_examples/ulp_hall_sensor/main/CMakeLists.txt b/examples/ulp_examples/ulp_hall_sensor/main/CMakeLists.txt new file mode 100644 index 000000000..7e8792118 --- /dev/null +++ b/examples/ulp_examples/ulp_hall_sensor/main/CMakeLists.txt @@ -0,0 +1,29 @@ +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +# requirements can't depend on config +set(COMPONENT_REQUIRES soc nvs_flash ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/hall_sensor.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "main.c") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/ulp_examples/ulp_hall_sensor/readme_cn.md b/examples/ulp_examples/ulp_hall_sensor/readme_cn.md index 6ea2e4c35..b09685598 100644 --- a/examples/ulp_examples/ulp_hall_sensor/readme_cn.md +++ b/examples/ulp_examples/ulp_hall_sensor/readme_cn.md @@ -38,9 +38,15 @@ ULP 协处理器配置汇编编译工具链,只需两步即可安装配置完 ##### 4.2 配置编译烧录 至此,汇编编译环境就安装好了,在 [esp-iot-solution](https://github.com/espressif/esp-iot-solution) /examples/ulp_hall_sensor/ 目录下依次运行以下命令,进行 default config 配置并编译、烧录程序。 + +Make: >* make defconfig >* make all -j8 && make flash monitor +CMake +>* idf.py defconfig +>* idf.py flash monitor + ## 5. 软件分析 ULP 协处理器没有内置读霍尔传感器相关的汇编指令,所以我们需要设置相关寄存器来读取片内霍尔传感器。 diff --git a/examples/ulp_examples/ulp_hall_sensor/readme_en.md b/examples/ulp_examples/ulp_hall_sensor/readme_en.md index 241ec769d..e50aef042 100644 --- a/examples/ulp_examples/ulp_hall_sensor/readme_en.md +++ b/examples/ulp_examples/ulp_hall_sensor/readme_en.md @@ -39,9 +39,15 @@ The installation and configuration of the assembly toolchain in the ULP co-proce ##### 4.2 Default Config, Compile and Download At this point, the installation of the assembly language environment is complete. To also complete the default config and start compiling and downloading programs, execute the following commands at [esp-iot-solution](https://github.com/espressif/esp-iot-solution)/examples/ulp_hall_sensor/ in sequence. + +Make: >* make defconfig >* make all -j8 && make flash monitor +CMake +>* idf.py defconfig +>* idf.py flash monitor + ## 5. Software Analysis The ULP co-processor does not have built-in assembly instructions that read the Hall sensor, so we need to set up registers to read the on-chip Hall sensor. diff --git a/examples/ulp_examples/ulp_i2c_bitbang/CMakeLists.txt b/examples/ulp_examples/ulp_i2c_bitbang/CMakeLists.txt new file mode 100644 index 000000000..ffada4168 --- /dev/null +++ b/examples/ulp_examples/ulp_i2c_bitbang/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ulp-i2c-bitbang) diff --git a/examples/ulp_examples/ulp_i2c_bitbang/main/CMakeLists.txt b/examples/ulp_examples/ulp_i2c_bitbang/main/CMakeLists.txt new file mode 100644 index 000000000..37baf4c71 --- /dev/null +++ b/examples/ulp_examples/ulp_i2c_bitbang/main/CMakeLists.txt @@ -0,0 +1,31 @@ +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +# requirements can't depend on config +set(COMPONENT_REQUIRES soc nvs_flash ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/i2c.S" + "ulp/i2c_dev.S" + "ulp/stack.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "main.c") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/ulp_examples/ulp_i2c_bitbang/readme_cn.md b/examples/ulp_examples/ulp_i2c_bitbang/readme_cn.md index a5c682dc1..0580476af 100644 --- a/examples/ulp_examples/ulp_i2c_bitbang/readme_cn.md +++ b/examples/ulp_examples/ulp_i2c_bitbang/readme_cn.md @@ -20,9 +20,15 @@ ULP 协处理器配置汇编编译工具链,只需两步即可安装配置完 #### 2.2 配置编译烧录 至此,汇编编译环境就安装好了,在 ulp_i2c_bitbang/ 目录下依次运行以下命令,进行 default config 配置并编译、烧录程序。 + +Make: >* make defconfig >* make all -j8 && make flash monitor +CMake +>* idf.py defconfig +>* idf.py flash monitor + ## 3. stack.S 堆栈宏说明 由于当前 ULP 协处理器汇编环境没有实现关于子函数的调用和返回堆栈保存等操作,需要用户来实现和构造这部分。所以在四个通用寄存器中我们牺牲 R3 寄存器用来当做栈指针,实现了 4 个关于堆栈操作的宏 PUSH、POP、PSR、RET,以上的宏在 stack.S 汇编文件中。 diff --git a/examples/ulp_examples/ulp_rtc_gpio/CMakeLists.txt b/examples/ulp_examples/ulp_rtc_gpio/CMakeLists.txt new file mode 100644 index 000000000..51d6b5d8e --- /dev/null +++ b/examples/ulp_examples/ulp_rtc_gpio/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ulp-rtc-gpio) diff --git a/examples/ulp_examples/ulp_rtc_gpio/README.md b/examples/ulp_examples/ulp_rtc_gpio/README.md index 4703b8526..4996f5bee 100644 --- a/examples/ulp_examples/ulp_rtc_gpio/README.md +++ b/examples/ulp_examples/ulp_rtc_gpio/README.md @@ -50,7 +50,7 @@ ULP 协处理器配置汇编编译工具链,只需两步即可安装配置完 >* 第一步, 下载工具链 `binutils-esp32ulp toolchain` [链接地址]( https://github.com/espressif/binutils-esp32ulp/wiki#downloads), 解压到需要安装的目录 >* 第二步,添加工具链的 `bin` 目录到系统环境变量 `PATH` 中。例如我的解压目录是 `/opt/esp32ulp-elf-binutils` 那么添加 `export PATH=/opt/esp32ulp-elf-binutils/bin:$PATH` 这一行到 /home 目录的隐藏文件 `.bashrc` 文件最后一行,保存关闭文件并使用命令 `source .bashrc` 使上述环境变量生效 -至此,汇编编译环境就安装好了,将 ulp_rtc_gpio/ 目录下的 sdkconfig.defaults 复制一份改名为 sdkconfig,然后在工程中使用 make all -j8 && make flash monitor 编译并烧录命令时,会自动调用汇编工具链编译汇编代码。 +至此,汇编编译环境就安装好了,将 ulp_rtc_gpio/ 目录下的 sdkconfig.defaults 复制一份改名为 sdkconfig,然后在工程中使用 `make all -j8 && make flash monitor`(Make) 或者 `idf.py flash monitor`(CMake) 编译并烧录命令时,会自动调用汇编工具链编译汇编代码。 #### 3.2 汇编代码介绍 diff --git a/examples/ulp_examples/ulp_rtc_gpio/main/CMakeLists.txt b/examples/ulp_examples/ulp_rtc_gpio/main/CMakeLists.txt new file mode 100644 index 000000000..dd8c16949 --- /dev/null +++ b/examples/ulp_examples/ulp_rtc_gpio/main/CMakeLists.txt @@ -0,0 +1,29 @@ +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +# requirements can't depend on config +set(COMPONENT_REQUIRES soc nvs_flash ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/rtcio.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "main.c") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/ulp_examples/ulp_send_interrupt/CMakeLists.txt b/examples/ulp_examples/ulp_send_interrupt/CMakeLists.txt index 3e58d2923..845cba92f 100644 --- a/examples/ulp_examples/ulp_send_interrupt/CMakeLists.txt +++ b/examples/ulp_examples/ulp_send_interrupt/CMakeLists.txt @@ -1,6 +1,18 @@ -# The following lines of boilerplate have to be in your project's CMakeLists -# in this exact order for cmake to work correctly +# The following 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.5) +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(ulp-intr) \ No newline at end of file + +project(ulp-send-interrupt) diff --git a/examples/ulp_examples/ulp_send_interrupt/main/CMakeLists.txt b/examples/ulp_examples/ulp_send_interrupt/main/CMakeLists.txt index 7b39598ce..7056404ef 100644 --- a/examples/ulp_examples/ulp_send_interrupt/main/CMakeLists.txt +++ b/examples/ulp_examples/ulp_send_interrupt/main/CMakeLists.txt @@ -1,6 +1,9 @@ # Set usual component variables -set(COMPONENT_SRCS "ulp_example_main.c") +set(COMPONENT_SRCS "ulp_send_interrupt_main.c") + set(COMPONENT_ADD_INCLUDEDIRS "") + +# requirements can't depend on config set(COMPONENT_REQUIRES soc nvs_flash ulp) register_component() @@ -15,11 +18,11 @@ set(ULP_APP_NAME ulp_${COMPONENT_NAME}) # 2. Specify all assembly source files here. # Files should be placed into a separate directory (in this case, ulp/), # which should not be added to COMPONENT_SRCS. -set(ULP_S_SOURCES "ulp/pulse_cnt.S") +set(ULP_S_SOURCES "ulp/io_check.S") # # 3. List all the component source files which include automatically # generated ULP export file, $(ULP_APP_NAME).h: -set(ULP_EXP_DEP_SRCS "ulp_example_main.c") +set(ULP_EXP_DEP_SRCS "ulp_send_interrupt_main.c") # # 4. Include build rules for ULP program # End of ULP support additions to component makefile. diff --git a/examples/ulp_examples/ulp_spi/CMakeLists.txt b/examples/ulp_examples/ulp_spi/CMakeLists.txt new file mode 100644 index 000000000..205b25aad --- /dev/null +++ b/examples/ulp_examples/ulp_spi/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ulp-spi-bitbang) diff --git a/examples/ulp_examples/ulp_spi/main/CMakeLists.txt b/examples/ulp_examples/ulp_spi/main/CMakeLists.txt new file mode 100644 index 000000000..c890af800 --- /dev/null +++ b/examples/ulp_examples/ulp_spi/main/CMakeLists.txt @@ -0,0 +1,31 @@ +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +# requirements can't depend on config +set(COMPONENT_REQUIRES soc nvs_flash ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/ms5611.S" + "ulp/spi.S" + "ulp/stack.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "main.c") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/ulp_examples/ulp_tsens/CMakeLists.txt b/examples/ulp_examples/ulp_tsens/CMakeLists.txt new file mode 100644 index 000000000..c513f67a2 --- /dev/null +++ b/examples/ulp_examples/ulp_tsens/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ulp-tsens) diff --git a/examples/ulp_examples/ulp_tsens/README.md b/examples/ulp_examples/ulp_tsens/README.md index 535bc4996..0eb5061f5 100644 --- a/examples/ulp_examples/ulp_tsens/README.md +++ b/examples/ulp_examples/ulp_tsens/README.md @@ -23,9 +23,15 @@ ULP 协处理器配置汇编编译工具链,只需两步即可安装配置完 #### 3.2 配置编译烧录 至此,汇编编译环境就安装好了,在 ulp_tsens/ 目录下依次运行以下命令,进行 config 配置并编译、烧录程序。 + +Make: >* make defconfig >* make all -j8 && make flash monitor +CMake +>* idf.py defconfig +>* idf.py flash monitor + #### 3.3 汇编代码介绍 diff --git a/examples/ulp_examples/ulp_tsens/main/CMakeLists.txt b/examples/ulp_examples/ulp_tsens/main/CMakeLists.txt new file mode 100644 index 000000000..da061efce --- /dev/null +++ b/examples/ulp_examples/ulp_tsens/main/CMakeLists.txt @@ -0,0 +1,29 @@ +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +# requirements can't depend on config +set(COMPONENT_REQUIRES soc nvs_flash ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/tsens.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "main.c") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/ulp_examples/ulp_watering_device/CMakeLists.txt b/examples/ulp_examples/ulp_watering_device/CMakeLists.txt new file mode 100644 index 000000000..470e8a42b --- /dev/null +++ b/examples/ulp_examples/ulp_watering_device/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(ulp_watering_device) diff --git a/examples/ulp_examples/ulp_watering_device/main/CMakeLists.txt b/examples/ulp_examples/ulp_watering_device/main/CMakeLists.txt new file mode 100644 index 000000000..edd60353f --- /dev/null +++ b/examples/ulp_examples/ulp_watering_device/main/CMakeLists.txt @@ -0,0 +1,29 @@ +set(COMPONENT_SRCS "main.c") + +set(COMPONENT_ADD_INCLUDEDIRS ".") + +# requirements can't depend on config +set(COMPONENT_REQUIRES soc nvs_flash ulp) + +register_component() + +# +# ULP support additions to component makefile. +# +# 1. ULP_APP_NAME must be unique (if multiple components use ULP) +# Default value, override if necessary: +set(ULP_APP_NAME ulp_${COMPONENT_NAME}) +# +# 2. Specify all assembly source files here. +# Files should be placed into a separate directory (in this case, ulp/), +# which should not be added to COMPONENT_SRCS. +set(ULP_S_SOURCES "ulp/adc.S") +# +# 3. List all the component source files which include automatically +# generated ULP export file, $(ULP_APP_NAME).h: +set(ULP_EXP_DEP_SRCS "main.c") +# +# 4. Include build rules for ULP program +# End of ULP support additions to component makefile. +# +include($ENV{IDF_PATH}/components/ulp/component_ulp_common.cmake) diff --git a/examples/ulp_examples/ulp_watering_device/readme_cn.md b/examples/ulp_examples/ulp_watering_device/readme_cn.md index a42f75617..8f706e124 100644 --- a/examples/ulp_examples/ulp_watering_device/readme_cn.md +++ b/examples/ulp_examples/ulp_watering_device/readme_cn.md @@ -39,7 +39,7 @@ ULP 协处理器配置汇编编译工具链,只需两步即可安装配置完 >* 第一步, 下载工具链 `binutils-esp32ulp toolchain` [链接地址]( https://github.com/espressif/binutils-esp32ulp/wiki#downloads), 解压到需要安装的目录 >* 第二步,添加工具链的 `bin` 目录到系统环境变量 `PATH` 中。例如我的解压目录是 `/opt/esp32ulp-elf-binutils` 那么添加 `export PATH=/opt/esp32ulp-elf-binutils/bin:$PATH` 这一行到 /home 目录的隐藏文件 `.bashrc` 文件最后一行,保存关闭文件并使用命令 `source .bashrc` 使上述环境变量生效 -至此,汇编编译环境就安装好了,将 ulp_watering_device/ 目录下的 sdkconfig.defaults 复制一份改名为 sdkconfig,然后在工程中使用 make all -j8 && make flash monitor 编译命令时,会自动调用汇编工具链编译汇编代码。 +至此,汇编编译环境就安装好了,将 ulp_watering_device/ 目录下的 sdkconfig.defaults 复制一份改名为 sdkconfig,然后在工程中使用 `make all -j8 && make flash monitor`(Make) 或者 `idf.py flash monitor`(CMake) 编译命令时,会自动调用汇编工具链编译汇编代码。 #### 4.2 管脚使用 diff --git a/examples/ulp_examples/ulp_watering_device/readme_en.md b/examples/ulp_examples/ulp_watering_device/readme_en.md index 138679246..a7f23c4f1 100644 --- a/examples/ulp_examples/ulp_watering_device/readme_en.md +++ b/examples/ulp_examples/ulp_watering_device/readme_en.md @@ -46,7 +46,7 @@ It takes only two steps to configure the ULP coprocessor toolchain. Below is an >* Step One: Download [binutils-esp32ulp toolchain](https://github.com/espressif/binutils-esp32ulp/wiki#downloads), and extract the toolchain into a directory for installation. >* Step Two: Add the path to the `bin` directory of the toolchain to the `PATH` environment variable. For example, if the toolchain is extracted into the directory `/opt/esp32ulp-elf-binutils`, then add the line `export PATH=/opt/esp32ulp-elf-binutils/bin:$PATH` at the end of the hidden file `.bashrc` under the directory `/home`. Save the file and run the command `source .bashrc` to enable the environment variable. -The compiling environment is now set up. Make a copy of `sdkconfig.defaults` under the directory `ulp_watering_device/` and rename it as `sdkconfig`. When running the compiling command `make all -j8 && make flash monitor` in programming the codes, the toolchain will be called to compile codes in assembly. +The compiling environment is now set up. Make a copy of `sdkconfig.defaults` under the directory `ulp_watering_device/` and rename it as `sdkconfig`. When running the compiling command `make all -j8 && make flash monitor`(Make) or `idf.py flash monitor`(CMake) in programming the codes, the toolchain will be called to compile codes in assembly. #### 4.2 Pin Function diff --git a/tools/unit-test-app/CMakeLists.txt b/tools/unit-test-app/CMakeLists.txt new file mode 100644 index 000000000..9a6918601 --- /dev/null +++ b/tools/unit-test-app/CMakeLists.txt @@ -0,0 +1,18 @@ +# The following 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.5) + +#If IOT_SOLUTION_PATH is not defined, use relative path as default value +set(IOT_SOLUTION_PATH "$ENV{IOT_SOLUTION_PATH}") +if(NOT IOT_SOLUTION_PATH) + # Documentation says you should set IOT_SOLUTION_PATH in your environment, but we + # can infer it relative to PROJECT_PATH directory if it's not set. + get_filename_component(IOT_SOLUTION_PATH "${PROJECT_PATH}/../.." ABSOLUTE) +endif() +file(TO_CMAKE_PATH "${IOT_SOLUTION_PATH}" IOT_SOLUTION_PATH) +set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH}) + +include($ENV{IOT_SOLUTION_PATH}/CMakeLists.txt) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +project(unit-test-app)