@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,232 @@
|
|
|
1
|
+
# Target: ESP32-S3
|
|
2
|
+
CONFIG_IDF_TARGET="esp32s3"
|
|
3
|
+
|
|
4
|
+
# M5Stack PaperS3: ESP32-S3R8 — 16 MB quad flash, 8 MB embedded octal PSRAM.
|
|
5
|
+
# (Verified by esptool: "ESP32-S3 (QFN56) rev v0.2, Embedded PSRAM 8MB (AP_3v3)",
|
|
6
|
+
# flash 16MB, eFuse flash type quad.)
|
|
7
|
+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
|
|
8
|
+
|
|
9
|
+
# Console over USB Serial/JTAG (native USB-C on this board)
|
|
10
|
+
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
|
|
11
|
+
|
|
12
|
+
# esp_codec_dev should share the existing new-driver I2C bus with touch/PMIC.
|
|
13
|
+
# CONFIG_CODEC_I2C_BACKWARD_COMPATIBLE is not set
|
|
14
|
+
|
|
15
|
+
# Disable secondary console to avoid duplicate output
|
|
16
|
+
CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
|
|
17
|
+
|
|
18
|
+
# FreeRTOS tick rate — 1000 Hz gives 1 ms resolution for modMilliseconds
|
|
19
|
+
CONFIG_FREERTOS_HZ=1000
|
|
20
|
+
|
|
21
|
+
# Run the S3 at its full rated app CPU clock. Bouncing display workloads are
|
|
22
|
+
# otherwise CPU-bound before the 80 MHz QSPI flush finishes.
|
|
23
|
+
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
|
24
|
+
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240
|
|
25
|
+
|
|
26
|
+
# Main task stack for the app event loop. gea TSX frames can build deep
|
|
27
|
+
# reactive call chains before returning to the firmware loop.
|
|
28
|
+
CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768
|
|
29
|
+
CONFIG_ESP_IPC_TASK_STACK_SIZE=16384
|
|
30
|
+
|
|
31
|
+
# Wi-Fi scan/connect callbacks run on ESP-IDF's system event task.
|
|
32
|
+
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
|
|
33
|
+
|
|
34
|
+
# Custom partition table with two OTA slots for wireless updates
|
|
35
|
+
CONFIG_PARTITION_TABLE_CUSTOM=y
|
|
36
|
+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|
37
|
+
|
|
38
|
+
# On panic: print backtrace then reboot. (Halting was meant to "keep USB alive
|
|
39
|
+
# for reflashing", but a halted ESP32-S3 won't accept an esptool reset — it has
|
|
40
|
+
# to be recovered over JTAG. Rebooting allows the firmware to remain
|
|
41
|
+
# reachable for diagnosis and reflashing.)
|
|
42
|
+
CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
|
|
43
|
+
|
|
44
|
+
# Enable octal PSRAM for framebuffer
|
|
45
|
+
CONFIG_SPIRAM=y
|
|
46
|
+
CONFIG_SPIRAM_MODE_OCT=y
|
|
47
|
+
CONFIG_SPIRAM_SPEED_80M=y
|
|
48
|
+
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
|
|
49
|
+
CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=y
|
|
50
|
+
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
|
|
51
|
+
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
|
52
|
+
# IDF defaults this to 32 KiB when SPIRAM malloc is enabled. That creates a
|
|
53
|
+
# second DMA/internal heap by allocating a chunk from internal DRAM and
|
|
54
|
+
# re-registering it, which splits the physical heap map into a middle green
|
|
55
|
+
# reserve island. Keep internal memory globally allocatable; app/display code
|
|
56
|
+
# already asks for MALLOC_CAP_INTERNAL/MALLOC_CAP_DMA when it truly needs it.
|
|
57
|
+
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
|
|
58
|
+
|
|
59
|
+
# Wi-Fi memory budget: this board (200x200 1-bit e-paper) is severely tight on
|
|
60
|
+
# DMA-capable internal RAM with a heavy app (voice-notes). esp_wifi_init wants a
|
|
61
|
+
# contiguous ~8 KB internal block for its driver-task stack plus a static
|
|
62
|
+
# esf_buf pool; reserveInternal can't reclaim anything here (no large display
|
|
63
|
+
# staging on a 1-bit panel — unlike the AMOLED boards). The decisive fix is in
|
|
64
|
+
# code (targets/esp32-s3-epaper-1.54/main/display.cpp lazily allocates the
|
|
65
|
+
# grayscale plane, freeing ~10 KB DMA-internal in B/W mode; the WiFi bring-up
|
|
66
|
+
# worker stack was trimmed 24->16 KB). These config trims shave the static
|
|
67
|
+
# esf_buf pool so it fits the DMA-internal that remains. Lower WiFi throughput
|
|
68
|
+
# is fine for a personal note-transfer portal.
|
|
69
|
+
# Restored from the old esf_buf trims now that RAM is freed (display pendingPack_
|
|
70
|
+
# moved to PSRAM; steady-state internal free measured ~81 KB during an upload).
|
|
71
|
+
# The thin buffers let the WiFi link DROP under a sustained multi-MB upload (the
|
|
72
|
+
# station misses beacons/ACKs while busy TX'ing -> AP deauth -> the next note's
|
|
73
|
+
# connect fails "upload HTTP -10/-12"). More RX headroom (dynamic RX is allocated
|
|
74
|
+
# post-init, so no esp_wifi_init squeeze) keeps the link alive end-to-end. If
|
|
75
|
+
# esp_wifi_init NO_MEMs again, dial the STATIC numbers back down first.
|
|
76
|
+
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=6
|
|
77
|
+
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=16
|
|
78
|
+
CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=2
|
|
79
|
+
CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=4
|
|
80
|
+
CONFIG_ESP_WIFI_MGMT_SBUF_NUM=8
|
|
81
|
+
CONFIG_ESP_WIFI_RX_BA_WIN=8
|
|
82
|
+
# AMPDU stays ON for usable throughput on large uploads (a multi-MB WAV stalls
|
|
83
|
+
# without aggregation). The display grayscale-plane lazy-alloc freed ~10 KB of
|
|
84
|
+
# DMA-internal, which is what now lets esp_wifi_init fit the AMPDU esf_buf pool.
|
|
85
|
+
# Raise the LWIP socket pool: the WiFi diagnostics server (8081) and the app's
|
|
86
|
+
# transfer portal (8080) are separate esp_http_server instances and the default
|
|
87
|
+
# pool of 10 is exhausted by the diagnostics server's sockets, so httpd_start
|
|
88
|
+
# for the portal fails. 16 gives both room.
|
|
89
|
+
CONFIG_LWIP_MAX_SOCKETS=24
|
|
90
|
+
# Enlarge the TCP PCB pool so the transcription poll's short-lived TLS
|
|
91
|
+
# connections (each Connection: close -> a lingering TIME_WAIT) plus the two
|
|
92
|
+
# HTTP servers don't exhaust it and fail the next connect ("upload HTTP -12").
|
|
93
|
+
CONFIG_LWIP_MAX_ACTIVE_TCP=24
|
|
94
|
+
CONFIG_LWIP_MAX_LISTENING_TCP=16
|
|
95
|
+
# Upload throughput: the default TCP send window (4*MSS = 5760 B) caps a single
|
|
96
|
+
# stream at window/RTT — ~25 KB/s to api.soniox.com (~130-230 ms RTT). Widen the
|
|
97
|
+
# send buffer + window to the 16-bit max (no window-scaling needed) so multi-MB
|
|
98
|
+
# WAV uploads fill the pipe. CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y puts these
|
|
99
|
+
# buffers in PSRAM, so the internal-RAM budget (the esp_wifi_init squeeze) is
|
|
100
|
+
# untouched. Projected ~200-450 KB/s.
|
|
101
|
+
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65535
|
|
102
|
+
CONFIG_LWIP_TCP_WND_DEFAULT=65535
|
|
103
|
+
# CONFIG_ESP_WIFI_IRAM_OPT is not set
|
|
104
|
+
# CONFIG_ESP_WIFI_RX_IRAM_OPT is not set
|
|
105
|
+
# Wi-Fi driver task: IDF 5.5/6.0 no longer exposes a public
|
|
106
|
+
# CONFIG_ESP_WIFI_TASK_STACK_SIZE knob. targets/esp32/connectivity/wifi.cpp
|
|
107
|
+
# wraps wifi_init_config_t.osi_funcs task creation and bumps the closed-source
|
|
108
|
+
# "wifi" task to 8192 bytes there.
|
|
109
|
+
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096
|
|
110
|
+
|
|
111
|
+
# Firmware uses STA mode for OTA/log/mirror; trim unused Wi-Fi/LwIP features.
|
|
112
|
+
# CONFIG_ESP_WIFI_SOFTAP_SUPPORT is not set
|
|
113
|
+
# CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT is not set
|
|
114
|
+
# CONFIG_ESP_WIFI_ENABLE_WPA3_SAE is not set
|
|
115
|
+
# CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA is not set
|
|
116
|
+
# CONFIG_LWIP_IPV6 is not set
|
|
117
|
+
# CONFIG_LWIP_DHCPS is not set
|
|
118
|
+
|
|
119
|
+
# Bluetooth: NimBLE peripheral for BLE HID
|
|
120
|
+
CONFIG_BT_ENABLED=y
|
|
121
|
+
CONFIG_BT_NIMBLE_ENABLED=y
|
|
122
|
+
CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=y
|
|
123
|
+
# Mindy can simultaneously host its selected BLE controller and serve BLE-MIDI
|
|
124
|
+
# to a bonded peer while another MIDI/HID host reconnects. The shared BLE driver
|
|
125
|
+
# already keeps advertising while slots remain; reserve enough controller state
|
|
126
|
+
# for those three roles on the PSRAM-equipped PaperS3.
|
|
127
|
+
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=3
|
|
128
|
+
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y
|
|
129
|
+
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
|
|
130
|
+
CONFIG_BT_NIMBLE_ROLE_CENTRAL=n
|
|
131
|
+
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
|
|
132
|
+
CONFIG_BT_NIMBLE_SM_LEGACY=y
|
|
133
|
+
CONFIG_BT_NIMBLE_SM_SC=y
|
|
134
|
+
CONFIG_BT_NIMBLE_NVS_PERSIST=y
|
|
135
|
+
CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y
|
|
136
|
+
|
|
137
|
+
# Pin WiFi + BT controller + NimBLE host to core 1, leaving core 0 for the app
|
|
138
|
+
# frame/render task (GEA_EMBEDDED_APP_FRAME_TASK_CORE=0). IDF pins all of these
|
|
139
|
+
# to core 0 by default, where they contend with rendering: launching an app
|
|
140
|
+
# through the launcher dropped to ~22 fps because the per-chunk flush wait was
|
|
141
|
+
# preempted (19 ms vs 1.6 ms). Moving them to core 1 restores ~60 fps. Keep
|
|
142
|
+
# WiFi and BT on the SAME core for coexistence (ESP_COEX_SW_COEXIST_ENABLE).
|
|
143
|
+
CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1=y
|
|
144
|
+
CONFIG_BT_CTRL_PINNED_TO_CORE_1=y
|
|
145
|
+
CONFIG_BT_NIMBLE_PINNED_TO_CORE_1=y
|
|
146
|
+
|
|
147
|
+
# WebRTC: mbedTLS DTLS + DTLS-SRTP for esp_peer
|
|
148
|
+
# Required by espressif/esp_peer (DTLS-SRTP handshake, DTLS cookies, MTU
|
|
149
|
+
# config). Off by default in IDF — turning them on costs ~30-40 kB of
|
|
150
|
+
# mbedTLS code but is non-negotiable for SRTP-protected RTP.
|
|
151
|
+
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
|
|
152
|
+
CONFIG_MBEDTLS_SSL_DTLS_SRTP=y
|
|
153
|
+
CONFIG_MBEDTLS_SSL_DTLS_HELLO_VERIFY=y
|
|
154
|
+
CONFIG_MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE=y
|
|
155
|
+
CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID=y
|
|
156
|
+
# esp_peer generates a self-signed DTLS cert at runtime via
|
|
157
|
+
# mbedtls_x509write_crt_*; those live behind MBEDTLS_X509_CREATE_C, which
|
|
158
|
+
# ESP-IDF 6.0 flipped to default-off (was implicitly available in 5.5). Without
|
|
159
|
+
# it esp_peer fails to link (implicit-declaration of mbedtls_x509write_crt_*).
|
|
160
|
+
CONFIG_MBEDTLS_X509_CREATE_C=y
|
|
161
|
+
CONFIG_MBEDTLS_X509_CRT_WRITE_C=y
|
|
162
|
+
CONFIG_MBEDTLS_X509_CSR_WRITE_C=y
|
|
163
|
+
|
|
164
|
+
# Allocate mbedTLS memory from PSRAM instead of internal DRAM. IDF defaults to
|
|
165
|
+
# INTERNAL_MEM_ALLOC, but internal RAM is scarce on this board (app + 2-deep
|
|
166
|
+
# flush pipeline + WiFi driver). A TLS handshake's PSA signature verification
|
|
167
|
+
# and 16 KB input buffer then fail to allocate, surfacing as the misleading
|
|
168
|
+
# "esp-x509-crt-bundle: Certificate matched but signature verification failed"
|
|
169
|
+
# with PSA error -141 (PSA_ERROR_INSUFFICIENT_MEMORY) — a heap shortage, not a
|
|
170
|
+
# trust failure. PSRAM has megabytes free; the hardware MPI/crypto path copies
|
|
171
|
+
# operands into the peripheral so PSRAM-resident TLS buffers are fine.
|
|
172
|
+
# CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC is not set
|
|
173
|
+
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
|
|
174
|
+
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_CROSS_SIGNED_VERIFY=y
|
|
175
|
+
|
|
176
|
+
# Release optimization level. ESP-IDF defaults to -Og (DEBUG) which is
|
|
177
|
+
# friendly for debugging but leaves real perf on the table for compute-heavy
|
|
178
|
+
# code paths. -O2 (PERF) is the correct release setting.
|
|
179
|
+
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
|
180
|
+
# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set
|
|
181
|
+
|
|
182
|
+
# --- Development logging / diagnostics defaults ---
|
|
183
|
+
# VS Code launch tasks build per-app firmware under build/app-builds/<app>.
|
|
184
|
+
# Keep those dev builds chatty by default so serial monitor shows boot logs,
|
|
185
|
+
# gea.perf fps windows, frame scheduler diagnostics, and assertion failures.
|
|
186
|
+
# Production lockdown can still be enabled via menuconfig, but it is not the
|
|
187
|
+
# default for local flash/monitor iteration.
|
|
188
|
+
# CONFIG_GEA_EMBEDDED_PRODUCTION_LOCKDOWN is not set
|
|
189
|
+
|
|
190
|
+
# Runtime and bootloader logs visible on USB serial/JTAG.
|
|
191
|
+
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
|
|
192
|
+
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
|
193
|
+
CONFIG_LOG_DEFAULT_LEVEL=3
|
|
194
|
+
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
|
|
195
|
+
CONFIG_LOG_MAXIMUM_LEVEL=3
|
|
196
|
+
|
|
197
|
+
# Keep assertions enabled in local dev builds.
|
|
198
|
+
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
|
|
199
|
+
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
|
|
200
|
+
CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
|
|
201
|
+
|
|
202
|
+
# Keep early boot output visible too.
|
|
203
|
+
# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
|
|
204
|
+
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
|
|
205
|
+
CONFIG_BOOTLOADER_LOG_LEVEL=3
|
|
206
|
+
|
|
207
|
+
# Diagnostic allocation attribution. Keep standalone heap tracing available for
|
|
208
|
+
# app-init fragmentation investigations; trace records are placed in PSRAM by
|
|
209
|
+
# the caller, and tracing remains idle unless explicitly started.
|
|
210
|
+
# Heap tracing costs about a kilobyte of IRAM (1,067 bytes measured on
|
|
211
|
+
# esp32-s3-touch-amoled-2.06) and puts a hook on the allocator's hot path. On the
|
|
212
|
+
# S3 that IRAM is not free space: the linker sizes .dram0.dummy to whatever IRAM
|
|
213
|
+
# the image used, so every byte of .iram0.text is a byte the internal heap never
|
|
214
|
+
# gets -- and the internal heap is what DMA, USB host enumeration and aligned
|
|
215
|
+
# coefficient banks come out of. The framework's only users, the display and
|
|
216
|
+
# AXP2101 init traces, are already gated on GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG,
|
|
217
|
+
# which defaults to 0. So nothing traced by default and every app paid for it.
|
|
218
|
+
# Turn this and that macro on together when you actually want a trace.
|
|
219
|
+
CONFIG_HEAP_TRACING_OFF=y
|
|
220
|
+
# CONFIG_HEAP_TRACING_STANDALONE is not set
|
|
221
|
+
# CONFIG_HEAP_TRACING_TOHOST is not set
|
|
222
|
+
# CONFIG_HEAP_TRACING is not set
|
|
223
|
+
# CONFIG_HEAP_TRACE_HASH_MAP is not set
|
|
224
|
+
|
|
225
|
+
# geatsc-generated apps use real C++ exceptions: gea_runtime.h throws, and every
|
|
226
|
+
# emitted try/catch lowers to a typed C++ handler. IDF defaults to
|
|
227
|
+
# -fno-exceptions with __cxa_throw stubbed to abort, under which gcc rejects
|
|
228
|
+
# those handlers -- so no geatsc-built app compiles for this board without
|
|
229
|
+
# exception support. The emergency pool stays 0: the cost is unwind tables in
|
|
230
|
+
# flash and ~500 B of heap on the first throw, nothing at rest.
|
|
231
|
+
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
|
232
|
+
CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE=0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.16)
|
|
2
|
+
|
|
3
|
+
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/../esp32/components")
|
|
4
|
+
include("${CMAKE_CURRENT_LIST_DIR}/../esp32/app_project.cmake")
|
|
5
|
+
set(GEA_EMBEDDED_APP "tic-tac-toe" CACHE STRING "Example app to build (must match a package.json gea.id)")
|
|
6
|
+
set(PROJECT_VER "${GEA_EMBEDDED_APP}" CACHE STRING "Firmware app id" FORCE)
|
|
7
|
+
|
|
8
|
+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
|
9
|
+
idf_build_set_property(MINIMAL_BUILD ON)
|
|
10
|
+
project(gea_embedded)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
dependencies:
|
|
2
|
+
espressif/esp_codec_dev:
|
|
3
|
+
component_hash: df70f10af8d7b922add7b9d07372c9c97ab356e58d72b7a892050227c2d44348
|
|
4
|
+
dependencies:
|
|
5
|
+
- name: idf
|
|
6
|
+
require: private
|
|
7
|
+
version: '>=4.0'
|
|
8
|
+
source:
|
|
9
|
+
registry_url: https://components.espressif.com/
|
|
10
|
+
type: service
|
|
11
|
+
version: 1.5.11
|
|
12
|
+
espressif/esp_libsrtp:
|
|
13
|
+
component_hash: 131560184c73ec09f77d8904a2db709307803f0f9f111898921b6966776eac15
|
|
14
|
+
dependencies: []
|
|
15
|
+
source:
|
|
16
|
+
registry_url: https://components.espressif.com
|
|
17
|
+
type: service
|
|
18
|
+
version: 1.0.0
|
|
19
|
+
espressif/esp_peer:
|
|
20
|
+
component_hash: d6389ca3d0a218405a6d8a8a1afd67a4a47bd2657221f23e83bd537d770e7e3c
|
|
21
|
+
dependencies:
|
|
22
|
+
- name: espressif/esp_libsrtp
|
|
23
|
+
registry_url: https://components.espressif.com
|
|
24
|
+
require: private
|
|
25
|
+
version: ^1.0.0
|
|
26
|
+
source:
|
|
27
|
+
registry_url: https://components.espressif.com/
|
|
28
|
+
type: service
|
|
29
|
+
version: 1.4.2
|
|
30
|
+
espressif/esp_websocket_client:
|
|
31
|
+
component_hash: 3fb288702517ef4d75bf933a115f1056ee0c2540d964f9e1d856e0bb67e1dfeb
|
|
32
|
+
dependencies:
|
|
33
|
+
- name: idf
|
|
34
|
+
require: private
|
|
35
|
+
version: '>=5.0'
|
|
36
|
+
source:
|
|
37
|
+
registry_url: https://components.espressif.com/
|
|
38
|
+
type: service
|
|
39
|
+
version: 1.7.0
|
|
40
|
+
idf:
|
|
41
|
+
source:
|
|
42
|
+
type: idf
|
|
43
|
+
version: 6.0.1
|
|
44
|
+
direct_dependencies:
|
|
45
|
+
- espressif/esp_codec_dev
|
|
46
|
+
- espressif/esp_peer
|
|
47
|
+
- espressif/esp_websocket_client
|
|
48
|
+
- idf
|
|
49
|
+
manifest_hash: a3f83292864168da55b8c7df94cc400889710239d475e0baa4f187c2d709d266
|
|
50
|
+
target: esp32s3
|
|
51
|
+
version: 3.0.0
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# M5Stack StickS3 (ESP32-S3-PICO-1-N8R8, 1.14" ST7789V2 135x240 SPI LCD).
|
|
2
|
+
# The Gea app pipeline is shared with the ESP32 e-paper family component
|
|
3
|
+
# definition; only the StickS3 hardware/profile choices live here. The
|
|
4
|
+
# included definition resolves board-local sources (app_main.cpp, display.cpp,
|
|
5
|
+
# buttons.cpp, ...) relative to this component directory.
|
|
6
|
+
set(GEA_EMBEDDED_TARGET_MAIN_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
|
7
|
+
set(GEA_EMBEDDED_TARGET_CPP_BOARD "esp32-s3-m5stack-sticks3")
|
|
8
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_WIDTH 135)
|
|
9
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_HEIGHT 240)
|
|
10
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_NATIVE_WIDTH 135)
|
|
11
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_NATIVE_HEIGHT 240)
|
|
12
|
+
# 1.14" 135x240 IPS at ~241 PPI. DPR scales explicit CSS px to physical pixels:
|
|
13
|
+
# 1.0 maps 1 CSS px to 1 tiny device px (illegibly small); 2.0 gives a 67x120 CSS
|
|
14
|
+
# canvas (legible but too cramped for label+value info rows); 1.5 gives a 90x160
|
|
15
|
+
# canvas that fits the info screens while staying legible — matching the small
|
|
16
|
+
# high-density M5 panels (amoled-1.75 / elecrow-rotary also run 1.5).
|
|
17
|
+
set(GEA_EMBEDDED_TARGET_CSS_DEVICE_PIXEL_RATIO "1.5")
|
|
18
|
+
# Color IPS panel — do not inherit the epaper family's monochrome media flag.
|
|
19
|
+
set(GEA_EMBEDDED_TARGET_DISPLAY_MONOCHROME 0)
|
|
20
|
+
# Panel-endian framebuffer (like the amoled targets): the ST7789 latches
|
|
21
|
+
# RGB565 MSB-first, so storing pixels pre-swapped turns the flush byteswap
|
|
22
|
+
# into a straight memcpy.
|
|
23
|
+
set(GEA_EMBEDDED_TARGET_PIXEL_PANEL_ENDIAN 1)
|
|
24
|
+
# Parallel-replay thresholds stay at framework defaults: measured on this
|
|
25
|
+
# panel (2026-07-12), a 2-core band split LOWERED bouncing-balls-jsx from
|
|
26
|
+
# 54.5 to 52.3 fps — its replay cost is the per-node command walk (duplicated
|
|
27
|
+
# per band), not raster pixels. The default 65536-pixel gate exceeds the whole
|
|
28
|
+
# 135x240 panel, so the split stays off here.
|
|
29
|
+
# bootloader_support: the geatsc prelude seeds Math.random from the hardware
|
|
30
|
+
# RNG (bootloader_random.h). esp_driver_ledc: PWM backlight (display.cpp).
|
|
31
|
+
# spi_flash/esp_psram: put esp_flash.h/esp_psram.h on the include path so the
|
|
32
|
+
# diagnostics deviceInfo facade (app native/device_info.cpp) can report the 8MB
|
|
33
|
+
# flash + 8MB PSRAM instead of degrading to 0 (mirrors the m5paper target).
|
|
34
|
+
set(GEA_EMBEDDED_TARGET_EXTRA_REQUIRES bootloader_support esp_driver_ledc spi_flash esp_psram esp_driver_i2c)
|
|
35
|
+
|
|
36
|
+
# IMU: BMI270 (6-axis accel+gyro) on the shared primary I2C bus at 0x68, driving
|
|
37
|
+
# gea::platform::sensors::Accelerometer (tilt/level tool, air-mouse, etc.).
|
|
38
|
+
set(GEA_EMBEDDED_TARGET_EXTRA_SOURCES
|
|
39
|
+
"${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/imu/bmi270.cpp")
|
|
40
|
+
|
|
41
|
+
include("${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-epaper-1.54/main/CMakeLists.txt")
|
|
42
|
+
|
|
43
|
+
# Generated app archives are linked after ESP-IDF's component archives. Force
|
|
44
|
+
# the hardware RNG implementation out of bootloader_support before that final
|
|
45
|
+
# archive introduces its references (mirrors the m5paper target).
|
|
46
|
+
if(NOT CMAKE_SCRIPT_MODE_FILE)
|
|
47
|
+
target_link_libraries(${COMPONENT_LIB} INTERFACE
|
|
48
|
+
"-u bootloader_random_enable"
|
|
49
|
+
"-u bootloader_random_disable"
|
|
50
|
+
)
|
|
51
|
+
endif()
|
|
@@ -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,130 @@
|
|
|
1
|
+
#include "gea_embedded_app_config.h"
|
|
2
|
+
|
|
3
|
+
#include "apps/app_manager.h"
|
|
4
|
+
#include "buttons.h"
|
|
5
|
+
#ifndef GEA_EMBEDDED_BLE_DISABLED
|
|
6
|
+
#include "connectivity/ble_hid.h"
|
|
7
|
+
#endif
|
|
8
|
+
#include "display.h"
|
|
9
|
+
#include "host/display_orientation.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
|
+
#include "memory_config.h"
|
|
20
|
+
#include "runtime.h"
|
|
21
|
+
#include "services/device_control.h"
|
|
22
|
+
|
|
23
|
+
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG
|
|
24
|
+
#include "esp_heap_caps.h"
|
|
25
|
+
#endif
|
|
26
|
+
#include "esp_log.h"
|
|
27
|
+
#include "sdkconfig.h"
|
|
28
|
+
#include "freertos/FreeRTOS.h"
|
|
29
|
+
#include "freertos/task.h"
|
|
30
|
+
|
|
31
|
+
namespace {
|
|
32
|
+
|
|
33
|
+
constexpr const char *kTag = "gea_embedded";
|
|
34
|
+
|
|
35
|
+
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG
|
|
36
|
+
void logHeapProbe(const char *stage)
|
|
37
|
+
{
|
|
38
|
+
ESP_LOGI(kTag,
|
|
39
|
+
"heap probe [%s] internal_free=%u internal_largest=%u internal_min=%u psram_free=%u",
|
|
40
|
+
stage ? stage : "?",
|
|
41
|
+
static_cast<unsigned>(heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)),
|
|
42
|
+
static_cast<unsigned>(heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)),
|
|
43
|
+
static_cast<unsigned>(heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)),
|
|
44
|
+
static_cast<unsigned>(heap_caps_get_free_size(MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT)));
|
|
45
|
+
}
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
constexpr int kAppMainTaskStack = CONFIG_ESP_MAIN_TASK_STACK_SIZE;
|
|
49
|
+
// An app whose own realtime tasks must outrank the render loop (audio DSP, a USB
|
|
50
|
+
// isochronous host) sets gea.defines.GEA_EMBEDDED_RUNTIME_TASK_PRIORITY to place
|
|
51
|
+
// this below them; the default is what this board needs on its own.
|
|
52
|
+
#ifndef GEA_EMBEDDED_RUNTIME_TASK_PRIORITY
|
|
53
|
+
#define GEA_EMBEDDED_RUNTIME_TASK_PRIORITY 5
|
|
54
|
+
#endif
|
|
55
|
+
constexpr UBaseType_t kRuntimeTaskPriority = GEA_EMBEDDED_RUNTIME_TASK_PRIORITY;
|
|
56
|
+
|
|
57
|
+
#if GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LOG
|
|
58
|
+
void logCurrentTaskStack(const char *stage, int stackBytes)
|
|
59
|
+
{
|
|
60
|
+
TaskHandle_t currentTask = xTaskGetCurrentTaskHandle();
|
|
61
|
+
ESP_LOGI(kTag,
|
|
62
|
+
"stack probe [%s] task=%s core=%d stack_arg=%d hwm=%u",
|
|
63
|
+
stage ? stage : "?",
|
|
64
|
+
currentTask ? pcTaskGetName(currentTask) : "?",
|
|
65
|
+
static_cast<int>(xPortGetCoreID()),
|
|
66
|
+
stackBytes,
|
|
67
|
+
static_cast<unsigned>(uxTaskGetStackHighWaterMark(currentTask)));
|
|
68
|
+
}
|
|
69
|
+
#endif
|
|
70
|
+
|
|
71
|
+
void runRuntime()
|
|
72
|
+
{
|
|
73
|
+
gea::framework::RuntimeOptions options{};
|
|
74
|
+
options.width = gea::framework::display::detail::DisplayOrientationState::width();
|
|
75
|
+
options.height = gea::framework::display::detail::DisplayOrientationState::height();
|
|
76
|
+
gea::framework::Runtime::run(options);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
} // namespace
|
|
80
|
+
|
|
81
|
+
extern "C" void app_main(void)
|
|
82
|
+
{
|
|
83
|
+
// KEY1/KEY2 face buttons → ArrowUp/ArrowDown keydown events (the board's
|
|
84
|
+
// only physical input besides the PMIC-managed power button).
|
|
85
|
+
gea::platform::esp32_s3_sticks3::buttons::startButtonsTask();
|
|
86
|
+
|
|
87
|
+
// Force the targets/esp32/apps/app_manager.cpp TU to be linked in. That
|
|
88
|
+
// TU's only side effect is a file-scope `PlatformRegistration` whose
|
|
89
|
+
// constructor calls AppManager::setPlatform(...). With -Wl,--gc-sections
|
|
90
|
+
// and the main component built as a static archive, nothing else
|
|
91
|
+
// references launcherPlatform(), so the linker drops the entire object
|
|
92
|
+
// file — the static ctor never runs, AppManager::platform_ stays null,
|
|
93
|
+
// and AppManager::startLauncherButtonTask() / returnRunningAppToLauncher
|
|
94
|
+
// / ... all become silent no-ops. Result: the BOOT button task is never
|
|
95
|
+
// created and no `launcher_button` log lines are ever emitted.
|
|
96
|
+
(void)gea::platform::esp32::apps::launcherPlatform();
|
|
97
|
+
|
|
98
|
+
// Same static-archive trap as `launcherPlatform()` above: the ESP32 WiFi
|
|
99
|
+
// driver TU's only side effect is an anonymous-namespace static-init
|
|
100
|
+
// global with no external references, so the archive linker would drop it
|
|
101
|
+
// and leave the silent NullWifiDriver active. Register explicitly.
|
|
102
|
+
#ifndef GEA_EMBEDDED_WIFI_DISABLED
|
|
103
|
+
gea::targets::esp32::wifi::registerDriver();
|
|
104
|
+
#endif
|
|
105
|
+
|
|
106
|
+
// Same static-archive trap: reference the HID driver explicitly so its TU
|
|
107
|
+
// is pulled in and `HidServer` replaces the board-independent
|
|
108
|
+
// `NullBleDriver`.
|
|
109
|
+
#ifndef GEA_EMBEDDED_BLE_DISABLED
|
|
110
|
+
gea::targets::esp32::ble::registerHidDriver();
|
|
111
|
+
#endif
|
|
112
|
+
|
|
113
|
+
vTaskPrioritySet(nullptr, kRuntimeTaskPriority);
|
|
114
|
+
#if GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LOG
|
|
115
|
+
logCurrentTaskStack("main_task:before_runtime", kAppMainTaskStack);
|
|
116
|
+
#endif
|
|
117
|
+
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG
|
|
118
|
+
logHeapProbe("app_main:before_device_control_task");
|
|
119
|
+
#endif
|
|
120
|
+
gea::platform::esp32::services::startDeviceControlTask();
|
|
121
|
+
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG
|
|
122
|
+
logHeapProbe("app_main:before_runtime");
|
|
123
|
+
#endif
|
|
124
|
+
runRuntime();
|
|
125
|
+
|
|
126
|
+
ESP_LOGE(kTag, "Runtime returned unexpectedly; parking main task");
|
|
127
|
+
while (true) {
|
|
128
|
+
vTaskDelay(pdMS_TO_TICKS(1000));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// The M5Stack StickS3 has two user buttons on the face, KEY1 (GPIO11) and
|
|
2
|
+
// KEY2 (GPIO12), both active low with pull-ups. They are the board's only
|
|
3
|
+
// GPIO input (the side power button talks to the M5PM1 PMIC, and power
|
|
4
|
+
// on/off/download-mode chords are handled in PMIC hardware), so deliver them
|
|
5
|
+
// to apps as web keydown events — KEY1 = ArrowUp (38), KEY2 = ArrowDown (40)
|
|
6
|
+
// — via the same queue the runtime frame loop drains. Held buttons
|
|
7
|
+
// auto-repeat.
|
|
8
|
+
#include "buttons.h"
|
|
9
|
+
|
|
10
|
+
#include "board.h"
|
|
11
|
+
#include "input.h"
|
|
12
|
+
|
|
13
|
+
#include <cstdint>
|
|
14
|
+
|
|
15
|
+
#include "driver/gpio.h"
|
|
16
|
+
#include "esp_log.h"
|
|
17
|
+
#include "esp_timer.h"
|
|
18
|
+
#include "freertos/FreeRTOS.h"
|
|
19
|
+
#include "freertos/task.h"
|
|
20
|
+
|
|
21
|
+
namespace gea::platform::esp32_s3_sticks3::buttons {
|
|
22
|
+
|
|
23
|
+
namespace {
|
|
24
|
+
|
|
25
|
+
constexpr const char *kTag = "sticks3_buttons";
|
|
26
|
+
constexpr gpio_num_t kUpPin = gea::platform::board::buttons.key1;
|
|
27
|
+
constexpr gpio_num_t kDownPin = gea::platform::board::buttons.key2;
|
|
28
|
+
constexpr int kUpKeyCode = 38; // ArrowUp
|
|
29
|
+
constexpr int kDownKeyCode = 40; // ArrowDown
|
|
30
|
+
constexpr int kPollMs = 20;
|
|
31
|
+
constexpr int kDebouncePolls = 2; // 2 consecutive matching reads = stable
|
|
32
|
+
constexpr int kRepeatDelayMs = 450; // hold this long before auto-repeat
|
|
33
|
+
constexpr int kRepeatIntervalMs = 200; // then one press per interval
|
|
34
|
+
constexpr std::uint32_t kTaskStackBytes = 3072;
|
|
35
|
+
constexpr UBaseType_t kTaskPriority = 10;
|
|
36
|
+
|
|
37
|
+
struct ButtonState {
|
|
38
|
+
gpio_num_t pin;
|
|
39
|
+
int keyCode;
|
|
40
|
+
bool pressed = false;
|
|
41
|
+
int stablePolls = 0;
|
|
42
|
+
std::int64_t pressedAtUs = 0;
|
|
43
|
+
std::int64_t lastRepeatUs = 0;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
void pollButton(ButtonState &button)
|
|
47
|
+
{
|
|
48
|
+
const bool rawPressed = gpio_get_level(button.pin) == 0;
|
|
49
|
+
if (rawPressed != button.pressed) {
|
|
50
|
+
if (++button.stablePolls < kDebouncePolls) return;
|
|
51
|
+
button.stablePolls = 0;
|
|
52
|
+
button.pressed = rawPressed;
|
|
53
|
+
if (rawPressed) {
|
|
54
|
+
const std::int64_t now = esp_timer_get_time();
|
|
55
|
+
button.pressedAtUs = now;
|
|
56
|
+
button.lastRepeatUs = now;
|
|
57
|
+
gea::framework::input::queueKeyDown(button.keyCode);
|
|
58
|
+
}
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
button.stablePolls = 0;
|
|
62
|
+
if (!button.pressed) return;
|
|
63
|
+
const std::int64_t now = esp_timer_get_time();
|
|
64
|
+
if (now - button.pressedAtUs < static_cast<std::int64_t>(kRepeatDelayMs) * 1000) return;
|
|
65
|
+
if (now - button.lastRepeatUs < static_cast<std::int64_t>(kRepeatIntervalMs) * 1000) return;
|
|
66
|
+
button.lastRepeatUs = now;
|
|
67
|
+
gea::framework::input::queueKeyDown(button.keyCode);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
void buttonsTask(void *)
|
|
71
|
+
{
|
|
72
|
+
ButtonState up{kUpPin, kUpKeyCode};
|
|
73
|
+
ButtonState down{kDownPin, kDownKeyCode};
|
|
74
|
+
for (;;) {
|
|
75
|
+
vTaskDelay(pdMS_TO_TICKS(kPollMs));
|
|
76
|
+
pollButton(up);
|
|
77
|
+
pollButton(down);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
} // namespace
|
|
82
|
+
|
|
83
|
+
void startButtonsTask()
|
|
84
|
+
{
|
|
85
|
+
gpio_config_t conf = {};
|
|
86
|
+
conf.intr_type = GPIO_INTR_DISABLE;
|
|
87
|
+
conf.mode = GPIO_MODE_INPUT;
|
|
88
|
+
conf.pin_bit_mask = (1ULL << kUpPin) | (1ULL << kDownPin);
|
|
89
|
+
conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
|
|
90
|
+
conf.pull_up_en = GPIO_PULLUP_ENABLE;
|
|
91
|
+
ESP_ERROR_CHECK_WITHOUT_ABORT(gpio_config(&conf));
|
|
92
|
+
|
|
93
|
+
if (xTaskCreatePinnedToCore(buttonsTask, "sticks3_buttons", kTaskStackBytes, nullptr, kTaskPriority, nullptr, 1) != pdPASS) {
|
|
94
|
+
ESP_LOGE(kTag, "failed to start buttons task");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
ESP_LOGI(kTag, "buttons ready: KEY1(GPIO%d)=ArrowUp KEY2(GPIO%d)=ArrowDown",
|
|
98
|
+
static_cast<int>(kUpPin), static_cast<int>(kDownPin));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
} // namespace gea::platform::esp32_s3_sticks3::buttons
|