@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,12 @@
|
|
|
1
|
+
menu "Gea Embedded"
|
|
2
|
+
|
|
3
|
+
config GEA_EMBEDDED_PRODUCTION_LOCKDOWN
|
|
4
|
+
bool "Production lockdown"
|
|
5
|
+
default n
|
|
6
|
+
help
|
|
7
|
+
Compile out Gea frame/perf logs, heap diagnostics, and the
|
|
8
|
+
diagnostics server for production firmware. Local development builds
|
|
9
|
+
should leave this disabled so serial monitor and VS Code launch
|
|
10
|
+
tasks show fps and diagnostic logs.
|
|
11
|
+
|
|
12
|
+
endmenu
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
#include "gea_embedded_app_config.h"
|
|
2
|
+
|
|
3
|
+
#include "apps/app_manager.h"
|
|
4
|
+
#include "board.h"
|
|
5
|
+
#include "buttons.h"
|
|
6
|
+
#include "connectivity/ble_hid.h"
|
|
7
|
+
#include "display.h"
|
|
8
|
+
|
|
9
|
+
#include "driver/gpio.h"
|
|
10
|
+
|
|
11
|
+
// Forward-declare here instead of through a header — there's already a
|
|
12
|
+
// `wifi.h` in `lib/gea-embedded/include/` defining WifiAdapter/WifiDriver,
|
|
13
|
+
// and adding a second `wifi.h` under `targets/esp32/connectivity/` shadows
|
|
14
|
+
// it in the include search path, breaking the WifiStation TU which needs
|
|
15
|
+
// the base class.
|
|
16
|
+
namespace gea::targets::esp32::wifi {
|
|
17
|
+
void registerDriver();
|
|
18
|
+
}
|
|
19
|
+
namespace gea::platform::storage {
|
|
20
|
+
void installSdCardFileCache();
|
|
21
|
+
}
|
|
22
|
+
#include "memory_config.h"
|
|
23
|
+
#include "runtime.h"
|
|
24
|
+
#include "services/device_control.h"
|
|
25
|
+
|
|
26
|
+
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG
|
|
27
|
+
#include "esp_heap_caps.h"
|
|
28
|
+
#endif
|
|
29
|
+
#include "esp_log.h"
|
|
30
|
+
#include "sdkconfig.h"
|
|
31
|
+
#include "freertos/FreeRTOS.h"
|
|
32
|
+
#include "freertos/task.h"
|
|
33
|
+
|
|
34
|
+
namespace {
|
|
35
|
+
|
|
36
|
+
constexpr const char *kTag = "gea_embedded";
|
|
37
|
+
|
|
38
|
+
void runRuntime();
|
|
39
|
+
|
|
40
|
+
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG
|
|
41
|
+
void logHeapProbe(const char *stage)
|
|
42
|
+
{
|
|
43
|
+
ESP_LOGI(kTag,
|
|
44
|
+
"heap probe [%s] internal_free=%u internal_largest=%u internal_min=%u psram_free=%u",
|
|
45
|
+
stage ? stage : "?",
|
|
46
|
+
static_cast<unsigned>(heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)),
|
|
47
|
+
static_cast<unsigned>(heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)),
|
|
48
|
+
static_cast<unsigned>(heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)),
|
|
49
|
+
static_cast<unsigned>(heap_caps_get_free_size(MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT)));
|
|
50
|
+
}
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
constexpr int kAppMainTaskStack = CONFIG_ESP_MAIN_TASK_STACK_SIZE;
|
|
54
|
+
// An app whose own realtime tasks must outrank the render loop (audio DSP, a USB
|
|
55
|
+
// isochronous host) sets gea.defines.GEA_EMBEDDED_RUNTIME_TASK_PRIORITY to place
|
|
56
|
+
// this below them; the default is what this board needs on its own.
|
|
57
|
+
#ifndef GEA_EMBEDDED_RUNTIME_TASK_PRIORITY
|
|
58
|
+
#define GEA_EMBEDDED_RUNTIME_TASK_PRIORITY 5
|
|
59
|
+
#endif
|
|
60
|
+
constexpr UBaseType_t kRuntimeTaskPriority = GEA_EMBEDDED_RUNTIME_TASK_PRIORITY;
|
|
61
|
+
|
|
62
|
+
#if GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LOG
|
|
63
|
+
void logCurrentTaskStack(const char *stage, int stackBytes)
|
|
64
|
+
{
|
|
65
|
+
TaskHandle_t currentTask = xTaskGetCurrentTaskHandle();
|
|
66
|
+
ESP_LOGI(kTag,
|
|
67
|
+
"stack probe [%s] task=%s core=%d stack_arg=%d hwm=%u",
|
|
68
|
+
stage ? stage : "?",
|
|
69
|
+
currentTask ? pcTaskGetName(currentTask) : "?",
|
|
70
|
+
static_cast<int>(xPortGetCoreID()),
|
|
71
|
+
stackBytes,
|
|
72
|
+
static_cast<unsigned>(uxTaskGetStackHighWaterMark(currentTask)));
|
|
73
|
+
}
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
void runRuntime()
|
|
77
|
+
{
|
|
78
|
+
gea::framework::RuntimeOptions options{};
|
|
79
|
+
options.width = gea::platform::display::kWidth;
|
|
80
|
+
options.height = gea::platform::display::kHeight;
|
|
81
|
+
gea::framework::Runtime::run(options);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
} // namespace
|
|
85
|
+
|
|
86
|
+
extern "C" void app_main(void)
|
|
87
|
+
{
|
|
88
|
+
// Power rails, FIRST thing at boot (vendor board_power_bsp semantics):
|
|
89
|
+
// - vbatPower (GPIO17, ACTIVE HIGH) is the battery soft-latch. On battery
|
|
90
|
+
// the board is only powered while the PWR button is physically held until
|
|
91
|
+
// firmware drives this high — without it the board dies the moment the
|
|
92
|
+
// button is released (the e-paper keeps its last image, so it LOOKS on).
|
|
93
|
+
// - audioPower (GPIO42, ACTIVE LOW) supplies the ES8311; drive it before
|
|
94
|
+
// anything probes the codec.
|
|
95
|
+
{
|
|
96
|
+
gpio_config_t railConf = {};
|
|
97
|
+
railConf.intr_type = GPIO_INTR_DISABLE;
|
|
98
|
+
railConf.mode = GPIO_MODE_OUTPUT;
|
|
99
|
+
railConf.pin_bit_mask = (1ULL << gea::platform::board::power.vbatPower) |
|
|
100
|
+
(1ULL << gea::platform::board::power.audioPower);
|
|
101
|
+
railConf.pull_down_en = GPIO_PULLDOWN_DISABLE;
|
|
102
|
+
railConf.pull_up_en = GPIO_PULLUP_ENABLE;
|
|
103
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(gpio_config(&railConf));
|
|
104
|
+
gpio_set_level(gea::platform::board::power.vbatPower, 1);
|
|
105
|
+
gpio_set_level(gea::platform::board::power.audioPower, 0);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// BOOT/PWR buttons → ArrowUp/ArrowDown keydown events (the non-touch
|
|
109
|
+
// variant's only physical input).
|
|
110
|
+
gea::platform::esp32_s3_epaper::buttons::startButtonsTask();
|
|
111
|
+
gea::platform::storage::installSdCardFileCache();
|
|
112
|
+
|
|
113
|
+
// Force the targets/esp32/apps/app_manager.cpp TU to be linked in. That
|
|
114
|
+
// TU's only side effect is a file-scope `PlatformRegistration` whose
|
|
115
|
+
// constructor calls AppManager::setPlatform(...). With -Wl,--gc-sections
|
|
116
|
+
// and the main component built as a static archive, nothing else
|
|
117
|
+
// references launcherPlatform(), so the linker drops the entire object
|
|
118
|
+
// file — the static ctor never runs, AppManager::platform_ stays null,
|
|
119
|
+
// and AppManager::startLauncherButtonTask() / returnRunningAppToLauncher
|
|
120
|
+
// / ... all become silent no-ops. Result: the BOOT button task is never
|
|
121
|
+
// created and no `launcher_button` log lines are ever emitted.
|
|
122
|
+
(void)gea::platform::esp32::apps::launcherPlatform();
|
|
123
|
+
|
|
124
|
+
// Same static-archive trap as `launcherPlatform()` above. Three different
|
|
125
|
+
// `wifi.cpp` files all archive as `wifi.cpp.obj` in `libmain.a`; symbol-
|
|
126
|
+
// driven archive linking pulls in `lib/gea-embedded/wifi.cpp` (WifiAdapter
|
|
127
|
+
// + NullWifiDriver) and `lib/gea-embedded/host/wifi.cpp` (WifiBackend
|
|
128
|
+
// shim) because external code references them, but the ESP32 driver's
|
|
129
|
+
// only side effect was an anonymous-namespace static-init global with no
|
|
130
|
+
// external references — so the obj was dropped, leaving NullWifiDriver
|
|
131
|
+
// (whose enabled()/setEnabled() are silent no-ops) as the active driver.
|
|
132
|
+
// `wifi().init()` returned false in <1ms at boot ("WiFi failed; OTA not
|
|
133
|
+
// available") and the Settings panel WiFi toggle did nothing.
|
|
134
|
+
//
|
|
135
|
+
// Note: wifi.cpp itself wraps `wifi_init_config_t.osi_funcs` to bump the
|
|
136
|
+
// closed-source wifi blob's hardcoded 3584-byte task stack to 8192,
|
|
137
|
+
// avoiding a stack overflow during WPA2 auth on this firmware.
|
|
138
|
+
//
|
|
139
|
+
// GEA_EMBEDDED_WIFI_DISABLED skips driver registration entirely, leaving the
|
|
140
|
+
// no-op NullWifiDriver active (no esp_wifi_init/start, no WiFi DMA/ISR bus
|
|
141
|
+
// traffic). Used to isolate whether WiFi PSRAM/cache-bus contention is what
|
|
142
|
+
// starves the direct-PSRAM SPI flush FIFO.
|
|
143
|
+
#ifndef GEA_EMBEDDED_WIFI_DISABLED
|
|
144
|
+
gea::targets::esp32::wifi::registerDriver();
|
|
145
|
+
#endif
|
|
146
|
+
|
|
147
|
+
// Same static-archive trap as `launcherPlatform()` and `wifi::registerDriver()`
|
|
148
|
+
// above. Reference the HID driver explicitly so its TU is pulled in and
|
|
149
|
+
// `HidServer` replaces the board-independent `NullBleDriver`. Originally
|
|
150
|
+
// gated on `GEA_EMBEDDED_APP_USES_BLE`, but `geatsc analyze` only detects
|
|
151
|
+
// BLE usage when the import literal is `from 'gea-embedded'` — the
|
|
152
|
+
// internal `runtime-surface` re-export chain that `gea-embedded`'s
|
|
153
|
+
// Settings panel uses (`import { BLE, ... } from '../../runtime-surface'`)
|
|
154
|
+
// gets a false negative, the macro never lands, the driver never
|
|
155
|
+
// registers, and the BLUETOOTH toggle is a silent no-op (NullBleDriver's
|
|
156
|
+
// `setEnabled` ignores its argument; `enabled()` always returns false).
|
|
157
|
+
// We can't just define the macro unconditionally either — it also gates
|
|
158
|
+
// `gea_init`'s SPIRAM-vs-DRAM placement in `app_runner.cpp`, and forcing
|
|
159
|
+
// DRAM there fails (64 KB stack > 32 KB largest contiguous block at
|
|
160
|
+
// init time). So: register the driver here unconditionally, leave the
|
|
161
|
+
// macro narrow.
|
|
162
|
+
gea::targets::esp32::ble::registerHidDriver();
|
|
163
|
+
|
|
164
|
+
vTaskPrioritySet(nullptr, kRuntimeTaskPriority);
|
|
165
|
+
#if GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LOG
|
|
166
|
+
logCurrentTaskStack("main_task:before_runtime", kAppMainTaskStack);
|
|
167
|
+
#endif
|
|
168
|
+
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG
|
|
169
|
+
logHeapProbe("app_main:before_device_control_task");
|
|
170
|
+
#endif
|
|
171
|
+
gea::platform::esp32::services::startDeviceControlTask();
|
|
172
|
+
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG
|
|
173
|
+
logHeapProbe("app_main:before_runtime");
|
|
174
|
+
#endif
|
|
175
|
+
runRuntime();
|
|
176
|
+
|
|
177
|
+
ESP_LOGE(kTag, "Runtime returned unexpectedly; parking main task");
|
|
178
|
+
while (true) {
|
|
179
|
+
vTaskDelay(pdMS_TO_TICKS(1000));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// The non-touch ESP32-S3-ePaper-1.54 has two user buttons, both active low
|
|
2
|
+
// with pull-ups (vendor button_bsp): BOOT on GPIO0 and PWR on GPIO18. They are
|
|
3
|
+
// the board's only physical input, so deliver them to apps as web keydown
|
|
4
|
+
// events — BOOT = ArrowUp (38), PWR = ArrowDown (40) — via the same queue the
|
|
5
|
+
// runtime frame loop drains for rotary input. Held buttons auto-repeat.
|
|
6
|
+
//
|
|
7
|
+
// GPIO0 note: launcher_button.cpp owns BOOT on launcher builds; on single-app
|
|
8
|
+
// builds its AppManager policy disables that task, so polling it here is safe.
|
|
9
|
+
#include "buttons.h"
|
|
10
|
+
|
|
11
|
+
#include "board.h"
|
|
12
|
+
#include "input.h"
|
|
13
|
+
|
|
14
|
+
#include <cstdint>
|
|
15
|
+
|
|
16
|
+
#include "driver/gpio.h"
|
|
17
|
+
#include "driver/rtc_io.h"
|
|
18
|
+
#include "esp_log.h"
|
|
19
|
+
#include "esp_sleep.h"
|
|
20
|
+
#include "esp_timer.h"
|
|
21
|
+
#include "freertos/FreeRTOS.h"
|
|
22
|
+
#include "freertos/task.h"
|
|
23
|
+
|
|
24
|
+
namespace gea::platform::esp32_s3_epaper::buttons {
|
|
25
|
+
|
|
26
|
+
namespace {
|
|
27
|
+
|
|
28
|
+
constexpr const char *kTag = "epaper_buttons";
|
|
29
|
+
constexpr gpio_num_t kUpPin = GPIO_NUM_0; // BOOT
|
|
30
|
+
constexpr gpio_num_t kDownPin = GPIO_NUM_18; // PWR
|
|
31
|
+
constexpr int kUpKeyCode = 38; // ArrowUp
|
|
32
|
+
constexpr int kDownKeyCode = 40; // ArrowDown
|
|
33
|
+
constexpr int kPollMs = 20;
|
|
34
|
+
constexpr int kDebouncePolls = 2; // 2 consecutive matching reads = stable
|
|
35
|
+
constexpr int kRepeatDelayMs = 450; // hold this long before auto-repeat
|
|
36
|
+
constexpr int kRepeatIntervalMs = 200; // then one press per interval
|
|
37
|
+
constexpr int kPowerOffHoldMs = 2500; // PWR held this long = power off
|
|
38
|
+
constexpr std::uint32_t kTaskStackBytes = 3072;
|
|
39
|
+
constexpr UBaseType_t kTaskPriority = 10;
|
|
40
|
+
|
|
41
|
+
struct ButtonState {
|
|
42
|
+
gpio_num_t pin;
|
|
43
|
+
int keyCode;
|
|
44
|
+
bool autoRepeat;
|
|
45
|
+
bool pressed = false;
|
|
46
|
+
int stablePolls = 0;
|
|
47
|
+
std::int64_t pressedAtUs = 0;
|
|
48
|
+
std::int64_t lastRepeatUs = 0;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Vendor power-off semantics (board_power_bsp::EnableDeepLowPowerMode): rails
|
|
52
|
+
// off, battery latch (GPIO17) dropped — on battery the board dies right here,
|
|
53
|
+
// the e-paper keeps showing the last frame. On USB the chip stays powered, so
|
|
54
|
+
// emulate "off" with deep sleep; either button (ANY_LOW) wakes into a fresh
|
|
55
|
+
// boot. On battery, power-on is the hardware path: hold PWR until the
|
|
56
|
+
// app_main latch takes over (~1s).
|
|
57
|
+
[[noreturn]] void powerOff()
|
|
58
|
+
{
|
|
59
|
+
ESP_LOGI(kTag, "PWR long-press: powering off");
|
|
60
|
+
// Wait for PWR release so the ext1 ANY_LOW wake doesn't fire instantly.
|
|
61
|
+
while (gpio_get_level(kDownPin) == 0) vTaskDelay(pdMS_TO_TICKS(kPollMs));
|
|
62
|
+
vTaskDelay(pdMS_TO_TICKS(100));
|
|
63
|
+
|
|
64
|
+
gpio_set_level(gea::platform::board::power.epdPower, 1); // active low: off
|
|
65
|
+
gpio_set_level(gea::platform::board::power.audioPower, 1); // active low: off
|
|
66
|
+
gpio_set_level(gea::platform::board::power.vbatPower, 0); // battery latch off
|
|
67
|
+
|
|
68
|
+
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
|
|
69
|
+
const std::uint64_t wakeMask = (1ULL << kUpPin) | (1ULL << kDownPin);
|
|
70
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(esp_sleep_enable_ext1_wakeup_io(wakeMask, ESP_EXT1_WAKEUP_ANY_LOW));
|
|
71
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(rtc_gpio_pulldown_dis(kUpPin));
|
|
72
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(rtc_gpio_pullup_en(kUpPin));
|
|
73
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(rtc_gpio_pulldown_dis(kDownPin));
|
|
74
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(rtc_gpio_pullup_en(kDownPin));
|
|
75
|
+
// Hold the dropped battery latch through deep sleep so a USB-powered "off"
|
|
76
|
+
// doesn't relatch the battery rail.
|
|
77
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(rtc_gpio_hold_en(gea::platform::board::power.vbatPower));
|
|
78
|
+
esp_deep_sleep_start();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
void pollButton(ButtonState &button)
|
|
82
|
+
{
|
|
83
|
+
const bool rawPressed = gpio_get_level(button.pin) == 0;
|
|
84
|
+
if (rawPressed != button.pressed) {
|
|
85
|
+
if (++button.stablePolls < kDebouncePolls) return;
|
|
86
|
+
button.stablePolls = 0;
|
|
87
|
+
button.pressed = rawPressed;
|
|
88
|
+
if (rawPressed) {
|
|
89
|
+
const std::int64_t now = esp_timer_get_time();
|
|
90
|
+
button.pressedAtUs = now;
|
|
91
|
+
button.lastRepeatUs = now;
|
|
92
|
+
gea::framework::input::queueKeyDown(button.keyCode);
|
|
93
|
+
}
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
button.stablePolls = 0;
|
|
97
|
+
if (!button.pressed) return;
|
|
98
|
+
const std::int64_t now = esp_timer_get_time();
|
|
99
|
+
if (!button.autoRepeat) {
|
|
100
|
+
// PWR: held past the threshold powers the board off (no auto-repeat —
|
|
101
|
+
// a repeat ramp that ends in a surprise power-off would be hostile).
|
|
102
|
+
if (now - button.pressedAtUs >= static_cast<std::int64_t>(kPowerOffHoldMs) * 1000) powerOff();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (now - button.pressedAtUs < static_cast<std::int64_t>(kRepeatDelayMs) * 1000) return;
|
|
106
|
+
if (now - button.lastRepeatUs < static_cast<std::int64_t>(kRepeatIntervalMs) * 1000) return;
|
|
107
|
+
button.lastRepeatUs = now;
|
|
108
|
+
gea::framework::input::queueKeyDown(button.keyCode);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
void buttonsTask(void *)
|
|
112
|
+
{
|
|
113
|
+
ButtonState up{kUpPin, kUpKeyCode, /*autoRepeat=*/true};
|
|
114
|
+
ButtonState down{kDownPin, kDownKeyCode, /*autoRepeat=*/false};
|
|
115
|
+
for (;;) {
|
|
116
|
+
vTaskDelay(pdMS_TO_TICKS(kPollMs));
|
|
117
|
+
pollButton(up);
|
|
118
|
+
pollButton(down);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
} // namespace
|
|
123
|
+
|
|
124
|
+
void startButtonsTask()
|
|
125
|
+
{
|
|
126
|
+
// GPIO0 is a strapping pin — reset it before reconfiguring as plain input.
|
|
127
|
+
gpio_reset_pin(kUpPin);
|
|
128
|
+
gpio_config_t conf = {};
|
|
129
|
+
conf.intr_type = GPIO_INTR_DISABLE;
|
|
130
|
+
conf.mode = GPIO_MODE_INPUT;
|
|
131
|
+
conf.pin_bit_mask = (1ULL << kUpPin) | (1ULL << kDownPin);
|
|
132
|
+
conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
|
|
133
|
+
conf.pull_up_en = GPIO_PULLUP_ENABLE;
|
|
134
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(gpio_config(&conf));
|
|
135
|
+
|
|
136
|
+
if (xTaskCreatePinnedToCore(buttonsTask, "epd_buttons", kTaskStackBytes, nullptr, kTaskPriority, nullptr, 1) != pdPASS) {
|
|
137
|
+
ESP_LOGE(kTag, "failed to start buttons task");
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
ESP_LOGI(kTag, "buttons ready: BOOT(GPIO%d)=ArrowUp PWR(GPIO%d)=ArrowDown",
|
|
141
|
+
static_cast<int>(kUpPin), static_cast<int>(kDownPin));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
} // namespace gea::platform::esp32_s3_epaper::buttons
|