@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,84 @@
|
|
|
1
|
+
# ESP32-P4 full-resolution camera capture (to SD card)
|
|
2
|
+
|
|
3
|
+
Captures a **full-resolution (1920×1080) still** and a **1080p H.264 video** from the
|
|
4
|
+
Waveshare ESP32-P4's OV5647 camera using the board's **hardware JPEG / H.264
|
|
5
|
+
encoders**, writes them to the **microSD card**, then pulls the on-card files off
|
|
6
|
+
over the USB-serial console with a **chunked, CRC-verified transfer** — the pulled
|
|
7
|
+
files are bit-perfect copies of what's on the card.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Build + flash the camera-studio app (1920x1080 sensor mode + HW H.264 + SD)
|
|
13
|
+
npx gea build --board waveshare-p4-7 --app camera-studio
|
|
14
|
+
npx gea flash --board waveshare-p4-7 --app camera-studio
|
|
15
|
+
|
|
16
|
+
# Capture a still + a 10s clip into targets/.../captures/
|
|
17
|
+
python3 targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py
|
|
18
|
+
|
|
19
|
+
# Options
|
|
20
|
+
python3 tools/capture-camera.py --still-only
|
|
21
|
+
python3 tools/capture-camera.py --clip-only --seconds 10
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Outputs (host copies; the originals also remain on the SD card as `/sdcard/frame.jpg`
|
|
25
|
+
and `/sdcard/clip.h264`):
|
|
26
|
+
- `captures/frame_<ts>.jpg` — 1920×1080 hardware-JPEG still (~750 KB)
|
|
27
|
+
- `captures/clip_<ts>.h264` — 1080p hardware-H.264 elementary stream
|
|
28
|
+
- `captures/clip_<ts>.mp4` — remuxed with ffmpeg (if installed), plays anywhere
|
|
29
|
+
|
|
30
|
+
## How it works
|
|
31
|
+
|
|
32
|
+
**Sensor / encoders / SD** (`sdkconfig` / `sdkconfig.defaults`):
|
|
33
|
+
- `CONFIG_CAMERA_OV5647_MIPI_RAW10_1920x1080_30FPS` — the OV5647 driver's max mode
|
|
34
|
+
(no higher/5MP mode exists), so 1080p is "full resolution" here.
|
|
35
|
+
- `CONFIG_ESP_VIDEO_ENABLE_HW_H264_VIDEO_DEVICE` — the P4 HW H.264 encoder as a V4L2
|
|
36
|
+
M2M device at `/dev/video11`.
|
|
37
|
+
- `CONFIG_ESP_CONSOLE_UART_CUSTOM` + `…_BAUDRATE=921600` — fast console so the pull
|
|
38
|
+
isn't UART-bound (host reads the baud-agnostic USB-JTAG side via the `IOSSIOSPEED`
|
|
39
|
+
ioctl).
|
|
40
|
+
- `CONFIG_VFS_MAX_COUNT=16` — esp_video registers several `/dev/video*` VFS entries;
|
|
41
|
+
the default of 8 leaves no slot for the `/sdcard` mount.
|
|
42
|
+
- `CONFIG_FATFS_SECTOR_512=y` + `CONFIG_FATFS_USE_LABEL=y` — SD cards use 512-byte
|
|
43
|
+
sectors (IDF defaults to 4096), and the exFAT code path needs the volume-label
|
|
44
|
+
option defined.
|
|
45
|
+
- **exFAT** (cards ≥64GB usually ship exFAT, which IDF's FATFS disables and exposes no
|
|
46
|
+
Kconfig for) is enabled **without touching the ESP-IDF tree**: `main/fatfs_ffconf.h`
|
|
47
|
+
is a repo-local copy of IDF's `ffconf.h` with `FF_FS_EXFAT=1`, force-included into
|
|
48
|
+
the fatfs component from `main/CMakeLists.txt` (`-include …/fatfs_ffconf.h`). Its
|
|
49
|
+
`#ifndef _FFCONF_DEFINED` guard makes IDF's own ffconf.h a no-op, so the override
|
|
50
|
+
wins and the config is fully reproducible from the repo. If ESP-IDF is upgraded,
|
|
51
|
+
re-sync `fatfs_ffconf.h` from the new `components/fatfs/src/ffconf.h`.
|
|
52
|
+
|
|
53
|
+
**Device** (`main/camera.cpp`, `CameraDriver`):
|
|
54
|
+
- Mounts the microSD at `/sdcard` (SDMMC slot 1, 4-bit, CLK43/CMD44/D0–D3=39–42, P4
|
|
55
|
+
on-chip LDO channel 4 for the SD I/O rail).
|
|
56
|
+
- `captureStillToSd()` — one full-res frame → HW JPEG → `/sdcard/frame.jpg`.
|
|
57
|
+
- `recordH264ClipToFile()` — switches `/dev/video0` to YUV420, drains warmup frames,
|
|
58
|
+
drives the `/dev/video11` M2M encoder for the duration into a **persistent PSRAM
|
|
59
|
+
buffer** (allocated before the camera reconfiguration so the contiguous alloc
|
|
60
|
+
succeeds; reused across captures), then **bulk-writes** the clip to SD. Buffering in
|
|
61
|
+
RAM keeps the capture at ~15 fps — a per-frame fwrite to SD inside the loop halves
|
|
62
|
+
it. `min_qp=22 @ 5 Mbps` → good 1080p, ~6–7 MB / 10s.
|
|
63
|
+
|
|
64
|
+
**GEADEV commands** (weak `geaHandleExtraDevCommand` hook in
|
|
65
|
+
`targets/esp32/services/device_control.cpp`, overridden in `camera.cpp` for the P4):
|
|
66
|
+
- `GEADEV CAMSTILL` → writes `/sdcard/frame.jpg`, returns size
|
|
67
|
+
- `GEADEV CAMCLIP [seconds]` → writes `/sdcard/clip.h264`, returns size/frames/fps
|
|
68
|
+
- `GEADEV STAT <path>` → file size
|
|
69
|
+
- `GEADEV GET <path> <off> <len>` → CRC-tagged base64 chunk (reflected CRC-32)
|
|
70
|
+
|
|
71
|
+
**Host** (`tools/capture-camera.py`): triggers the capture, then pulls the file in
|
|
72
|
+
64 KB chunks; each chunk is CRC-checked and re-requested on mismatch, so dropped
|
|
73
|
+
serial lines never corrupt the result.
|
|
74
|
+
|
|
75
|
+
## Notes / characteristics
|
|
76
|
+
|
|
77
|
+
- Capture runs at ~15 fps at 1080p (the synchronous capture→encode loop); a 10s clip
|
|
78
|
+
is ~147 frames played at ~15 fps — a faithful 10 seconds of real time, **0 decode
|
|
79
|
+
errors** (the CRC-verified pull is bit-perfect).
|
|
80
|
+
- The serial pull is the slow part (~20–25 KB/s → a 7 MB clip ≈ 4–5 min). It's fully
|
|
81
|
+
automated and reliable; the originals also sit on the SD card if you'd rather pull
|
|
82
|
+
the card. (Faster transfer would need WiFi/HTTP or USB mass-storage.)
|
|
83
|
+
- Recording freezes the on-screen preview for its duration (the camera is exclusively
|
|
84
|
+
owned during capture).
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Capture a full-resolution still + a 1080p H.264 clip from the ESP32-P4 camera.
|
|
3
|
+
|
|
4
|
+
The device records to its microSD card (using the board's hardware JPEG / H.264
|
|
5
|
+
encoders), then this tool pulls the on-card files off over the USB-serial console
|
|
6
|
+
with a chunked, CRC-verified transfer that re-requests any corrupted chunk — so the
|
|
7
|
+
pulled files are bit-perfect copies of what's on the card.
|
|
8
|
+
|
|
9
|
+
GEADEV CAMSTILL -> writes /sdcard/frame.jpg, returns size
|
|
10
|
+
GEADEV CAMCLIP [seconds] -> writes /sdcard/clip.h264, returns size/frames/fps
|
|
11
|
+
GEADEV STAT <path> -> file size
|
|
12
|
+
GEADEV GET <path> <off> <len> -> CRC-tagged base64 chunk
|
|
13
|
+
|
|
14
|
+
Outputs land in targets/esp32-p4-waveshare-touch-lcd-7/captures/:
|
|
15
|
+
- frame_<ts>.jpg 1920x1080 hardware-JPEG still
|
|
16
|
+
- clip_<ts>.h264 1080p hardware-H.264 elementary stream
|
|
17
|
+
- clip_<ts>.mp4 remuxed with ffmpeg (if installed)
|
|
18
|
+
|
|
19
|
+
Examples:
|
|
20
|
+
python3 tools/capture-camera.py # still + 10s clip
|
|
21
|
+
python3 tools/capture-camera.py --clip-only --seconds 10
|
|
22
|
+
python3 tools/capture-camera.py --still-only
|
|
23
|
+
"""
|
|
24
|
+
import argparse
|
|
25
|
+
import array
|
|
26
|
+
import base64
|
|
27
|
+
import binascii
|
|
28
|
+
import fcntl
|
|
29
|
+
import glob
|
|
30
|
+
import json
|
|
31
|
+
import os
|
|
32
|
+
import select
|
|
33
|
+
import shutil
|
|
34
|
+
import subprocess
|
|
35
|
+
import sys
|
|
36
|
+
import termios
|
|
37
|
+
import time
|
|
38
|
+
|
|
39
|
+
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
40
|
+
TARGET_DIR = os.path.dirname(THIS_DIR)
|
|
41
|
+
REPO = os.path.abspath(os.path.join(TARGET_DIR, "..", ".."))
|
|
42
|
+
CAPTURES = os.path.join(TARGET_DIR, "captures")
|
|
43
|
+
CHUNK = 64 * 1024 # bytes per GET request — small enough that a dropped line is rare
|
|
44
|
+
# per chunk, so the CRC-mismatch retry reliably converges.
|
|
45
|
+
|
|
46
|
+
# CRC matching the device's crc32z() in camera.cpp (reflected poly 0xEDB88820). Used
|
|
47
|
+
# only to verify each pulled chunk end-to-end; it just has to agree with the device.
|
|
48
|
+
_CRC_TABLE = [0] * 256
|
|
49
|
+
for _i in range(256):
|
|
50
|
+
_c = _i
|
|
51
|
+
for _ in range(8):
|
|
52
|
+
_c = ((_c >> 1) ^ (0xEDB88820 if (_c & 1) else 0)) & 0xFFFFFFFF
|
|
53
|
+
_CRC_TABLE[_i] = _c
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def device_crc32(data):
|
|
57
|
+
c = 0xFFFFFFFF
|
|
58
|
+
for b in data:
|
|
59
|
+
c = ((c >> 8) ^ _CRC_TABLE[(c ^ b) & 0xFF]) & 0xFFFFFFFF
|
|
60
|
+
return (c ^ 0xFFFFFFFF) & 0xFFFFFFFF
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class SerialPort:
|
|
64
|
+
"""The GEADEV console opened without touching DTR/RTS: a modem-line pulse
|
|
65
|
+
drops a USB-Serial-JTAG board into ROM download mode."""
|
|
66
|
+
|
|
67
|
+
def __init__(self, port, baud, trace=False):
|
|
68
|
+
self.path = port
|
|
69
|
+
self.fd = os.open(self.path, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
|
|
70
|
+
attrs = termios.tcgetattr(self.fd)
|
|
71
|
+
attrs[0] = 0
|
|
72
|
+
attrs[1] = 0
|
|
73
|
+
attrs[2] = (attrs[2] | termios.CLOCAL | termios.CREAD | termios.CS8) & ~termios.CSIZE
|
|
74
|
+
attrs[2] |= termios.CS8
|
|
75
|
+
attrs[3] = 0
|
|
76
|
+
attrs[4] = termios.B115200
|
|
77
|
+
attrs[5] = termios.B115200
|
|
78
|
+
attrs[6][termios.VMIN] = 0
|
|
79
|
+
attrs[6][termios.VTIME] = 0
|
|
80
|
+
termios.tcsetattr(self.fd, termios.TCSANOW, attrs)
|
|
81
|
+
if baud != 115200:
|
|
82
|
+
set_baud_macos(self.fd, baud)
|
|
83
|
+
termios.tcflush(self.fd, termios.TCIFLUSH)
|
|
84
|
+
self.buffer = bytearray()
|
|
85
|
+
self.trace = trace
|
|
86
|
+
|
|
87
|
+
def close(self):
|
|
88
|
+
if self.fd is not None:
|
|
89
|
+
os.close(self.fd)
|
|
90
|
+
self.fd = None
|
|
91
|
+
|
|
92
|
+
def write_line(self, line):
|
|
93
|
+
data = (line.rstrip("\r\n") + "\n").encode("ascii")
|
|
94
|
+
view = memoryview(data)
|
|
95
|
+
offset = 0
|
|
96
|
+
while offset < len(data):
|
|
97
|
+
_, writable, _ = select.select([], [self.fd], [], 5.0)
|
|
98
|
+
if not writable:
|
|
99
|
+
continue
|
|
100
|
+
try:
|
|
101
|
+
offset += os.write(self.fd, view[offset:])
|
|
102
|
+
except BlockingIOError:
|
|
103
|
+
continue
|
|
104
|
+
|
|
105
|
+
def read_line(self, timeout):
|
|
106
|
+
deadline = time.monotonic() + timeout
|
|
107
|
+
while True:
|
|
108
|
+
newline = self.buffer.find(b"\n")
|
|
109
|
+
if newline >= 0:
|
|
110
|
+
raw = self.buffer[:newline]
|
|
111
|
+
del self.buffer[: newline + 1]
|
|
112
|
+
return raw.rstrip(b"\r").decode("utf-8", "replace")
|
|
113
|
+
remaining = deadline - time.monotonic()
|
|
114
|
+
if remaining <= 0:
|
|
115
|
+
return None
|
|
116
|
+
ready, _, _ = select.select([self.fd], [], [], remaining)
|
|
117
|
+
if not ready:
|
|
118
|
+
return None
|
|
119
|
+
try:
|
|
120
|
+
chunk = os.read(self.fd, 4096)
|
|
121
|
+
except BlockingIOError:
|
|
122
|
+
continue
|
|
123
|
+
if chunk:
|
|
124
|
+
self.buffer.extend(chunk)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def board_port():
|
|
128
|
+
"""Pick the console when exactly one USB-serial device is attached; with
|
|
129
|
+
several, the caller must say which one with --port (addresses are not
|
|
130
|
+
stable board identities, so nothing here guesses)."""
|
|
131
|
+
candidates = sorted(glob.glob("/dev/cu.usbmodem*") + glob.glob("/dev/ttyACM*"))
|
|
132
|
+
if len(candidates) == 1:
|
|
133
|
+
return candidates[0]
|
|
134
|
+
if not candidates:
|
|
135
|
+
raise SystemExit("no USB serial device found; pass --port")
|
|
136
|
+
raise SystemExit("several USB serial devices found; pass --port for the P4 console: " + ", ".join(candidates))
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def set_baud_macos(fd, baud):
|
|
140
|
+
"""Set an arbitrary baud the macOS way (termios has no B921600). The P4 console
|
|
141
|
+
runs at 921600 and its USB-CDC line coding follows it, so the host must match."""
|
|
142
|
+
IOSSIOSPEED = 0x80045402
|
|
143
|
+
fcntl.ioctl(fd, IOSSIOSPEED, array.array("i", [baud]), True)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def parse_kv(line):
|
|
147
|
+
kv = {}
|
|
148
|
+
for tok in line.split():
|
|
149
|
+
if "=" in tok:
|
|
150
|
+
k, v = tok.split("=", 1)
|
|
151
|
+
kv[k] = v
|
|
152
|
+
return kv
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def drain(port, quiet_for=0.4, max_wait=3.0):
|
|
156
|
+
"""Read+discard pending serial lines until the channel is quiet, so a command we
|
|
157
|
+
send next isn't corrupted by a backlog of perf-log spam."""
|
|
158
|
+
deadline = time.monotonic() + max_wait
|
|
159
|
+
while time.monotonic() < deadline:
|
|
160
|
+
if port.read_line(quiet_for) is None:
|
|
161
|
+
return
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class CommandCorrupted(Exception):
|
|
165
|
+
pass
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def command(port, cmd, ok_prefix, timeout):
|
|
169
|
+
"""Send `cmd`, read lines until one starts with `ok_prefix` (returns its kv dict).
|
|
170
|
+
Raises CommandCorrupted on 'unknown-command' (garbled in transit) or a matching
|
|
171
|
+
'GEADEV:ERR <verb>' failure. Tolerates interleaved log lines."""
|
|
172
|
+
verb = cmd.split()[1] if len(cmd.split()) > 1 else ""
|
|
173
|
+
drain(port)
|
|
174
|
+
port.write_line(cmd)
|
|
175
|
+
deadline = time.monotonic() + timeout
|
|
176
|
+
while True:
|
|
177
|
+
remaining = deadline - time.monotonic()
|
|
178
|
+
if remaining <= 0:
|
|
179
|
+
raise TimeoutError(f"no response to {cmd!r}")
|
|
180
|
+
line = port.read_line(min(remaining, 30.0))
|
|
181
|
+
if line is None:
|
|
182
|
+
continue
|
|
183
|
+
if line.startswith("GEADEV:ERR unknown-command"):
|
|
184
|
+
raise CommandCorrupted(line)
|
|
185
|
+
if line.startswith(f"GEADEV:ERR {verb}"):
|
|
186
|
+
raise RuntimeError(line)
|
|
187
|
+
if line.startswith(ok_prefix):
|
|
188
|
+
return parse_kv(line)
|
|
189
|
+
if port.trace and line.startswith("GEADEV:"):
|
|
190
|
+
print(line, file=sys.stderr)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def command_retry(port, cmd, ok_prefix, timeout, retries=4):
|
|
194
|
+
last = None
|
|
195
|
+
for attempt in range(retries):
|
|
196
|
+
try:
|
|
197
|
+
return command(port, cmd, ok_prefix, timeout)
|
|
198
|
+
except CommandCorrupted as e:
|
|
199
|
+
last = e
|
|
200
|
+
print(f" (command garbled, retry {attempt + 1}/{retries})", file=sys.stderr)
|
|
201
|
+
time.sleep(0.3)
|
|
202
|
+
raise RuntimeError(f"{cmd!r} kept getting corrupted: {last}")
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def read_until(port, end_marker, overall_timeout, quiet_eos=5.0):
|
|
206
|
+
"""Drain raw bytes into one bytearray until `end_marker` appears (or the channel
|
|
207
|
+
goes quiet after data). Tight loop so the OS serial buffer never overflows."""
|
|
208
|
+
buf = bytearray(port.buffer)
|
|
209
|
+
port.buffer = bytearray()
|
|
210
|
+
deadline = time.monotonic() + overall_timeout
|
|
211
|
+
search_from = 0
|
|
212
|
+
last_recv = time.monotonic()
|
|
213
|
+
while True:
|
|
214
|
+
idx = buf.find(end_marker, search_from)
|
|
215
|
+
if idx >= 0:
|
|
216
|
+
return bytes(buf)
|
|
217
|
+
search_from = max(0, len(buf) - len(end_marker))
|
|
218
|
+
now = time.monotonic()
|
|
219
|
+
if len(buf) > 0 and now - last_recv > quiet_eos:
|
|
220
|
+
return bytes(buf)
|
|
221
|
+
if now >= deadline:
|
|
222
|
+
return bytes(buf)
|
|
223
|
+
r, _, _ = select.select([port.fd], [], [], min(deadline - now, 2.0))
|
|
224
|
+
if not r:
|
|
225
|
+
continue
|
|
226
|
+
chunk = os.read(port.fd, 1 << 16)
|
|
227
|
+
if chunk:
|
|
228
|
+
buf += chunk
|
|
229
|
+
last_recv = time.monotonic()
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def get_chunk(port, path, offset, length, retries=6):
|
|
233
|
+
"""Pull [offset, offset+length) of `path` and verify its CRC. Retries the chunk on
|
|
234
|
+
any corruption (bad base64, dropped line, CRC mismatch). Returns the bytes."""
|
|
235
|
+
begin_pfx = b"GEADEV:GET BEGIN"
|
|
236
|
+
end_pfx = b"GEADEV:GET END"
|
|
237
|
+
for attempt in range(retries):
|
|
238
|
+
drain(port, quiet_for=0.2, max_wait=1.5)
|
|
239
|
+
port.write_line(f"GEADEV GET {path} {offset} {length}")
|
|
240
|
+
raw = read_until(port, end_pfx, overall_timeout=120.0)
|
|
241
|
+
begin = None
|
|
242
|
+
chunks = []
|
|
243
|
+
for line in raw.split(b"\n"):
|
|
244
|
+
line = line.rstrip(b"\r")
|
|
245
|
+
if begin is None:
|
|
246
|
+
if line.startswith(begin_pfx):
|
|
247
|
+
begin = parse_kv(line.decode("ascii", "replace"))
|
|
248
|
+
continue
|
|
249
|
+
if line.startswith(end_pfx):
|
|
250
|
+
break
|
|
251
|
+
if line.startswith(b"GEADEV:DATA "):
|
|
252
|
+
chunks.append(line[len(b"GEADEV:DATA "):].strip())
|
|
253
|
+
if begin is None:
|
|
254
|
+
continue # never saw BEGIN — retry
|
|
255
|
+
try:
|
|
256
|
+
data = base64.b64decode(b"".join(chunks), validate=True)
|
|
257
|
+
except binascii.Error:
|
|
258
|
+
continue # a line was garbled — retry the chunk
|
|
259
|
+
want_len = int(begin.get("len", -1))
|
|
260
|
+
want_crc = int(begin.get("crc", "x"), 16) if begin.get("crc") else None
|
|
261
|
+
if want_len >= 0 and len(data) != want_len:
|
|
262
|
+
continue
|
|
263
|
+
if want_crc is not None and device_crc32(data) != want_crc:
|
|
264
|
+
continue
|
|
265
|
+
return data
|
|
266
|
+
raise RuntimeError(f"chunk @{offset} ({length}B) of {path} failed CRC after {retries} tries")
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def pull_file(port, remote_path, local_path, size):
|
|
270
|
+
t0 = time.monotonic()
|
|
271
|
+
with open(local_path, "wb") as out:
|
|
272
|
+
offset = 0
|
|
273
|
+
while offset < size:
|
|
274
|
+
want = min(CHUNK, size - offset)
|
|
275
|
+
data = get_chunk(port, remote_path, offset, want)
|
|
276
|
+
if not data:
|
|
277
|
+
break
|
|
278
|
+
out.write(data)
|
|
279
|
+
offset += len(data)
|
|
280
|
+
pct = 100 * offset / size if size else 100
|
|
281
|
+
print(f"\r pulling {os.path.basename(local_path)}: {offset}/{size} ({pct:.0f}%)",
|
|
282
|
+
end="", file=sys.stderr)
|
|
283
|
+
dt = time.monotonic() - t0
|
|
284
|
+
rate = (offset / 1024.0) / dt if dt > 0 else 0
|
|
285
|
+
print(f"\r pulled {os.path.basename(local_path)}: {offset} bytes in {dt:.1f}s ({rate:.0f} KB/s) ",
|
|
286
|
+
file=sys.stderr)
|
|
287
|
+
return offset
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def capture_still(port, ts):
|
|
291
|
+
print("→ CAMSTILL (full-resolution JPEG to SD) ...")
|
|
292
|
+
kv = command_retry(port, "GEADEV CAMSTILL", "GEADEV:CAMSTILL OK", timeout=40.0)
|
|
293
|
+
path, size = kv["path"], int(kv["bytes"])
|
|
294
|
+
out = os.path.join(CAPTURES, f"frame_{ts}.jpg")
|
|
295
|
+
got = pull_file(port, path, out, size)
|
|
296
|
+
print(f" saved {out} {kv.get('width','?')}x{kv.get('height','?')} {got} bytes")
|
|
297
|
+
return out
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def capture_clip(port, ts, seconds):
|
|
301
|
+
print(f"→ CAMCLIP {seconds:g}s (1080p hardware H.264 to SD) ...")
|
|
302
|
+
kv = command_retry(port, f"GEADEV CAMCLIP {seconds:g}", "GEADEV:CAMCLIP OK",
|
|
303
|
+
timeout=seconds + 60.0)
|
|
304
|
+
path, size = kv["path"], int(kv["bytes"])
|
|
305
|
+
fps, frames = kv.get("fps", "?"), kv.get("frames", "?")
|
|
306
|
+
raw = os.path.join(CAPTURES, f"clip_{ts}.h264")
|
|
307
|
+
got = pull_file(port, path, raw, size)
|
|
308
|
+
print(f" saved {raw} {kv.get('width','?')}x{kv.get('height','?')} {frames} frames @ {fps}fps {got} bytes")
|
|
309
|
+
|
|
310
|
+
mp4 = os.path.join(CAPTURES, f"clip_{ts}.mp4")
|
|
311
|
+
ffmpeg = shutil.which("ffmpeg")
|
|
312
|
+
if not ffmpeg:
|
|
313
|
+
print(" ffmpeg not found on PATH — leaving the raw .h264 (plays in VLC).")
|
|
314
|
+
return raw
|
|
315
|
+
rate = "30"
|
|
316
|
+
try:
|
|
317
|
+
if float(fps) > 1.0:
|
|
318
|
+
rate = f"{float(fps):.3f}"
|
|
319
|
+
except (TypeError, ValueError):
|
|
320
|
+
pass
|
|
321
|
+
try:
|
|
322
|
+
subprocess.run([ffmpeg, "-y", "-r", rate, "-i", raw, "-c", "copy", mp4],
|
|
323
|
+
check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
324
|
+
print(f" remuxed → {mp4} ({rate} fps)")
|
|
325
|
+
return mp4
|
|
326
|
+
except subprocess.CalledProcessError as e:
|
|
327
|
+
print(f" ffmpeg remux failed ({e}); the raw .h264 is still valid.")
|
|
328
|
+
return raw
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def main():
|
|
332
|
+
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
333
|
+
parser.add_argument("--port", default=None, help="serial console of the P4 (default: the only attached USB serial device)")
|
|
334
|
+
parser.add_argument("--baud", type=int, default=921600, help="device console baud (default 921600)")
|
|
335
|
+
parser.add_argument("--seconds", type=float, default=10.0, help="clip length (default 10)")
|
|
336
|
+
parser.add_argument("--still-only", action="store_true")
|
|
337
|
+
parser.add_argument("--clip-only", action="store_true")
|
|
338
|
+
parser.add_argument("--trace", action="store_true", help="echo GEADEV lines while waiting")
|
|
339
|
+
args = parser.parse_args()
|
|
340
|
+
|
|
341
|
+
os.makedirs(CAPTURES, exist_ok=True)
|
|
342
|
+
port = SerialPort(args.port or board_port(), args.baud, trace=args.trace)
|
|
343
|
+
ts = time.strftime("%Y%m%d-%H%M%S")
|
|
344
|
+
|
|
345
|
+
def robust_ping():
|
|
346
|
+
for _ in range(8):
|
|
347
|
+
drain(port)
|
|
348
|
+
port.write_line("GEADEV PING")
|
|
349
|
+
deadline = time.monotonic() + 4.0
|
|
350
|
+
while time.monotonic() < deadline:
|
|
351
|
+
line = port.read_line(deadline - time.monotonic())
|
|
352
|
+
if line is None:
|
|
353
|
+
break
|
|
354
|
+
if line.startswith("GEADEV:PONG"):
|
|
355
|
+
return line
|
|
356
|
+
raise RuntimeError("device did not answer PING")
|
|
357
|
+
|
|
358
|
+
try:
|
|
359
|
+
print(f"connected: {robust_ping()} (port {port.path})")
|
|
360
|
+
if not args.clip_only:
|
|
361
|
+
capture_still(port, ts)
|
|
362
|
+
if not args.still_only:
|
|
363
|
+
capture_clip(port, ts, args.seconds)
|
|
364
|
+
finally:
|
|
365
|
+
port.close()
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
if __name__ == "__main__":
|
|
369
|
+
main()
|
|
@@ -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)
|