@geastack/targets 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +83 -0
- package/package.json +50 -0
- package/targets/cmake/geatsc-generated-archive-build.mjs +614 -0
- package/targets/cmake/geatsc_generated_archive.cmake +116 -0
- package/targets/cmake/geatsc_generated_archive_build.cmake +50 -0
- package/targets/esp32/app_project.cmake +33 -0
- package/targets/esp32/apps/app_manager.cpp +188 -0
- package/targets/esp32/apps/app_manager.h +10 -0
- package/targets/esp32/chip_bindings/README.md +58 -0
- package/targets/esp32/chip_bindings/audio/es8311.cpp +556 -0
- package/targets/esp32/chip_bindings/displays/co5300.cpp +510 -0
- package/targets/esp32/chip_bindings/displays/co5300.h +47 -0
- package/targets/esp32/chip_bindings/displays/co5300_async_stream.inc +79 -0
- package/targets/esp32/chip_bindings/displays/qspi_panel.h +65 -0
- package/targets/esp32/chip_bindings/displays/sh8601.cpp +583 -0
- package/targets/esp32/chip_bindings/displays/sh8601.h +36 -0
- package/targets/esp32/chip_bindings/gps/lc76g.cpp +296 -0
- package/targets/esp32/chip_bindings/gps/lc76g.h +7 -0
- package/targets/esp32/chip_bindings/imu/bmi270.cpp +299 -0
- package/targets/esp32/chip_bindings/imu/bmi270_config.inl +439 -0
- package/targets/esp32/chip_bindings/imu/qmi8658.cpp +213 -0
- package/targets/esp32/chip_bindings/power/axp2101.cpp +185 -0
- package/targets/esp32/chip_bindings/touch/cst9217.cpp +229 -0
- package/targets/esp32/chip_bindings/touch/cst9217_controller.h +78 -0
- package/targets/esp32/chip_bindings/touch/ft3168.cpp +340 -0
- package/targets/esp32/chip_bindings/touch/ft3168_controller.h +103 -0
- package/targets/esp32/chip_bindings/touch/ft6336.cpp +310 -0
- package/targets/esp32/chip_bindings/touch/ft6336_controller.h +90 -0
- package/targets/esp32/components/gea_framework/CMakeLists.txt +62 -0
- package/targets/esp32/connectivity/ble_hid.cpp +2916 -0
- package/targets/esp32/connectivity/ble_hid.h +8 -0
- package/targets/esp32/connectivity/diagnostics_transport.cpp +523 -0
- package/targets/esp32/connectivity/diagnostics_transport_offline.cpp +108 -0
- package/targets/esp32/connectivity/wifi.cpp +615 -0
- package/targets/esp32/connectivity/wifi_debug_offline.cpp +37 -0
- package/targets/esp32/connectivity/wifi_task_stack.h +119 -0
- package/targets/esp32/display.cpp +6010 -0
- package/targets/esp32/display_headless.cpp +468 -0
- package/targets/esp32/gea/platform_random.h +11 -0
- package/targets/esp32/gea_framework.cmake +382 -0
- package/targets/esp32/gpio.cpp +229 -0
- package/targets/esp32/host_sources.cmake +35 -0
- package/targets/esp32/imu_absent.cpp +36 -0
- package/targets/esp32/ldfragments/gea_ui_state_external.lf +35 -0
- package/targets/esp32/memory_config.h +64 -0
- package/targets/esp32/power_absent.cpp +22 -0
- package/targets/esp32/sdk-patches/0001-esp_ptr_dma_capable-accept-PSRAM.patch +70 -0
- package/targets/esp32/sdk-patches/0002-gdma-access_ext_mem-spi_master.patch +59 -0
- package/targets/esp32/sdk-patches/README.md +127 -0
- package/targets/esp32/services/app_runner.cpp +248 -0
- package/targets/esp32/services/app_state.cpp +56 -0
- package/targets/esp32/services/audio_runtime_stub.cpp +86 -0
- package/targets/esp32/services/battery_service.cpp +31 -0
- package/targets/esp32/services/device_control.cpp +1896 -0
- package/targets/esp32/services/device_control.h +31 -0
- package/targets/esp32/services/frame_scheduler.cpp +1571 -0
- package/targets/esp32/services/heap.cpp +129 -0
- package/targets/esp32/services/memory.cpp +103 -0
- package/targets/esp32/services/ota.cpp +840 -0
- package/targets/esp32/services/ota_image.cpp +162 -0
- package/targets/esp32/services/ota_image.h +16 -0
- package/targets/esp32/services/storage_service.cpp +159 -0
- package/targets/esp32/touch_absent.cpp +44 -0
- package/targets/esp32-m5stack-m5paper/CMakeLists.txt +10 -0
- package/targets/esp32-m5stack-m5paper/README.md +55 -0
- package/targets/esp32-m5stack-m5paper/dependencies.lock +76 -0
- package/targets/esp32-m5stack-m5paper/main/CMakeLists.txt +46 -0
- package/targets/esp32-m5stack-m5paper/main/Kconfig.projbuild +10 -0
- package/targets/esp32-m5stack-m5paper/main/app_main.cpp +114 -0
- package/targets/esp32-m5stack-m5paper/main/audio_stub.cpp +27 -0
- package/targets/esp32-m5stack-m5paper/main/buttons.cpp +111 -0
- package/targets/esp32-m5stack-m5paper/main/display.cpp +1074 -0
- package/targets/esp32-m5stack-m5paper/main/i2c.cpp +36 -0
- package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -0
- package/targets/esp32-m5stack-m5paper/main/imu_stub.cpp +20 -0
- package/targets/esp32-m5stack-m5paper/main/include/board.h +100 -0
- package/targets/esp32-m5stack-m5paper/main/include/buttons.h +8 -0
- package/targets/esp32-m5stack-m5paper/main/launcher_button.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/m5paper_psram.lf +20 -0
- package/targets/esp32-m5stack-m5paper/main/power.cpp +73 -0
- package/targets/esp32-m5stack-m5paper/main/sdcard_mount.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/touch.cpp +279 -0
- package/targets/esp32-m5stack-m5paper/partitions.csv +9 -0
- package/targets/esp32-m5stack-m5paper/sdkconfig.defaults +84 -0
- package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +10 -0
- package/targets/esp32-p4-m5stack-tab5/dependencies.lock +276 -0
- package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +586 -0
- package/targets/esp32-p4-m5stack-tab5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-m5stack-tab5/main/app_main.cpp +177 -0
- package/targets/esp32-p4-m5stack-tab5/main/camera.cpp +2025 -0
- package/targets/esp32-p4-m5stack-tab5/main/display.cpp +4033 -0
- package/targets/esp32-p4-m5stack-tab5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-m5stack-tab5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +21 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/board.h +130 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/tab5_drivers.h +68 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-m5stack-tab5/main/launcher_button.cpp +188 -0
- package/targets/esp32-p4-m5stack-tab5/main/power.cpp +22 -0
- package/targets/esp32-p4-m5stack-tab5/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_audio.cpp +345 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_drivers.cpp +871 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_imu.cpp +246 -0
- package/targets/esp32-p4-m5stack-tab5/main/touch.cpp +206 -0
- package/targets/esp32-p4-m5stack-tab5/partitions.csv +12 -0
- package/targets/esp32-p4-m5stack-tab5/sdkconfig.defaults +128 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +19 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/0001-esp_video-csi-raw-passthrough-p4-rev-lt-v3.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/README.md +45 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/apply.sh +37 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/dependencies.lock +196 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +562 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/app_main.cpp +166 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/camera.cpp +2105 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +1730 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +11 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/board.h +87 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/panel_native.h +59 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/touch.cpp +306 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/partitions.csv +13 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/README.md +22 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/espressif__esp_video-csi-bypass.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/sdkconfig.defaults +109 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/capture-camera.py +369 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +10 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/dependencies.lock +258 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +577 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/app_main.cpp +177 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/camera.cpp +1935 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +2832 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +23 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/board.h +68 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/touch.cpp +332 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/partitions.csv +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/sdkconfig.defaults +122 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py +369 -0
- package/targets/esp32-s3-devkit-n16r8.json +31 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +10 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/dependencies.lock +40 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +549 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +187 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +1338 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/i2c.cpp +39 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/board.h +142 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/pcf8574.h +16 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/rotary_encoder.h +7 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/pcf8574.cpp +86 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/platform_stubs.cpp +47 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/rotary_encoder.cpp +135 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/touch.cpp +250 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/partitions.csv +8 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/sdkconfig.defaults +116 -0
- package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +10 -0
- package/targets/esp32-s3-epaper-1.54/dependencies.lock +76 -0
- package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +691 -0
- package/targets/esp32-s3-epaper-1.54/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-epaper-1.54/main/app_main.cpp +181 -0
- package/targets/esp32-s3-epaper-1.54/main/buttons.cpp +144 -0
- package/targets/esp32-s3-epaper-1.54/main/display.cpp +1281 -0
- package/targets/esp32-s3-epaper-1.54/main/fatfs_ffconf.h +377 -0
- package/targets/esp32-s3-epaper-1.54/main/i2c.cpp +39 -0
- package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -0
- package/targets/esp32-s3-epaper-1.54/main/imu_stub.cpp +21 -0
- package/targets/esp32-s3-epaper-1.54/main/include/board.h +119 -0
- package/targets/esp32-s3-epaper-1.54/main/include/buttons.h +9 -0
- package/targets/esp32-s3-epaper-1.54/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-epaper-1.54/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-epaper-1.54/main/power.cpp +15 -0
- package/targets/esp32-s3-epaper-1.54/main/sdcard_mount.cpp +89 -0
- package/targets/esp32-s3-epaper-1.54/main/touch.cpp +299 -0
- package/targets/esp32-s3-epaper-1.54/partitions.csv +8 -0
- package/targets/esp32-s3-epaper-1.54/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +10 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/README.md +29 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/dependencies.lock +116 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +90 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/include/board.h +61 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/touch.cpp +299 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/partitions.csv +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/sdkconfig.defaults +50 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +12 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/CMakeLists.txt +17 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.c +269 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.h +142 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.c +1114 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.h +410 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/gea_epd.c +989 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.c +489 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.h +104 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.c +136 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.h +78 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/utilities.h +49 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/dependencies.lock +35 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/CMakeLists.txt +30 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/app_main.cpp +95 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/buttons.cpp +40 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/display.cpp +627 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/i2c.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/imu_stub.cpp +20 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/board.h +85 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/buttons.h +8 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/launcher_button.cpp +82 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/power.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/sdcard_mount.cpp +90 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/touch.cpp +293 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/partitions.csv +9 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +13 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/CMakeLists.txt +5 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/include/papers3_epd.h +74 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/papers3_epd.c +671 -0
- package/targets/esp32-s3-m5stack-papers3/dependencies.lock +76 -0
- package/targets/esp32-s3-m5stack-papers3/main/CMakeLists.txt +64 -0
- package/targets/esp32-s3-m5stack-papers3/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-m5stack-papers3/main/app_main.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-m5stack-papers3/main/buttons.cpp +49 -0
- package/targets/esp32-s3-m5stack-papers3/main/display.cpp +706 -0
- package/targets/esp32-s3-m5stack-papers3/main/i2c.cpp +36 -0
- package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +14 -0
- package/targets/esp32-s3-m5stack-papers3/main/imu.cpp +351 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/board.h +101 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/buttons.h +8 -0
- package/targets/esp32-s3-m5stack-papers3/main/launcher_button.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/power.cpp +102 -0
- package/targets/esp32-s3-m5stack-papers3/main/sdcard_mount.cpp +88 -0
- package/targets/esp32-s3-m5stack-papers3/main/touch.cpp +287 -0
- package/targets/esp32-s3-m5stack-papers3/partitions.csv +9 -0
- package/targets/esp32-s3-m5stack-papers3/sdkconfig.defaults +232 -0
- package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +10 -0
- package/targets/esp32-s3-m5stack-sticks3/dependencies.lock +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-m5stack-sticks3/main/app_main.cpp +130 -0
- package/targets/esp32-s3-m5stack-sticks3/main/buttons.cpp +101 -0
- package/targets/esp32-s3-m5stack-sticks3/main/display.cpp +1391 -0
- package/targets/esp32-s3-m5stack-sticks3/main/i2c.cpp +39 -0
- package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/imu_stub.cpp +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/board.h +89 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/buttons.h +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-m5stack-sticks3/main/power.cpp +15 -0
- package/targets/esp32-s3-m5stack-sticks3/main/sdcard_mount.cpp +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/touch.cpp +65 -0
- package/targets/esp32-s3-m5stack-sticks3/partitions.csv +8 -0
- package/targets/esp32-s3-m5stack-sticks3/sdkconfig.defaults +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.75/dependencies.lock +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +589 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/app_main.cpp +153 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +9 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/board.h +110 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/touch.cpp +45 -0
- package/targets/esp32-s3-touch-amoled-1.75/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.75/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +105 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +768 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +172 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +83 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/touch.cpp +41 -0
- package/targets/esp32-s3-touch-amoled-1.8/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +64 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +1121 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +333 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +114 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +199 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/sdcard_mount.cpp +105 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.06/partitions.csv +14 -0
- package/targets/esp32-s3-touch-amoled-2.06/sdkconfig.defaults +273 -0
- package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/CMakeLists.txt +71 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/board.h +108 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/panel_reset.cpp +82 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.41/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-2.41/sdkconfig.defaults +273 -0
- package/targets/rp2350-tufty-2350/CMakeLists.txt +348 -0
- package/targets/rp2350-tufty-2350/README.md +53 -0
- package/targets/rp2350-tufty-2350/boards/pimoroni_tufty2350.h +87 -0
- package/targets/rp2350-tufty-2350/main/bringup.cpp +187 -0
- package/targets/rp2350-tufty-2350/main/include/board.h +124 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.cpp +428 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.h +46 -0
- package/targets/rp2350-tufty-2350/main/st7789_parallel.pio +7 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +345 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/README.md +153 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/boards/waveshare_rp2350_touch_amoled_2_41.h +59 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/app.cpp +984 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/bringup.cpp +222 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/include/board.h +138 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +2553 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.h +18 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_host_fetch_stub.cpp +64 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.cpp +677 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.h +48 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.c +354 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.h +56 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.c +1284 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.h +95 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_block_functions.h +123 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_common.h +127 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-bench.py +162 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-parity.py +198 -0
- package/targets.json +154 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
# Shared geastack framework resolution for every esp32 board target.
|
|
2
|
+
#
|
|
3
|
+
# Requires GEA_EMBEDDED_ROOT to be set by the includer (the board's main
|
|
4
|
+
# CMakeLists, = the targets repo root). Resolves the gea framework through
|
|
5
|
+
# npm: `targets` is a native npm package whose deps (@geastack/core,
|
|
6
|
+
# @geastack/compiler, @geastack/geatsc-plugin-gea) are installed there. The always-linked framework C/C++ source set + include
|
|
7
|
+
# roots come from the shared manifest in `@geastack/core` (single source of
|
|
8
|
+
# truth, shared with the web build), resolved relative to @geastack/core.
|
|
9
|
+
#
|
|
10
|
+
# Exports for the board CMakeLists:
|
|
11
|
+
# GEA_CORE / GEA_COMPILER / GEA_PLUGIN / GEA_CHIPS / GEA_ENGINE / GEA_HOST
|
|
12
|
+
# — package dirs
|
|
13
|
+
# GEA_APP_ENTRY_SRC — gea_app_entry.cpp (glob-resolved; survives folds)
|
|
14
|
+
# GEA_FW_CXX_SOURCES / GEA_FW_C_SOURCES / GEA_FW_INCLUDE_DIRS — framework set
|
|
15
|
+
|
|
16
|
+
# ESP-IDF's component-requirements pass does not reliably preserve command-line
|
|
17
|
+
# cache values from an app-specific build directory. The CLI exports the same
|
|
18
|
+
# values so every configure phase selects the current project app.
|
|
19
|
+
if(DEFINED ENV{GEA_EMBEDDED_APP} AND NOT "$ENV{GEA_EMBEDDED_APP}" STREQUAL "")
|
|
20
|
+
set(GEA_EMBEDDED_APP "$ENV{GEA_EMBEDDED_APP}" CACHE STRING "Gea app id" FORCE)
|
|
21
|
+
endif()
|
|
22
|
+
if(DEFINED ENV{GEA_EMBEDDED_APP_META} AND NOT "$ENV{GEA_EMBEDDED_APP_META}" STREQUAL "")
|
|
23
|
+
set(GEA_EMBEDDED_APP_META "$ENV{GEA_EMBEDDED_APP_META}" CACHE STRING "Gea app metadata: root;entry;runtime;nativeSources..." FORCE)
|
|
24
|
+
endif()
|
|
25
|
+
# An app may also contribute preprocessor defines and ESP-IDF linker fragments.
|
|
26
|
+
# They travel in their own variables because the meta line above is positional
|
|
27
|
+
# and already ends in a variable-length native-source list.
|
|
28
|
+
if(DEFINED ENV{GEA_EMBEDDED_APP_DEFINES} AND NOT "$ENV{GEA_EMBEDDED_APP_DEFINES}" STREQUAL "")
|
|
29
|
+
set(GEA_EMBEDDED_APP_DEFINES "$ENV{GEA_EMBEDDED_APP_DEFINES}" CACHE STRING "Gea app compile definitions" FORCE)
|
|
30
|
+
endif()
|
|
31
|
+
if(DEFINED ENV{GEA_EMBEDDED_APP_LDFRAGMENTS} AND NOT "$ENV{GEA_EMBEDDED_APP_LDFRAGMENTS}" STREQUAL "")
|
|
32
|
+
set(GEA_EMBEDDED_APP_LDFRAGMENTS "$ENV{GEA_EMBEDDED_APP_LDFRAGMENTS}" CACHE STRING "Gea app linker fragment files" FORCE)
|
|
33
|
+
endif()
|
|
34
|
+
foreach(_GEA_APP_VAR GEA_EMBEDDED_APP_LINK_OPTIONS GEA_EMBEDDED_APP_EMBED_FILES GEA_EMBEDDED_APP_PARTITION_DATA
|
|
35
|
+
GEA_EMBEDDED_APP_COMPONENT_REQUIRES GEA_EMBEDDED_APP_GEATSC_PLUGINS)
|
|
36
|
+
if(DEFINED ENV{${_GEA_APP_VAR}} AND NOT "$ENV{${_GEA_APP_VAR}}" STREQUAL "")
|
|
37
|
+
set(${_GEA_APP_VAR} "$ENV{${_GEA_APP_VAR}}" CACHE STRING "Gea app native build input" FORCE)
|
|
38
|
+
endif()
|
|
39
|
+
endforeach()
|
|
40
|
+
# gea.compilerPlugins, as the repeated flag the geatsc driver takes.
|
|
41
|
+
set(GEA_EMBEDDED_APP_GEATSC_PLUGIN_ARGS "")
|
|
42
|
+
foreach(_GEA_APP_GEATSC_PLUGIN IN LISTS GEA_EMBEDDED_APP_GEATSC_PLUGINS)
|
|
43
|
+
if(NOT EXISTS "${_GEA_APP_GEATSC_PLUGIN}")
|
|
44
|
+
message(FATAL_ERROR "gea.compilerPlugins entry does not exist: ${_GEA_APP_GEATSC_PLUGIN}")
|
|
45
|
+
endif()
|
|
46
|
+
list(APPEND GEA_EMBEDDED_APP_GEATSC_PLUGIN_ARGS --extra-geatsc-plugin "${_GEA_APP_GEATSC_PLUGIN}")
|
|
47
|
+
endforeach()
|
|
48
|
+
# The CLI inspects the app's package.json once (gea apps inspect --format cmake)
|
|
49
|
+
# and passes the result here; CMake never spawns node to read manifests.
|
|
50
|
+
if(GEA_EMBEDDED_APP)
|
|
51
|
+
if(NOT GEA_EMBEDDED_APP_META)
|
|
52
|
+
message(FATAL_ERROR "GEA_EMBEDDED_APP_META is unset for app '${GEA_EMBEDDED_APP}'. Run this target through the gea CLI: gea build --board <alias> --app ${GEA_EMBEDDED_APP}")
|
|
53
|
+
endif()
|
|
54
|
+
set(GEA_EMBEDDED_APP_META_LIST "${GEA_EMBEDDED_APP_META}")
|
|
55
|
+
list(LENGTH GEA_EMBEDDED_APP_META_LIST GEA_EMBEDDED_APP_META_LENGTH)
|
|
56
|
+
if(GEA_EMBEDDED_APP_META_LENGTH LESS 3)
|
|
57
|
+
message(FATAL_ERROR "GEA_EMBEDDED_APP_META must be root;entry;runtime[;native sources...] (got '${GEA_EMBEDDED_APP_META}')")
|
|
58
|
+
endif()
|
|
59
|
+
# Element 0 is the app's absolute directory.
|
|
60
|
+
list(GET GEA_EMBEDDED_APP_META_LIST 0 GEA_EMBEDDED_APP_DIR)
|
|
61
|
+
list(GET GEA_EMBEDDED_APP_META_LIST 1 GEA_EMBEDDED_APP_ENTRY)
|
|
62
|
+
list(GET GEA_EMBEDDED_APP_META_LIST 2 GEA_EMBEDDED_APP_RUNTIME)
|
|
63
|
+
set(GEA_EMBEDDED_APP_NATIVE_SOURCE_RELS "")
|
|
64
|
+
if(GEA_EMBEDDED_APP_META_LENGTH GREATER 3)
|
|
65
|
+
list(SUBLIST GEA_EMBEDDED_APP_META_LIST 3 -1 GEA_EMBEDDED_APP_NATIVE_SOURCE_RELS)
|
|
66
|
+
endif()
|
|
67
|
+
if(NOT IS_ABSOLUTE "${GEA_EMBEDDED_APP_DIR}")
|
|
68
|
+
message(FATAL_ERROR "GEA_EMBEDDED_APP_META must start with the app's absolute directory (got '${GEA_EMBEDDED_APP_DIR}')")
|
|
69
|
+
endif()
|
|
70
|
+
endif()
|
|
71
|
+
|
|
72
|
+
foreach(_GEA_REQUIRED_ENV GEA_CORE_DIR GEA_COMPILER_DIR GEA_PLUGIN_DIR GEA_ENGINE_DIR GEA_HOST_DIR GEA_CHIPS_DIR GEA_ELEMENTS_DIR GEA_GEAOS_PACKAGE_DIR)
|
|
73
|
+
if(NOT DEFINED ENV{${_GEA_REQUIRED_ENV}} OR "$ENV{${_GEA_REQUIRED_ENV}}" STREQUAL "")
|
|
74
|
+
message(FATAL_ERROR "${_GEA_REQUIRED_ENV} is unset. Run this target through the gea CLI so npm packages are resolved first.")
|
|
75
|
+
endif()
|
|
76
|
+
endforeach()
|
|
77
|
+
get_filename_component(GEA_CORE "$ENV{GEA_CORE_DIR}" REALPATH)
|
|
78
|
+
get_filename_component(GEA_COMPILER "$ENV{GEA_COMPILER_DIR}" REALPATH)
|
|
79
|
+
get_filename_component(GEA_PLUGIN "$ENV{GEA_PLUGIN_DIR}" REALPATH)
|
|
80
|
+
get_filename_component(GEA_ENGINE "$ENV{GEA_ENGINE_DIR}" REALPATH)
|
|
81
|
+
get_filename_component(GEA_HOST "$ENV{GEA_HOST_DIR}" REALPATH)
|
|
82
|
+
get_filename_component(GEA_CHIPS "$ENV{GEA_CHIPS_DIR}" REALPATH)
|
|
83
|
+
get_filename_component(GEA_ELEMENTS "$ENV{GEA_ELEMENTS_DIR}" REALPATH)
|
|
84
|
+
get_filename_component(GEA_GEAOS_PACKAGE "$ENV{GEA_GEAOS_PACKAGE_DIR}" REALPATH)
|
|
85
|
+
# gea_app_entry.cpp is an app-mode source exported by @geastack/core.
|
|
86
|
+
set(GEA_APP_ENTRY_SRC "${GEA_CORE}/gea_app_entry.cpp")
|
|
87
|
+
if(NOT EXISTS "${GEA_APP_ENTRY_SRC}")
|
|
88
|
+
message(FATAL_ERROR "@geastack/core does not contain gea_app_entry.cpp")
|
|
89
|
+
endif()
|
|
90
|
+
# Pull the framework source/include lists from the shared manifest once at configure.
|
|
91
|
+
# The manifest is handed the REAL package paths, the same spelling
|
|
92
|
+
# `GEA_FW_APP_SENSITIVE_SOURCES` below is written in. A project that links
|
|
93
|
+
# `@geastack/host` into node_modules (a workspace symlink) otherwise names
|
|
94
|
+
# every framework source under `node_modules/@geastack/host/...` while
|
|
95
|
+
# `${GEA_HOST}` says `core/packages/host/...`; `list(REMOVE_ITEM)` compares
|
|
96
|
+
# strings, misses, and fetch.cpp/websocket.cpp are compiled a second time in
|
|
97
|
+
# the framework component, where the network requirements main carries for
|
|
98
|
+
# them do not exist (`esp_http_client.h: No such file`).
|
|
99
|
+
# The manifest is read with node rather than bash: Windows has no bash, so
|
|
100
|
+
# `bash -c "source gea_sources.sh; ..."` failed outright there and no ESP32
|
|
101
|
+
# target could configure. Node is already required by everything that reaches
|
|
102
|
+
# this file, and gea_sources.sh is now a thin wrapper over the same manifest.
|
|
103
|
+
set(_GEA_FW_ENV
|
|
104
|
+
"GEA_CORE=${GEA_CORE}" "GEA_ENGINE_DIR=${GEA_ENGINE}" "GEA_HOST_DIR=${GEA_HOST}"
|
|
105
|
+
"GEA_ELEMENTS_DIR=${GEA_ELEMENTS}" "GEA_GEAOS_PACKAGE_DIR=${GEA_GEAOS_PACKAGE}")
|
|
106
|
+
set(_GEA_FW_MANIFEST "${GEA_CORE}/gea_sources.mjs")
|
|
107
|
+
execute_process(COMMAND ${CMAKE_COMMAND} -E env ${_GEA_FW_ENV} node "${_GEA_FW_MANIFEST}" cxx-sources
|
|
108
|
+
OUTPUT_VARIABLE _GEA_FW_CXX OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE _GEA_FW_RC1)
|
|
109
|
+
execute_process(COMMAND ${CMAKE_COMMAND} -E env ${_GEA_FW_ENV} node "${_GEA_FW_MANIFEST}" c-sources
|
|
110
|
+
OUTPUT_VARIABLE _GEA_FW_C OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE _GEA_FW_RC2)
|
|
111
|
+
execute_process(COMMAND ${CMAKE_COMMAND} -E env ${_GEA_FW_ENV} node "${_GEA_FW_MANIFEST}" include-flags
|
|
112
|
+
OUTPUT_VARIABLE _GEA_FW_INC OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE _GEA_FW_RC3)
|
|
113
|
+
if(_GEA_FW_RC1 OR _GEA_FW_RC2 OR _GEA_FW_RC3)
|
|
114
|
+
message(FATAL_ERROR "gea_sources.mjs framework manifest failed (rc ${_GEA_FW_RC1}/${_GEA_FW_RC2}/${_GEA_FW_RC3})")
|
|
115
|
+
endif()
|
|
116
|
+
# -mtext-section-literals is XTENSA-ONLY (esp32, esp32-s3). The decomposed
|
|
117
|
+
# framework TUs each instantiate large gea_cpp_value COMDATs whose literal pools
|
|
118
|
+
# overflow the xtensa l32r range at link without it. RISC-V targets (esp32-p4,
|
|
119
|
+
# riscv32) reject the flag and don't have the limit — so it's empty there.
|
|
120
|
+
# Boards splice ${GEA_XTENSA_LITERALS} into their component compile options.
|
|
121
|
+
# App-declared defines go on the WHOLE native build, not only the app's own
|
|
122
|
+
# sources. These macros size framework types -- a cache-slot count changes a
|
|
123
|
+
# struct's layout -- so the app and the framework must be compiled with the same
|
|
124
|
+
# value or they disagree about that struct at link. Setting them as a build
|
|
125
|
+
# property reaches every component without each board target repeating them.
|
|
126
|
+
# IDF's component-requirements pass runs this file through `cmake -P`, where the
|
|
127
|
+
# build-property commands do not exist yet. That pass only collects REQUIRES, so
|
|
128
|
+
# skipping the defines there costs nothing.
|
|
129
|
+
if(COMMAND idf_build_set_property)
|
|
130
|
+
foreach(_GEA_APP_DEFINE IN LISTS GEA_EMBEDDED_APP_DEFINES)
|
|
131
|
+
if(_GEA_APP_DEFINE)
|
|
132
|
+
idf_build_set_property(COMPILE_DEFINITIONS "${_GEA_APP_DEFINE}" APPEND)
|
|
133
|
+
endif()
|
|
134
|
+
endforeach()
|
|
135
|
+
endif()
|
|
136
|
+
|
|
137
|
+
# Linker fragments are absolute paths from the CLI. ldgen merges every
|
|
138
|
+
# fragment in the build into one script and each mapping names the archive it
|
|
139
|
+
# applies to, so which component registers them does not matter -- the shared
|
|
140
|
+
# gea_framework component carries them for every board.
|
|
141
|
+
set(GEA_EMBEDDED_APP_LDFRAGMENT_FILES "")
|
|
142
|
+
foreach(_GEA_APP_LDFRAGMENT IN LISTS GEA_EMBEDDED_APP_LDFRAGMENTS)
|
|
143
|
+
if(NOT _GEA_APP_LDFRAGMENT)
|
|
144
|
+
continue()
|
|
145
|
+
endif()
|
|
146
|
+
if(NOT EXISTS "${_GEA_APP_LDFRAGMENT}")
|
|
147
|
+
message(FATAL_ERROR "gea.ldFragments file does not exist: ${_GEA_APP_LDFRAGMENT}")
|
|
148
|
+
endif()
|
|
149
|
+
list(APPEND GEA_EMBEDDED_APP_LDFRAGMENT_FILES "${_GEA_APP_LDFRAGMENT}")
|
|
150
|
+
endforeach()
|
|
151
|
+
|
|
152
|
+
# GEA_EMBEDDED_UI_STATE_EXTERNAL=1 in gea.defines moves the engine's task-only
|
|
153
|
+
# state into external RAM. That is two changes which only work together, so one
|
|
154
|
+
# define drives both: the engine initializes that state at runtime so it is
|
|
155
|
+
# .bss rather than .data (GEA_EMBEDDED_UI_STATE_DYNAMIC_INIT), and the shipped
|
|
156
|
+
# linker fragment sweeps that .bss to external RAM.
|
|
157
|
+
set(_GEA_UI_STATE_EXTERNAL OFF)
|
|
158
|
+
foreach(_GEA_APP_DEFINE IN LISTS GEA_EMBEDDED_APP_DEFINES)
|
|
159
|
+
if(_GEA_APP_DEFINE MATCHES "^GEA_EMBEDDED_UI_STATE_EXTERNAL(=[1-9][0-9]*)?$")
|
|
160
|
+
set(_GEA_UI_STATE_EXTERNAL ON)
|
|
161
|
+
endif()
|
|
162
|
+
endforeach()
|
|
163
|
+
if(_GEA_UI_STATE_EXTERNAL)
|
|
164
|
+
if(DEFINED CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY AND NOT CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY)
|
|
165
|
+
message(FATAL_ERROR "GEA_EMBEDDED_UI_STATE_EXTERNAL needs CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y in the app's sdkconfig")
|
|
166
|
+
endif()
|
|
167
|
+
if(COMMAND idf_build_set_property)
|
|
168
|
+
idf_build_set_property(COMPILE_DEFINITIONS "GEA_EMBEDDED_UI_STATE_DYNAMIC_INIT=1" APPEND)
|
|
169
|
+
endif()
|
|
170
|
+
list(APPEND GEA_EMBEDDED_APP_LDFRAGMENT_FILES "${GEA_EMBEDDED_ROOT}/targets/esp32/ldfragments/gea_ui_state_external.lf")
|
|
171
|
+
endif()
|
|
172
|
+
|
|
173
|
+
set(GEA_XTENSA_LITERALS "")
|
|
174
|
+
if(CMAKE_CXX_COMPILER MATCHES "xtensa")
|
|
175
|
+
set(GEA_XTENSA_LITERALS "-mtext-section-literals")
|
|
176
|
+
endif()
|
|
177
|
+
|
|
178
|
+
string(REPLACE "\n" ";" GEA_FW_CXX_SOURCES "${_GEA_FW_CXX}")
|
|
179
|
+
string(REPLACE "\n" ";" GEA_FW_C_SOURCES "${_GEA_FW_C}")
|
|
180
|
+
string(REPLACE "\n" ";" _GEA_FW_INC_FLAGS "${_GEA_FW_INC}")
|
|
181
|
+
set(GEA_FW_INCLUDE_DIRS "")
|
|
182
|
+
foreach(_f ${_GEA_FW_INC_FLAGS})
|
|
183
|
+
string(REGEX REPLACE "^-I" "" _d "${_f}")
|
|
184
|
+
if(_d)
|
|
185
|
+
list(APPEND GEA_FW_INCLUDE_DIRS "${_d}")
|
|
186
|
+
endif()
|
|
187
|
+
endforeach()
|
|
188
|
+
|
|
189
|
+
# Keep sources whose dependencies or compile-time behavior vary with the active
|
|
190
|
+
# app in main. The remaining framework sources form a stable IDF component:
|
|
191
|
+
# changing generated app code, network capability, or render-tuning flags no
|
|
192
|
+
# longer recompiles the whole framework.
|
|
193
|
+
set(GEA_FW_APP_SENSITIVE_SOURCES
|
|
194
|
+
"${GEA_ENGINE}/ui/tree_render.cpp"
|
|
195
|
+
"${GEA_ENGINE}/ui/tree_style.cpp"
|
|
196
|
+
"${GEA_HOST}/host/fetch.cpp"
|
|
197
|
+
"${GEA_HOST}/host/websocket.cpp"
|
|
198
|
+
"${GEA_HOST}/host/http.cpp"
|
|
199
|
+
"${GEA_HOST}/host/image.cpp"
|
|
200
|
+
"${GEA_HOST}/host/rtc.cpp"
|
|
201
|
+
"${GEA_HOST}/host/tile_loader.cpp"
|
|
202
|
+
"${GEA_HOST}/services/bluetooth_service.cpp"
|
|
203
|
+
"${GEA_HOST}/services/network_services.cpp"
|
|
204
|
+
"${GEA_CORE}/runtime.cpp"
|
|
205
|
+
)
|
|
206
|
+
list(REMOVE_ITEM GEA_FW_CXX_SOURCES ${GEA_FW_APP_SENSITIVE_SOURCES})
|
|
207
|
+
|
|
208
|
+
# The direct-canvas profiling apps intentionally use a small framework slice.
|
|
209
|
+
# Reproduce that slice in the stable component instead of compiling the normal
|
|
210
|
+
# framework and relying on the linker to discard it.
|
|
211
|
+
if(GEA_EMBEDDED_APP STREQUAL "canvas-3d" OR GEA_EMBEDDED_APP STREQUAL "gea3d-cube")
|
|
212
|
+
set(GEA_FW_CXX_SOURCES
|
|
213
|
+
"${GEA_ENGINE}/ui/canvas_element.cpp"
|
|
214
|
+
"${GEA_ENGINE}/canvas.cpp"
|
|
215
|
+
"${GEA_ENGINE}/bitmap_font.cpp"
|
|
216
|
+
"${GEA_ENGINE}/rasterized_font.cpp"
|
|
217
|
+
"${GEA_CORE}/app_frame_perf.cpp"
|
|
218
|
+
"${GEA_CORE}/runtime.cpp"
|
|
219
|
+
"${GEA_CORE}/events.cpp"
|
|
220
|
+
"${GEA_HOST}/host/timers.cpp"
|
|
221
|
+
"${GEA_HOST}/host/display.cpp"
|
|
222
|
+
)
|
|
223
|
+
set(GEA_FW_C_SOURCES "")
|
|
224
|
+
set(GEA_FW_APP_SENSITIVE_SOURCES "")
|
|
225
|
+
endif()
|
|
226
|
+
|
|
227
|
+
# Digital pins and the WS2812 strand most modules carry as their "onboard LED",
|
|
228
|
+
# appended AFTER the direct-canvas slice above so that profile keeps them too.
|
|
229
|
+
# Every ESP32 board gets them, and deliberately so: on a board with no display
|
|
230
|
+
# these pins are the only output an app can reach, and a capability gate would
|
|
231
|
+
# mean a headless board's one way to say anything depends on a flag nobody sets.
|
|
232
|
+
list(APPEND GEA_FW_CXX_SOURCES
|
|
233
|
+
"${GEA_HOST}/host/gpio.cpp"
|
|
234
|
+
"${GEA_EMBEDDED_ROOT}/targets/esp32/gpio.cpp"
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
function(gea_framework_compile_definitions)
|
|
238
|
+
target_compile_definitions(${COMPONENT_LIB} PRIVATE ${ARGN})
|
|
239
|
+
if(TARGET idf::gea_framework)
|
|
240
|
+
idf_component_get_property(_gea_framework_lib gea_framework COMPONENT_LIB)
|
|
241
|
+
target_compile_definitions(${_gea_framework_lib} PRIVATE ${ARGN})
|
|
242
|
+
endif()
|
|
243
|
+
endfunction()
|
|
244
|
+
|
|
245
|
+
function(gea_framework_compile_options)
|
|
246
|
+
target_compile_options(${COMPONENT_LIB} PRIVATE ${ARGN})
|
|
247
|
+
if(TARGET idf::gea_framework)
|
|
248
|
+
idf_component_get_property(_gea_framework_lib gea_framework COMPONENT_LIB)
|
|
249
|
+
target_compile_options(${_gea_framework_lib} PRIVATE ${ARGN})
|
|
250
|
+
endif()
|
|
251
|
+
endfunction()
|
|
252
|
+
|
|
253
|
+
function(gea_framework_inherit_build_settings)
|
|
254
|
+
if(NOT TARGET idf::gea_framework)
|
|
255
|
+
return()
|
|
256
|
+
endif()
|
|
257
|
+
|
|
258
|
+
idf_component_get_property(_gea_framework_lib gea_framework COMPONENT_LIB)
|
|
259
|
+
get_target_property(_gea_framework_definitions ${COMPONENT_LIB} COMPILE_DEFINITIONS)
|
|
260
|
+
if(_gea_framework_definitions)
|
|
261
|
+
# These definitions only affect sources deliberately retained in main.
|
|
262
|
+
# Filtering them keeps active-app capability/tuning changes from
|
|
263
|
+
# invalidating the stable framework component.
|
|
264
|
+
list(FILTER _gea_framework_definitions EXCLUDE REGEX
|
|
265
|
+
"^(GEA_EMBEDDED_APP_USES_BLE|GEA_EMBEDDED_APP_USES_AUDIO|GEA_EMBEDDED_BLE_DISABLED|GEA_EMBEDDED_AUDIO_UNUSED|GEA_EMBEDDED_ENABLE_HTTPS|GEA_EMBEDDED_WIFI_DISABLED|GEA_EMBEDDED_DISPLAY_FUSE_REPLAY_FLUSH|GEA_EMBEDDED_SUBTREE_REVEAL_CHECK|GEA_EMBEDDED_SKIP_POSITION_INLINE_RECORD)(=.*)?$")
|
|
266
|
+
target_compile_definitions(${_gea_framework_lib} PRIVATE ${_gea_framework_definitions})
|
|
267
|
+
endif()
|
|
268
|
+
|
|
269
|
+
get_target_property(_gea_framework_options ${COMPONENT_LIB} COMPILE_OPTIONS)
|
|
270
|
+
if(_gea_framework_options)
|
|
271
|
+
set(_gea_framework_stable_options "")
|
|
272
|
+
set(_gea_skip_iquote_path FALSE)
|
|
273
|
+
foreach(_gea_option IN LISTS _gea_framework_options)
|
|
274
|
+
if(_gea_skip_iquote_path)
|
|
275
|
+
set(_gea_skip_iquote_path FALSE)
|
|
276
|
+
elseif(_gea_option STREQUAL "-iquote")
|
|
277
|
+
# Generated app headers are private to main. Inheriting their
|
|
278
|
+
# app-specific path changes every framework compile command and
|
|
279
|
+
# defeats component/cache reuse even though framework sources
|
|
280
|
+
# do not include those headers.
|
|
281
|
+
set(_gea_skip_iquote_path TRUE)
|
|
282
|
+
else()
|
|
283
|
+
list(APPEND _gea_framework_stable_options "${_gea_option}")
|
|
284
|
+
endif()
|
|
285
|
+
endforeach()
|
|
286
|
+
target_compile_options(${_gea_framework_lib} PRIVATE ${_gea_framework_stable_options})
|
|
287
|
+
endif()
|
|
288
|
+
|
|
289
|
+
# Framework code calls target implementations retained in main, while main
|
|
290
|
+
# also calls into the framework. Keep the pair in one explicit rescan group;
|
|
291
|
+
# IDF's normal one-pass component ordering cannot resolve both directions.
|
|
292
|
+
# main is a static archive, so PRIVATE link options stop at the archive and
|
|
293
|
+
# never reach the final executable link. Publish the rescan group through
|
|
294
|
+
# its link interface so the ELF linker actually sees it.
|
|
295
|
+
target_link_libraries(${COMPONENT_LIB} INTERFACE
|
|
296
|
+
"-Wl$<COMMA>--start-group$<COMMA>${CMAKE_BINARY_DIR}/esp-idf/main/libmain.a$<COMMA>${CMAKE_BINARY_DIR}/esp-idf/gea_framework/libgea_framework.a$<COMMA>--end-group")
|
|
297
|
+
|
|
298
|
+
endfunction()
|
|
299
|
+
|
|
300
|
+
# Applied from the shared gea_framework component, which every board requires.
|
|
301
|
+
# Link options published through its INTERFACE reach the final executable link,
|
|
302
|
+
# and binary data compiled into libgea_framework.a resolves for main the same
|
|
303
|
+
# way it would have there -- so an app gets both without any board target
|
|
304
|
+
# repeating them.
|
|
305
|
+
function(gea_apply_app_native_build)
|
|
306
|
+
# Runtime::run() calls gea_app_native_boot() if an app defines one, through a
|
|
307
|
+
# weak declaration. A weak undefined reference does NOT pull an object out of
|
|
308
|
+
# a static archive, and every app native source is archived into libmain.a --
|
|
309
|
+
# so without this the hook would silently link as null. `-u` enters the name
|
|
310
|
+
# as a real undefined symbol, which does pull the member.
|
|
311
|
+
#
|
|
312
|
+
# Only when the app actually spells the hook. `-u` makes the reference
|
|
313
|
+
# STRONG, so ld must resolve it -- name it for an app that never defines one
|
|
314
|
+
# and the link fails outright with "undefined reference to
|
|
315
|
+
# gea_app_native_boot". The flag is what pulls a hook that exists; where none
|
|
316
|
+
# exists the weak reference is meant to stay null, and naming the symbol is
|
|
317
|
+
# what stops it from doing so.
|
|
318
|
+
#
|
|
319
|
+
# "Has native sources" is NOT the same question: an app may bring native code
|
|
320
|
+
# that is pure library surface reached from TS (e-reader's epub_archive.cpp)
|
|
321
|
+
# and define no boot hook at all -- that spelling failed the link for every
|
|
322
|
+
# such app. Ask the real question instead, by reading the app's own native
|
|
323
|
+
# sources at configure time. CMake re-runs when any of them changes, so a hook
|
|
324
|
+
# added or removed later re-decides this on the next build.
|
|
325
|
+
set(_GEA_APP_DEFINES_NATIVE_BOOT NO)
|
|
326
|
+
foreach(_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL IN LISTS GEA_EMBEDDED_APP_NATIVE_SOURCE_RELS)
|
|
327
|
+
set(_GEA_APP_NATIVE_SOURCE "${GEA_EMBEDDED_APP_DIR}/${_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL}")
|
|
328
|
+
if(EXISTS "${_GEA_APP_NATIVE_SOURCE}")
|
|
329
|
+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${_GEA_APP_NATIVE_SOURCE}")
|
|
330
|
+
file(STRINGS "${_GEA_APP_NATIVE_SOURCE}" _GEA_APP_BOOT_HIT REGEX "gea_app_native_boot[ \t]*\\(")
|
|
331
|
+
if(_GEA_APP_BOOT_HIT)
|
|
332
|
+
set(_GEA_APP_DEFINES_NATIVE_BOOT YES)
|
|
333
|
+
endif()
|
|
334
|
+
endif()
|
|
335
|
+
endforeach()
|
|
336
|
+
if(_GEA_APP_DEFINES_NATIVE_BOOT)
|
|
337
|
+
target_link_options(${COMPONENT_LIB} INTERFACE "-Wl,-u,gea_app_native_boot")
|
|
338
|
+
endif()
|
|
339
|
+
|
|
340
|
+
foreach(_GEA_APP_LINK_OPTION IN LISTS GEA_EMBEDDED_APP_LINK_OPTIONS)
|
|
341
|
+
if(_GEA_APP_LINK_OPTION)
|
|
342
|
+
target_link_options(${COMPONENT_LIB} INTERFACE "${_GEA_APP_LINK_OPTION}")
|
|
343
|
+
endif()
|
|
344
|
+
endforeach()
|
|
345
|
+
|
|
346
|
+
# `symbol=file`: the name the firmware refers to the bytes by, and where
|
|
347
|
+
# they come from. Split on the FIRST '=' so a path may contain one.
|
|
348
|
+
foreach(_GEA_APP_EMBED IN LISTS GEA_EMBEDDED_APP_EMBED_FILES)
|
|
349
|
+
if(NOT _GEA_APP_EMBED)
|
|
350
|
+
continue()
|
|
351
|
+
endif()
|
|
352
|
+
string(FIND "${_GEA_APP_EMBED}" "=" _GEA_APP_EMBED_SPLIT)
|
|
353
|
+
if(_GEA_APP_EMBED_SPLIT LESS 1)
|
|
354
|
+
message(FATAL_ERROR "gea.targets.esp32.embedFiles entry is not symbol=file: ${_GEA_APP_EMBED}")
|
|
355
|
+
endif()
|
|
356
|
+
string(SUBSTRING "${_GEA_APP_EMBED}" 0 ${_GEA_APP_EMBED_SPLIT} _GEA_APP_EMBED_SYMBOL)
|
|
357
|
+
math(EXPR _GEA_APP_EMBED_REST "${_GEA_APP_EMBED_SPLIT} + 1")
|
|
358
|
+
string(SUBSTRING "${_GEA_APP_EMBED}" ${_GEA_APP_EMBED_REST} -1 _GEA_APP_EMBED_FILE)
|
|
359
|
+
if(NOT EXISTS "${_GEA_APP_EMBED_FILE}")
|
|
360
|
+
message(FATAL_ERROR "gea.targets.esp32.embedFiles file does not exist: ${_GEA_APP_EMBED_FILE}")
|
|
361
|
+
endif()
|
|
362
|
+
target_add_binary_data(${COMPONENT_LIB} "${_GEA_APP_EMBED_FILE}" BINARY
|
|
363
|
+
RENAME_TO ${_GEA_APP_EMBED_SYMBOL} DEPENDS "${_GEA_APP_EMBED_FILE}")
|
|
364
|
+
endforeach()
|
|
365
|
+
|
|
366
|
+
# `partition=file`: written to that named data partition at flash time,
|
|
367
|
+
# which is a different thing from the embedded copy above. An app may want
|
|
368
|
+
# both -- the pedal repairs a stale factory partition from the embedded one.
|
|
369
|
+
foreach(_GEA_APP_PAYLOAD IN LISTS GEA_EMBEDDED_APP_PARTITION_DATA)
|
|
370
|
+
if(NOT _GEA_APP_PAYLOAD)
|
|
371
|
+
continue()
|
|
372
|
+
endif()
|
|
373
|
+
string(FIND "${_GEA_APP_PAYLOAD}" "=" _GEA_APP_PAYLOAD_SPLIT)
|
|
374
|
+
if(_GEA_APP_PAYLOAD_SPLIT LESS 1)
|
|
375
|
+
message(FATAL_ERROR "partition payload is not partition=file: ${_GEA_APP_PAYLOAD}")
|
|
376
|
+
endif()
|
|
377
|
+
string(SUBSTRING "${_GEA_APP_PAYLOAD}" 0 ${_GEA_APP_PAYLOAD_SPLIT} _GEA_APP_PAYLOAD_NAME)
|
|
378
|
+
math(EXPR _GEA_APP_PAYLOAD_REST "${_GEA_APP_PAYLOAD_SPLIT} + 1")
|
|
379
|
+
string(SUBSTRING "${_GEA_APP_PAYLOAD}" ${_GEA_APP_PAYLOAD_REST} -1 _GEA_APP_PAYLOAD_FILE)
|
|
380
|
+
esptool_py_flash_to_partition(flash "${_GEA_APP_PAYLOAD_NAME}" "${_GEA_APP_PAYLOAD_FILE}")
|
|
381
|
+
endforeach()
|
|
382
|
+
endfunction()
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
// ESP32 digital pins and a WS2812 strand.
|
|
2
|
+
//
|
|
3
|
+
// The LED half drives WS2812 timing through RMT directly rather than pulling in
|
|
4
|
+
// the managed `led_strip` component: this file is compiled into every ESP32
|
|
5
|
+
// board, and a new managed dependency would land in the dependency lock of all
|
|
6
|
+
// of them to light one diode on the boards that have one.
|
|
7
|
+
|
|
8
|
+
#include "gpio.h"
|
|
9
|
+
|
|
10
|
+
#include <cstdint>
|
|
11
|
+
#include <cstring>
|
|
12
|
+
|
|
13
|
+
#include "driver/gpio.h"
|
|
14
|
+
#include "driver/rmt_tx.h"
|
|
15
|
+
#include "esp_err.h"
|
|
16
|
+
#include "esp_log.h"
|
|
17
|
+
#include "esp_rom_sys.h"
|
|
18
|
+
|
|
19
|
+
namespace {
|
|
20
|
+
|
|
21
|
+
constexpr const char *kTag = "gpio";
|
|
22
|
+
|
|
23
|
+
bool validPin(int pin)
|
|
24
|
+
{
|
|
25
|
+
return pin >= 0 && pin < GPIO_NUM_MAX && GPIO_IS_VALID_GPIO(static_cast<gpio_num_t>(pin));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// WS2812 is a single-wire protocol where a bit is a fixed-length pulse and only
|
|
29
|
+
// the high/low split says whether it is a 0 or a 1. At the 10 MHz resolution
|
|
30
|
+
// below one tick is 100 ns, so these are the datasheet's T0H/T0L/T1H/T1L.
|
|
31
|
+
constexpr std::uint32_t kLedResolutionHz = 10 * 1000 * 1000;
|
|
32
|
+
constexpr int kMaxPixels = 64;
|
|
33
|
+
// A WS2812 latches the frame it has just clocked in when the line stays low for
|
|
34
|
+
// longer than a bit slot -- 50us in the datasheet, 300 here because the cost is
|
|
35
|
+
// nothing and a strand that latches early shows the previous frame's colours.
|
|
36
|
+
constexpr std::uint32_t kLedLatchUs = 300;
|
|
37
|
+
|
|
38
|
+
rmt_channel_handle_t gLedChannel = nullptr;
|
|
39
|
+
rmt_encoder_handle_t gLedEncoder = nullptr;
|
|
40
|
+
int gLedPin = -1;
|
|
41
|
+
int gLedCount = 0;
|
|
42
|
+
// GRB, which is the order WS2812 clocks in — not RGB.
|
|
43
|
+
std::uint8_t gLedBytes[kMaxPixels * 3];
|
|
44
|
+
|
|
45
|
+
void releaseLed()
|
|
46
|
+
{
|
|
47
|
+
// Deleting the channel hands the pin back with whatever level the last RMT
|
|
48
|
+
// symbol left on it, and a floating data line reads as noise to the strand:
|
|
49
|
+
// enough to latch a garbage frame the moment the channel goes away. Parking
|
|
50
|
+
// the pin as a low output first makes the line rest where the protocol says
|
|
51
|
+
// idle is, so a strand driven on another pin meanwhile stays dark.
|
|
52
|
+
const int parkPin = gLedPin;
|
|
53
|
+
|
|
54
|
+
if (gLedEncoder) {
|
|
55
|
+
rmt_del_encoder(gLedEncoder);
|
|
56
|
+
gLedEncoder = nullptr;
|
|
57
|
+
}
|
|
58
|
+
if (gLedChannel) {
|
|
59
|
+
rmt_disable(gLedChannel);
|
|
60
|
+
rmt_del_channel(gLedChannel);
|
|
61
|
+
gLedChannel = nullptr;
|
|
62
|
+
}
|
|
63
|
+
gLedPin = -1;
|
|
64
|
+
gLedCount = 0;
|
|
65
|
+
|
|
66
|
+
if (parkPin >= 0) {
|
|
67
|
+
const gpio_num_t num = static_cast<gpio_num_t>(parkPin);
|
|
68
|
+
gpio_reset_pin(num);
|
|
69
|
+
gpio_set_direction(num, GPIO_MODE_OUTPUT);
|
|
70
|
+
gpio_set_level(num, 0);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
} // namespace
|
|
75
|
+
|
|
76
|
+
namespace gea::platform::gpio {
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
bool Gpio::configureOutput(int pin)
|
|
80
|
+
{
|
|
81
|
+
if (!validPin(pin)) return false;
|
|
82
|
+
const gpio_num_t num = static_cast<gpio_num_t>(pin);
|
|
83
|
+
gpio_reset_pin(num);
|
|
84
|
+
gpio_config_t config = {};
|
|
85
|
+
config.pin_bit_mask = 1ULL << pin;
|
|
86
|
+
config.mode = GPIO_MODE_OUTPUT;
|
|
87
|
+
config.pull_up_en = GPIO_PULLUP_DISABLE;
|
|
88
|
+
config.pull_down_en = GPIO_PULLDOWN_DISABLE;
|
|
89
|
+
config.intr_type = GPIO_INTR_DISABLE;
|
|
90
|
+
return gpio_config(&config) == ESP_OK;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
bool Gpio::configureInput(int pin, bool pull_up)
|
|
94
|
+
{
|
|
95
|
+
if (!validPin(pin)) return false;
|
|
96
|
+
const gpio_num_t num = static_cast<gpio_num_t>(pin);
|
|
97
|
+
// A strapping pin (GPIO0 among them) can still be muxed to a boot function;
|
|
98
|
+
// resetting forces it back to a plain GPIO matrix entry, which is why
|
|
99
|
+
// launcher_button.cpp does the same before configuring BOOT.
|
|
100
|
+
gpio_reset_pin(num);
|
|
101
|
+
gpio_config_t config = {};
|
|
102
|
+
config.pin_bit_mask = 1ULL << pin;
|
|
103
|
+
config.mode = GPIO_MODE_INPUT;
|
|
104
|
+
config.pull_up_en = pull_up ? GPIO_PULLUP_ENABLE : GPIO_PULLUP_DISABLE;
|
|
105
|
+
config.pull_down_en = pull_up ? GPIO_PULLDOWN_DISABLE : GPIO_PULLDOWN_ENABLE;
|
|
106
|
+
config.intr_type = GPIO_INTR_DISABLE;
|
|
107
|
+
return gpio_config(&config) == ESP_OK;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
bool Gpio::write(int pin, bool level)
|
|
111
|
+
{
|
|
112
|
+
if (!validPin(pin)) return false;
|
|
113
|
+
return gpio_set_level(static_cast<gpio_num_t>(pin), level ? 1 : 0) == ESP_OK;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
bool Gpio::read(int pin)
|
|
117
|
+
{
|
|
118
|
+
if (!validPin(pin)) return false;
|
|
119
|
+
return gpio_get_level(static_cast<gpio_num_t>(pin)) != 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
bool AddressableLed::attach(int pin, int count)
|
|
123
|
+
{
|
|
124
|
+
if (!validPin(pin) || count <= 0 || count > kMaxPixels) return false;
|
|
125
|
+
if (gLedChannel && gLedPin == pin && gLedCount == count) return true;
|
|
126
|
+
releaseLed();
|
|
127
|
+
|
|
128
|
+
rmt_tx_channel_config_t channel = {};
|
|
129
|
+
channel.gpio_num = static_cast<gpio_num_t>(pin);
|
|
130
|
+
channel.clk_src = RMT_CLK_SRC_DEFAULT;
|
|
131
|
+
channel.resolution_hz = kLedResolutionHz;
|
|
132
|
+
channel.mem_block_symbols = 64;
|
|
133
|
+
channel.trans_queue_depth = 4;
|
|
134
|
+
if (rmt_new_tx_channel(&channel, &gLedChannel) != ESP_OK) {
|
|
135
|
+
ESP_LOGE(kTag, "RMT channel for the LED on GPIO%d could not be created", pin);
|
|
136
|
+
gLedChannel = nullptr;
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
rmt_bytes_encoder_config_t encoder = {};
|
|
141
|
+
encoder.bit0.level0 = 1;
|
|
142
|
+
encoder.bit0.duration0 = 3; // T0H 0.3us
|
|
143
|
+
encoder.bit0.level1 = 0;
|
|
144
|
+
encoder.bit0.duration1 = 9; // T0L 0.9us
|
|
145
|
+
encoder.bit1.level0 = 1;
|
|
146
|
+
encoder.bit1.duration0 = 9; // T1H 0.9us
|
|
147
|
+
encoder.bit1.level1 = 0;
|
|
148
|
+
encoder.bit1.duration1 = 3; // T1L 0.3us
|
|
149
|
+
encoder.flags.msb_first = 1;
|
|
150
|
+
if (rmt_new_bytes_encoder(&encoder, &gLedEncoder) != ESP_OK) {
|
|
151
|
+
ESP_LOGE(kTag, "RMT encoder for the LED on GPIO%d could not be created", pin);
|
|
152
|
+
releaseLed();
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
if (rmt_enable(gLedChannel) != ESP_OK) {
|
|
156
|
+
ESP_LOGE(kTag, "RMT channel for the LED on GPIO%d could not be enabled", pin);
|
|
157
|
+
releaseLed();
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
gLedPin = pin;
|
|
162
|
+
gLedCount = count;
|
|
163
|
+
std::memset(gLedBytes, 0, sizeof(gLedBytes));
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
bool AddressableLed::setPixel(int index, int r, int g, int b)
|
|
168
|
+
{
|
|
169
|
+
if (index < 0 || index >= gLedCount) return false;
|
|
170
|
+
const auto clamp = [](int value) -> std::uint8_t {
|
|
171
|
+
if (value < 0) return 0;
|
|
172
|
+
if (value > 255) return 255;
|
|
173
|
+
return static_cast<std::uint8_t>(value);
|
|
174
|
+
};
|
|
175
|
+
// GRB, not RGB.
|
|
176
|
+
gLedBytes[index * 3 + 0] = clamp(g);
|
|
177
|
+
gLedBytes[index * 3 + 1] = clamp(r);
|
|
178
|
+
gLedBytes[index * 3 + 2] = clamp(b);
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
bool AddressableLed::show()
|
|
183
|
+
{
|
|
184
|
+
if (!gLedChannel || !gLedEncoder || gLedCount <= 0) return false;
|
|
185
|
+
rmt_transmit_config_t tx = {};
|
|
186
|
+
tx.loop_count = 0;
|
|
187
|
+
if (rmt_transmit(gLedChannel, gLedEncoder, gLedBytes, static_cast<std::size_t>(gLedCount) * 3, &tx) != ESP_OK) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
// The strand latches on a long low, so the next transmit must not begin
|
|
191
|
+
// until this one has drained; waiting here also makes show() mean "the LED
|
|
192
|
+
// is now showing this" rather than "the write was queued".
|
|
193
|
+
if (rmt_tx_wait_all_done(gLedChannel, 100) != ESP_OK) return false;
|
|
194
|
+
// Drained is not latched. Hold the idle low for the reset period before
|
|
195
|
+
// returning, so the colours are on the strand by the time show() does --
|
|
196
|
+
// including when the caller's next move is to drive a different pin, which
|
|
197
|
+
// tears this channel down.
|
|
198
|
+
esp_rom_delay_us(kLedLatchUs);
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
void AddressableLed::detach() { releaseLed(); }
|
|
203
|
+
|
|
204
|
+
bool AddressableLed::set(int pin, int r, int g, int b)
|
|
205
|
+
{
|
|
206
|
+
// attach() returns early when the pin and length already match, so a caller
|
|
207
|
+
// that drives the LED every frame re-allocates nothing; a caller that moves
|
|
208
|
+
// to a different pin gets the previous channel released first.
|
|
209
|
+
if (!attach(pin, 1)) return false;
|
|
210
|
+
if (!setPixel(0, r, g, b)) return false;
|
|
211
|
+
return show();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
bool AddressableLed::off(int pin) { return set(pin, 0, 0, 0); }
|
|
215
|
+
|
|
216
|
+
} // namespace gea::platform::gpio
|
|
217
|
+
|
|
218
|
+
// Link anchor. Nothing in the framework or in `main` calls anything in this
|
|
219
|
+
// file — the only caller is the app's own geatsc archive, which the linker
|
|
220
|
+
// reaches after every ESP-IDF component archive has gone past. Left to itself
|
|
221
|
+
// the archive linker therefore takes gpio.cpp.obj during the final
|
|
222
|
+
// main/gea_framework rescan, by which point esp_driver_rmt (and the gdma/soc
|
|
223
|
+
// archives behind it) are behind the cursor and every rmt_* call is undefined.
|
|
224
|
+
//
|
|
225
|
+
// The gea_framework component names this symbol in a `-u` link flag, which
|
|
226
|
+
// makes the linker treat it as undefined from the start and take the object
|
|
227
|
+
// while the driver archives are still ahead. `extern "C"` so that flag spells
|
|
228
|
+
// a stable name rather than a C++ mangling.
|
|
229
|
+
extern "C" void gea_gpio_link_bindings(void) {}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Common ESP32 host facades, compiled into the `main` component of every ESP32
|
|
2
|
+
# board target. Single source of truth for the platform-universal host facades:
|
|
3
|
+
# a new facade added here — or an app that uses an existing one like `tiles`
|
|
4
|
+
# (host/tile_loader.cpp) — lights up on every board without editing each
|
|
5
|
+
# target's main/CMakeLists.txt. (Before this, tile_loader.cpp was hand-listed in
|
|
6
|
+
# only some targets, so maps failed to link on the others, e.g. amoled-2.06.)
|
|
7
|
+
#
|
|
8
|
+
# The shared npm resolver defines GEA_HOST as the installed @geastack/host
|
|
9
|
+
# package directory before this manifest is included.
|
|
10
|
+
#
|
|
11
|
+
# Board-HARDWARE-gated facades are intentionally NOT listed here and stay opt-in
|
|
12
|
+
# per target (append after the include):
|
|
13
|
+
# - host/camera.cpp: only boards with a camera (the two waveshare-p4 targets).
|
|
14
|
+
set(GEA_EMBEDDED_HOST_SOURCES
|
|
15
|
+
"${GEA_HOST}/host/apps.cpp"
|
|
16
|
+
"${GEA_HOST}/host/audio.cpp"
|
|
17
|
+
"${GEA_HOST}/host/ble.cpp"
|
|
18
|
+
"${GEA_HOST}/host/display.cpp"
|
|
19
|
+
"${GEA_HOST}/host/fetch.cpp"
|
|
20
|
+
"${GEA_HOST}/host/geolocation.cpp"
|
|
21
|
+
"${GEA_HOST}/host/gpio.cpp"
|
|
22
|
+
"${GEA_HOST}/host/image.cpp"
|
|
23
|
+
"${GEA_HOST}/host/media.cpp"
|
|
24
|
+
"${GEA_HOST}/host/memory.cpp"
|
|
25
|
+
"${GEA_HOST}/host/input.cpp"
|
|
26
|
+
"${GEA_HOST}/host/imu.cpp"
|
|
27
|
+
"${GEA_HOST}/host/rtc.cpp"
|
|
28
|
+
"${GEA_HOST}/host/rtc_esp.cpp"
|
|
29
|
+
"${GEA_HOST}/host/tile_loader.cpp"
|
|
30
|
+
"${GEA_HOST}/host/timers.cpp"
|
|
31
|
+
"${GEA_HOST}/host/touch.cpp"
|
|
32
|
+
"${GEA_HOST}/host/websocket.cpp"
|
|
33
|
+
"${GEA_HOST}/host/http.cpp"
|
|
34
|
+
"${GEA_HOST}/host/wifi.cpp"
|
|
35
|
+
)
|