@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.
Files changed (348) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +83 -0
  3. package/package.json +50 -0
  4. package/targets/cmake/geatsc-generated-archive-build.mjs +614 -0
  5. package/targets/cmake/geatsc_generated_archive.cmake +116 -0
  6. package/targets/cmake/geatsc_generated_archive_build.cmake +50 -0
  7. package/targets/esp32/app_project.cmake +33 -0
  8. package/targets/esp32/apps/app_manager.cpp +188 -0
  9. package/targets/esp32/apps/app_manager.h +10 -0
  10. package/targets/esp32/chip_bindings/README.md +58 -0
  11. package/targets/esp32/chip_bindings/audio/es8311.cpp +556 -0
  12. package/targets/esp32/chip_bindings/displays/co5300.cpp +510 -0
  13. package/targets/esp32/chip_bindings/displays/co5300.h +47 -0
  14. package/targets/esp32/chip_bindings/displays/co5300_async_stream.inc +79 -0
  15. package/targets/esp32/chip_bindings/displays/qspi_panel.h +65 -0
  16. package/targets/esp32/chip_bindings/displays/sh8601.cpp +583 -0
  17. package/targets/esp32/chip_bindings/displays/sh8601.h +36 -0
  18. package/targets/esp32/chip_bindings/gps/lc76g.cpp +296 -0
  19. package/targets/esp32/chip_bindings/gps/lc76g.h +7 -0
  20. package/targets/esp32/chip_bindings/imu/bmi270.cpp +299 -0
  21. package/targets/esp32/chip_bindings/imu/bmi270_config.inl +439 -0
  22. package/targets/esp32/chip_bindings/imu/qmi8658.cpp +213 -0
  23. package/targets/esp32/chip_bindings/power/axp2101.cpp +185 -0
  24. package/targets/esp32/chip_bindings/touch/cst9217.cpp +229 -0
  25. package/targets/esp32/chip_bindings/touch/cst9217_controller.h +78 -0
  26. package/targets/esp32/chip_bindings/touch/ft3168.cpp +340 -0
  27. package/targets/esp32/chip_bindings/touch/ft3168_controller.h +103 -0
  28. package/targets/esp32/chip_bindings/touch/ft6336.cpp +310 -0
  29. package/targets/esp32/chip_bindings/touch/ft6336_controller.h +90 -0
  30. package/targets/esp32/components/gea_framework/CMakeLists.txt +62 -0
  31. package/targets/esp32/connectivity/ble_hid.cpp +2916 -0
  32. package/targets/esp32/connectivity/ble_hid.h +8 -0
  33. package/targets/esp32/connectivity/diagnostics_transport.cpp +523 -0
  34. package/targets/esp32/connectivity/diagnostics_transport_offline.cpp +108 -0
  35. package/targets/esp32/connectivity/wifi.cpp +615 -0
  36. package/targets/esp32/connectivity/wifi_debug_offline.cpp +37 -0
  37. package/targets/esp32/connectivity/wifi_task_stack.h +119 -0
  38. package/targets/esp32/display.cpp +6010 -0
  39. package/targets/esp32/display_headless.cpp +468 -0
  40. package/targets/esp32/gea/platform_random.h +11 -0
  41. package/targets/esp32/gea_framework.cmake +382 -0
  42. package/targets/esp32/gpio.cpp +229 -0
  43. package/targets/esp32/host_sources.cmake +35 -0
  44. package/targets/esp32/imu_absent.cpp +36 -0
  45. package/targets/esp32/ldfragments/gea_ui_state_external.lf +35 -0
  46. package/targets/esp32/memory_config.h +64 -0
  47. package/targets/esp32/power_absent.cpp +22 -0
  48. package/targets/esp32/sdk-patches/0001-esp_ptr_dma_capable-accept-PSRAM.patch +70 -0
  49. package/targets/esp32/sdk-patches/0002-gdma-access_ext_mem-spi_master.patch +59 -0
  50. package/targets/esp32/sdk-patches/README.md +127 -0
  51. package/targets/esp32/services/app_runner.cpp +248 -0
  52. package/targets/esp32/services/app_state.cpp +56 -0
  53. package/targets/esp32/services/audio_runtime_stub.cpp +86 -0
  54. package/targets/esp32/services/battery_service.cpp +31 -0
  55. package/targets/esp32/services/device_control.cpp +1896 -0
  56. package/targets/esp32/services/device_control.h +31 -0
  57. package/targets/esp32/services/frame_scheduler.cpp +1571 -0
  58. package/targets/esp32/services/heap.cpp +129 -0
  59. package/targets/esp32/services/memory.cpp +103 -0
  60. package/targets/esp32/services/ota.cpp +840 -0
  61. package/targets/esp32/services/ota_image.cpp +162 -0
  62. package/targets/esp32/services/ota_image.h +16 -0
  63. package/targets/esp32/services/storage_service.cpp +159 -0
  64. package/targets/esp32/touch_absent.cpp +44 -0
  65. package/targets/esp32-m5stack-m5paper/CMakeLists.txt +10 -0
  66. package/targets/esp32-m5stack-m5paper/README.md +55 -0
  67. package/targets/esp32-m5stack-m5paper/dependencies.lock +76 -0
  68. package/targets/esp32-m5stack-m5paper/main/CMakeLists.txt +46 -0
  69. package/targets/esp32-m5stack-m5paper/main/Kconfig.projbuild +10 -0
  70. package/targets/esp32-m5stack-m5paper/main/app_main.cpp +114 -0
  71. package/targets/esp32-m5stack-m5paper/main/audio_stub.cpp +27 -0
  72. package/targets/esp32-m5stack-m5paper/main/buttons.cpp +111 -0
  73. package/targets/esp32-m5stack-m5paper/main/display.cpp +1074 -0
  74. package/targets/esp32-m5stack-m5paper/main/i2c.cpp +36 -0
  75. package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -0
  76. package/targets/esp32-m5stack-m5paper/main/imu_stub.cpp +20 -0
  77. package/targets/esp32-m5stack-m5paper/main/include/board.h +100 -0
  78. package/targets/esp32-m5stack-m5paper/main/include/buttons.h +8 -0
  79. package/targets/esp32-m5stack-m5paper/main/launcher_button.cpp +82 -0
  80. package/targets/esp32-m5stack-m5paper/main/m5paper_psram.lf +20 -0
  81. package/targets/esp32-m5stack-m5paper/main/power.cpp +73 -0
  82. package/targets/esp32-m5stack-m5paper/main/sdcard_mount.cpp +82 -0
  83. package/targets/esp32-m5stack-m5paper/main/touch.cpp +279 -0
  84. package/targets/esp32-m5stack-m5paper/partitions.csv +9 -0
  85. package/targets/esp32-m5stack-m5paper/sdkconfig.defaults +84 -0
  86. package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +10 -0
  87. package/targets/esp32-p4-m5stack-tab5/dependencies.lock +276 -0
  88. package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +586 -0
  89. package/targets/esp32-p4-m5stack-tab5/main/Kconfig.projbuild +12 -0
  90. package/targets/esp32-p4-m5stack-tab5/main/app_main.cpp +177 -0
  91. package/targets/esp32-p4-m5stack-tab5/main/camera.cpp +2025 -0
  92. package/targets/esp32-p4-m5stack-tab5/main/display.cpp +4033 -0
  93. package/targets/esp32-p4-m5stack-tab5/main/fatfs_ffconf.h +383 -0
  94. package/targets/esp32-p4-m5stack-tab5/main/i2c.cpp +39 -0
  95. package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +21 -0
  96. package/targets/esp32-p4-m5stack-tab5/main/include/board.h +130 -0
  97. package/targets/esp32-p4-m5stack-tab5/main/include/tab5_drivers.h +68 -0
  98. package/targets/esp32-p4-m5stack-tab5/main/include/wifi_config.h.example +5 -0
  99. package/targets/esp32-p4-m5stack-tab5/main/launcher_button.cpp +188 -0
  100. package/targets/esp32-p4-m5stack-tab5/main/power.cpp +22 -0
  101. package/targets/esp32-p4-m5stack-tab5/main/sdcard_mount.cpp +125 -0
  102. package/targets/esp32-p4-m5stack-tab5/main/tab5_audio.cpp +345 -0
  103. package/targets/esp32-p4-m5stack-tab5/main/tab5_drivers.cpp +871 -0
  104. package/targets/esp32-p4-m5stack-tab5/main/tab5_imu.cpp +246 -0
  105. package/targets/esp32-p4-m5stack-tab5/main/touch.cpp +206 -0
  106. package/targets/esp32-p4-m5stack-tab5/partitions.csv +12 -0
  107. package/targets/esp32-p4-m5stack-tab5/sdkconfig.defaults +128 -0
  108. package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +19 -0
  109. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/0001-esp_video-csi-raw-passthrough-p4-rev-lt-v3.patch +28 -0
  110. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/README.md +45 -0
  111. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/apply.sh +37 -0
  112. package/targets/esp32-p4-waveshare-touch-lcd-3.5/dependencies.lock +196 -0
  113. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +562 -0
  114. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/Kconfig.projbuild +12 -0
  115. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/app_main.cpp +166 -0
  116. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/camera.cpp +2105 -0
  117. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +1730 -0
  118. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/fatfs_ffconf.h +383 -0
  119. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/i2c.cpp +39 -0
  120. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +11 -0
  121. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/board.h +87 -0
  122. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/panel_native.h +59 -0
  123. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/wifi_config.h.example +5 -0
  124. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/launcher_button.cpp +191 -0
  125. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/power.cpp +15 -0
  126. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/touch.cpp +306 -0
  127. package/targets/esp32-p4-waveshare-touch-lcd-3.5/partitions.csv +13 -0
  128. package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/README.md +22 -0
  129. package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/espressif__esp_video-csi-bypass.patch +28 -0
  130. package/targets/esp32-p4-waveshare-touch-lcd-3.5/sdkconfig.defaults +109 -0
  131. package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/README-camera-capture.md +84 -0
  132. package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/capture-camera.py +369 -0
  133. package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +10 -0
  134. package/targets/esp32-p4-waveshare-touch-lcd-7/dependencies.lock +258 -0
  135. package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +577 -0
  136. package/targets/esp32-p4-waveshare-touch-lcd-7/main/Kconfig.projbuild +12 -0
  137. package/targets/esp32-p4-waveshare-touch-lcd-7/main/app_main.cpp +177 -0
  138. package/targets/esp32-p4-waveshare-touch-lcd-7/main/camera.cpp +1935 -0
  139. package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +2832 -0
  140. package/targets/esp32-p4-waveshare-touch-lcd-7/main/fatfs_ffconf.h +383 -0
  141. package/targets/esp32-p4-waveshare-touch-lcd-7/main/i2c.cpp +39 -0
  142. package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +23 -0
  143. package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/board.h +68 -0
  144. package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/wifi_config.h.example +5 -0
  145. package/targets/esp32-p4-waveshare-touch-lcd-7/main/launcher_button.cpp +191 -0
  146. package/targets/esp32-p4-waveshare-touch-lcd-7/main/power.cpp +15 -0
  147. package/targets/esp32-p4-waveshare-touch-lcd-7/main/sdcard_mount.cpp +125 -0
  148. package/targets/esp32-p4-waveshare-touch-lcd-7/main/touch.cpp +332 -0
  149. package/targets/esp32-p4-waveshare-touch-lcd-7/partitions.csv +12 -0
  150. package/targets/esp32-p4-waveshare-touch-lcd-7/sdkconfig.defaults +122 -0
  151. package/targets/esp32-p4-waveshare-touch-lcd-7/tools/README-camera-capture.md +84 -0
  152. package/targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py +369 -0
  153. package/targets/esp32-s3-devkit-n16r8.json +31 -0
  154. package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +10 -0
  155. package/targets/esp32-s3-elecrow-rotary-2.1/dependencies.lock +40 -0
  156. package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +549 -0
  157. package/targets/esp32-s3-elecrow-rotary-2.1/main/Kconfig.projbuild +12 -0
  158. package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +187 -0
  159. package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +1338 -0
  160. package/targets/esp32-s3-elecrow-rotary-2.1/main/i2c.cpp +39 -0
  161. package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -0
  162. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/board.h +142 -0
  163. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/pcf8574.h +16 -0
  164. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/rotary_encoder.h +7 -0
  165. package/targets/esp32-s3-elecrow-rotary-2.1/main/launcher_button.cpp +191 -0
  166. package/targets/esp32-s3-elecrow-rotary-2.1/main/pcf8574.cpp +86 -0
  167. package/targets/esp32-s3-elecrow-rotary-2.1/main/platform_stubs.cpp +47 -0
  168. package/targets/esp32-s3-elecrow-rotary-2.1/main/rotary_encoder.cpp +135 -0
  169. package/targets/esp32-s3-elecrow-rotary-2.1/main/touch.cpp +250 -0
  170. package/targets/esp32-s3-elecrow-rotary-2.1/partitions.csv +8 -0
  171. package/targets/esp32-s3-elecrow-rotary-2.1/sdkconfig.defaults +116 -0
  172. package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +10 -0
  173. package/targets/esp32-s3-epaper-1.54/dependencies.lock +76 -0
  174. package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +691 -0
  175. package/targets/esp32-s3-epaper-1.54/main/Kconfig.projbuild +12 -0
  176. package/targets/esp32-s3-epaper-1.54/main/app_main.cpp +181 -0
  177. package/targets/esp32-s3-epaper-1.54/main/buttons.cpp +144 -0
  178. package/targets/esp32-s3-epaper-1.54/main/display.cpp +1281 -0
  179. package/targets/esp32-s3-epaper-1.54/main/fatfs_ffconf.h +377 -0
  180. package/targets/esp32-s3-epaper-1.54/main/i2c.cpp +39 -0
  181. package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -0
  182. package/targets/esp32-s3-epaper-1.54/main/imu_stub.cpp +21 -0
  183. package/targets/esp32-s3-epaper-1.54/main/include/board.h +119 -0
  184. package/targets/esp32-s3-epaper-1.54/main/include/buttons.h +9 -0
  185. package/targets/esp32-s3-epaper-1.54/main/include/wifi_config.h.example +5 -0
  186. package/targets/esp32-s3-epaper-1.54/main/launcher_button.cpp +191 -0
  187. package/targets/esp32-s3-epaper-1.54/main/power.cpp +15 -0
  188. package/targets/esp32-s3-epaper-1.54/main/sdcard_mount.cpp +89 -0
  189. package/targets/esp32-s3-epaper-1.54/main/touch.cpp +299 -0
  190. package/targets/esp32-s3-epaper-1.54/partitions.csv +8 -0
  191. package/targets/esp32-s3-epaper-1.54/sdkconfig.defaults +217 -0
  192. package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +10 -0
  193. package/targets/esp32-s3-lilygo-t-display-s3-long/README.md +29 -0
  194. package/targets/esp32-s3-lilygo-t-display-s3-long/dependencies.lock +116 -0
  195. package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +90 -0
  196. package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -0
  197. package/targets/esp32-s3-lilygo-t-display-s3-long/main/include/board.h +61 -0
  198. package/targets/esp32-s3-lilygo-t-display-s3-long/main/touch.cpp +299 -0
  199. package/targets/esp32-s3-lilygo-t-display-s3-long/partitions.csv +7 -0
  200. package/targets/esp32-s3-lilygo-t-display-s3-long/sdkconfig.defaults +50 -0
  201. package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +12 -0
  202. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/CMakeLists.txt +17 -0
  203. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.c +269 -0
  204. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.h +142 -0
  205. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.c +1114 -0
  206. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.h +410 -0
  207. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/gea_epd.c +989 -0
  208. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.c +489 -0
  209. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.h +104 -0
  210. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.c +136 -0
  211. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.h +78 -0
  212. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/utilities.h +49 -0
  213. package/targets/esp32-s3-lilygo-t5-epaper-4.7/dependencies.lock +35 -0
  214. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/CMakeLists.txt +30 -0
  215. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/Kconfig.projbuild +10 -0
  216. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/app_main.cpp +95 -0
  217. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/audio_stub.cpp +27 -0
  218. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/buttons.cpp +40 -0
  219. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/display.cpp +627 -0
  220. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/i2c.cpp +36 -0
  221. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -0
  222. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/imu_stub.cpp +20 -0
  223. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/board.h +85 -0
  224. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/buttons.h +8 -0
  225. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/launcher_button.cpp +82 -0
  226. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/power.cpp +36 -0
  227. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/sdcard_mount.cpp +90 -0
  228. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/touch.cpp +293 -0
  229. package/targets/esp32-s3-lilygo-t5-epaper-4.7/partitions.csv +9 -0
  230. package/targets/esp32-s3-lilygo-t5-epaper-4.7/sdkconfig.defaults +217 -0
  231. package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +13 -0
  232. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/CMakeLists.txt +5 -0
  233. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/include/papers3_epd.h +74 -0
  234. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/papers3_epd.c +671 -0
  235. package/targets/esp32-s3-m5stack-papers3/dependencies.lock +76 -0
  236. package/targets/esp32-s3-m5stack-papers3/main/CMakeLists.txt +64 -0
  237. package/targets/esp32-s3-m5stack-papers3/main/Kconfig.projbuild +10 -0
  238. package/targets/esp32-s3-m5stack-papers3/main/app_main.cpp +96 -0
  239. package/targets/esp32-s3-m5stack-papers3/main/audio_stub.cpp +27 -0
  240. package/targets/esp32-s3-m5stack-papers3/main/buttons.cpp +49 -0
  241. package/targets/esp32-s3-m5stack-papers3/main/display.cpp +706 -0
  242. package/targets/esp32-s3-m5stack-papers3/main/i2c.cpp +36 -0
  243. package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +14 -0
  244. package/targets/esp32-s3-m5stack-papers3/main/imu.cpp +351 -0
  245. package/targets/esp32-s3-m5stack-papers3/main/include/board.h +101 -0
  246. package/targets/esp32-s3-m5stack-papers3/main/include/buttons.h +8 -0
  247. package/targets/esp32-s3-m5stack-papers3/main/launcher_button.cpp +96 -0
  248. package/targets/esp32-s3-m5stack-papers3/main/power.cpp +102 -0
  249. package/targets/esp32-s3-m5stack-papers3/main/sdcard_mount.cpp +88 -0
  250. package/targets/esp32-s3-m5stack-papers3/main/touch.cpp +287 -0
  251. package/targets/esp32-s3-m5stack-papers3/partitions.csv +9 -0
  252. package/targets/esp32-s3-m5stack-papers3/sdkconfig.defaults +232 -0
  253. package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +10 -0
  254. package/targets/esp32-s3-m5stack-sticks3/dependencies.lock +51 -0
  255. package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +51 -0
  256. package/targets/esp32-s3-m5stack-sticks3/main/Kconfig.projbuild +12 -0
  257. package/targets/esp32-s3-m5stack-sticks3/main/app_main.cpp +130 -0
  258. package/targets/esp32-s3-m5stack-sticks3/main/buttons.cpp +101 -0
  259. package/targets/esp32-s3-m5stack-sticks3/main/display.cpp +1391 -0
  260. package/targets/esp32-s3-m5stack-sticks3/main/i2c.cpp +39 -0
  261. package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +8 -0
  262. package/targets/esp32-s3-m5stack-sticks3/main/imu_stub.cpp +9 -0
  263. package/targets/esp32-s3-m5stack-sticks3/main/include/board.h +89 -0
  264. package/targets/esp32-s3-m5stack-sticks3/main/include/buttons.h +9 -0
  265. package/targets/esp32-s3-m5stack-sticks3/main/launcher_button.cpp +191 -0
  266. package/targets/esp32-s3-m5stack-sticks3/main/power.cpp +15 -0
  267. package/targets/esp32-s3-m5stack-sticks3/main/sdcard_mount.cpp +8 -0
  268. package/targets/esp32-s3-m5stack-sticks3/main/touch.cpp +65 -0
  269. package/targets/esp32-s3-m5stack-sticks3/partitions.csv +8 -0
  270. package/targets/esp32-s3-m5stack-sticks3/sdkconfig.defaults +130 -0
  271. package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +10 -0
  272. package/targets/esp32-s3-touch-amoled-1.75/dependencies.lock +130 -0
  273. package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +589 -0
  274. package/targets/esp32-s3-touch-amoled-1.75/main/Kconfig.projbuild +12 -0
  275. package/targets/esp32-s3-touch-amoled-1.75/main/app_main.cpp +153 -0
  276. package/targets/esp32-s3-touch-amoled-1.75/main/i2c.cpp +39 -0
  277. package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +9 -0
  278. package/targets/esp32-s3-touch-amoled-1.75/main/include/board.h +110 -0
  279. package/targets/esp32-s3-touch-amoled-1.75/main/include/wifi_config.h.example +5 -0
  280. package/targets/esp32-s3-touch-amoled-1.75/main/launcher_button.cpp +191 -0
  281. package/targets/esp32-s3-touch-amoled-1.75/main/touch.cpp +45 -0
  282. package/targets/esp32-s3-touch-amoled-1.75/partitions.csv +8 -0
  283. package/targets/esp32-s3-touch-amoled-1.75/sdkconfig.defaults +179 -0
  284. package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +10 -0
  285. package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +105 -0
  286. package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +768 -0
  287. package/targets/esp32-s3-touch-amoled-1.8/main/Kconfig.projbuild +12 -0
  288. package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +172 -0
  289. package/targets/esp32-s3-touch-amoled-1.8/main/i2c.cpp +39 -0
  290. package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +8 -0
  291. package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +83 -0
  292. package/targets/esp32-s3-touch-amoled-1.8/main/include/wifi_config.h.example +5 -0
  293. package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +191 -0
  294. package/targets/esp32-s3-touch-amoled-1.8/main/touch.cpp +41 -0
  295. package/targets/esp32-s3-touch-amoled-1.8/partitions.csv +8 -0
  296. package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +179 -0
  297. package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +10 -0
  298. package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +64 -0
  299. package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +1121 -0
  300. package/targets/esp32-s3-touch-amoled-2.06/main/Kconfig.projbuild +12 -0
  301. package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +333 -0
  302. package/targets/esp32-s3-touch-amoled-2.06/main/i2c.cpp +39 -0
  303. package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +27 -0
  304. package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +114 -0
  305. package/targets/esp32-s3-touch-amoled-2.06/main/include/wifi_config.h.example +5 -0
  306. package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +199 -0
  307. package/targets/esp32-s3-touch-amoled-2.06/main/sdcard_mount.cpp +105 -0
  308. package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +49 -0
  309. package/targets/esp32-s3-touch-amoled-2.06/partitions.csv +14 -0
  310. package/targets/esp32-s3-touch-amoled-2.06/sdkconfig.defaults +273 -0
  311. package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +10 -0
  312. package/targets/esp32-s3-touch-amoled-2.41/main/CMakeLists.txt +71 -0
  313. package/targets/esp32-s3-touch-amoled-2.41/main/Kconfig.projbuild +12 -0
  314. package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +27 -0
  315. package/targets/esp32-s3-touch-amoled-2.41/main/include/board.h +108 -0
  316. package/targets/esp32-s3-touch-amoled-2.41/main/include/wifi_config.h.example +5 -0
  317. package/targets/esp32-s3-touch-amoled-2.41/main/panel_reset.cpp +82 -0
  318. package/targets/esp32-s3-touch-amoled-2.41/main/touch.cpp +49 -0
  319. package/targets/esp32-s3-touch-amoled-2.41/partitions.csv +8 -0
  320. package/targets/esp32-s3-touch-amoled-2.41/sdkconfig.defaults +273 -0
  321. package/targets/rp2350-tufty-2350/CMakeLists.txt +348 -0
  322. package/targets/rp2350-tufty-2350/README.md +53 -0
  323. package/targets/rp2350-tufty-2350/boards/pimoroni_tufty2350.h +87 -0
  324. package/targets/rp2350-tufty-2350/main/bringup.cpp +187 -0
  325. package/targets/rp2350-tufty-2350/main/include/board.h +124 -0
  326. package/targets/rp2350-tufty-2350/main/rp2350_panel.cpp +428 -0
  327. package/targets/rp2350-tufty-2350/main/rp2350_panel.h +46 -0
  328. package/targets/rp2350-tufty-2350/main/st7789_parallel.pio +7 -0
  329. package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +345 -0
  330. package/targets/rp2350-waveshare-touch-amoled-2.41/README.md +153 -0
  331. package/targets/rp2350-waveshare-touch-amoled-2.41/boards/waveshare_rp2350_touch_amoled_2_41.h +59 -0
  332. package/targets/rp2350-waveshare-touch-amoled-2.41/main/app.cpp +984 -0
  333. package/targets/rp2350-waveshare-touch-amoled-2.41/main/bringup.cpp +222 -0
  334. package/targets/rp2350-waveshare-touch-amoled-2.41/main/include/board.h +138 -0
  335. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +2553 -0
  336. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.h +18 -0
  337. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_host_fetch_stub.cpp +64 -0
  338. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.cpp +677 -0
  339. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.h +48 -0
  340. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.c +354 -0
  341. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.h +56 -0
  342. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.c +1284 -0
  343. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.h +95 -0
  344. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_block_functions.h +123 -0
  345. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_common.h +127 -0
  346. package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-bench.py +162 -0
  347. package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-parity.py +198 -0
  348. package/targets.json +154 -0
@@ -0,0 +1,122 @@
1
+ # Target: ESP32-P4
2
+ CONFIG_IDF_TARGET="esp32p4"
3
+ CONFIG_IDF_TARGET_ESP32P4=y
4
+
5
+ # Flash: 32 MB (Waveshare ESP32-P4-WIFI6-Touch-LCD-7)
6
+ CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y
7
+ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
8
+
9
+ # The first Waveshare ESP32-P4-WIFI6-Touch-LCD-7 unit reports ESP32-P4 rev
10
+ # v1.3. ESP-IDF defaults to rev v3.1+, whose bootloader rejects this board.
11
+ CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
12
+ CONFIG_ESP32P4_REV_MIN_100=y
13
+ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_360=y
14
+
15
+ # Keep the console on UART0 (USB-JTAG stays secondary); the ESP32-P4 USB Serial/JTAG
16
+ # bootloader console init path hangs on the Waveshare rev v1.3 board during early
17
+ # bring-up, so UART must remain primary. Use CUSTOM (default pins via GPIO=-1) so the
18
+ # baud is settable: stdout is mirrored to UART0 + USB-JTAG and the write blocks on the
19
+ # slower UART, so the camera-capture base64 stream (multi-MB) is gated by this baud.
20
+ # 921600 makes it ~8x faster; the host reads the baud-agnostic USB-JTAG side.
21
+ CONFIG_ESP_CONSOLE_UART_CUSTOM=y
22
+ CONFIG_ESP_CONSOLE_UART_TX_GPIO=-1
23
+ CONFIG_ESP_CONSOLE_UART_RX_GPIO=-1
24
+ CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y
25
+ CONFIG_ESP_CONSOLE_UART_BAUDRATE=921600
26
+
27
+ # Custom partition table with two OTA slots and installable app storage.
28
+ CONFIG_PARTITION_TABLE_CUSTOM=y
29
+ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
30
+
31
+ # Runtime timing and task budgets. The P4 creates its two IPC tasks before the
32
+ # IDF main task; keeping IPC at the older S3 16 KiB value fragments internal
33
+ # SRAM enough that the 32 KiB main stack cannot be allocated at startup.
34
+ CONFIG_FREERTOS_HZ=1000
35
+ CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768
36
+ CONFIG_ESP_IPC_TASK_STACK_SIZE=4096
37
+
38
+ # External PSRAM is required for the 720x1280 RGB565 framebuffer and staging
39
+ # buffers. Keep internal memory globally allocatable; code asks for DMA/internal
40
+ # caps explicitly when needed.
41
+ CONFIG_SPIRAM=y
42
+ CONFIG_SPIRAM_SPEED_200M=y
43
+ CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
44
+ CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
45
+ CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
46
+
47
+ # WiFi runs on the onboard ESP32-C6 over esp_hosted SDIO. Allocate the SDIO
48
+ # transport mempool from DMA-capable PSRAM (the P4 GDMA reaches PSRAM through
49
+ # cache) instead of scarce internal DMA RAM, which the 720x1280 framebuffers
50
+ # already pressure. Without this, sdio_mempool_create asserts (buf_mp_g null) and
51
+ # the board boot-loops the moment WiFi is enabled.
52
+ CONFIG_ESP_HOSTED_MEMPOOL_PREFER_SPIRAM=y
53
+ # Also place esp_hosted's own task stacks (RPC + default worker) in SPIRAM. The
54
+ # WiFi blob lives on the C6, so the P4 host tasks don't need internal RAM; this
55
+ # keeps boot-time internal-SRAM free so the 32 KiB main-task stack still fits
56
+ # (otherwise esp_startup_start_app asserts res==pdTRUE and boot-loops).
57
+ CONFIG_ESP_HOSTED_DFLT_TASK_FROM_SPIRAM=y
58
+
59
+ # Camera: Waveshare's ESP32-P4-WIFI6-Touch-LCD-X examples use the onboard
60
+ # OV5647 over MIPI-CSI through the esp_video ISP pipeline.
61
+ CONFIG_IDF_EXPERIMENTAL_FEATURES=y
62
+ CONFIG_CAMERA_OV5647=y
63
+ # Preview-optimised capture: the OV5647 2x2-binning mode, 1280x960 RAW10 45fps
64
+ # (index 4). Binning halves the sensor readout + ISP/PPA scale data vs 1920x1080
65
+ # 30fps and lowers noise, so the live preview streams faster and brighter. The
66
+ # sensor mode is global, so stills and the H.264 clip also capture at 1280x960
67
+ # (still within the P4 hardware encoder's 1920x1080 max). Switch back to index 3
68
+ # (1920x1080 30fps) below if full-1080p stills/recording matter more than preview.
69
+ CONFIG_CAMERA_OV5647_MIPI_RAW10_1280x960_BINNING_45FPS=y
70
+ CONFIG_CAMERA_OV5647_MIPI_IF_FORMAT_INDEX_DAFAULT=4
71
+ CONFIG_ESP_VIDEO_ENABLE_ISP_PIPELINE_CONTROLLER=y
72
+ # Hardware H.264 encoder exposed as a V4L2 M2M device (/dev/video11) for the
73
+ # full-resolution 1080p video recording path (Camera.recordH264Clip).
74
+ CONFIG_ESP_VIDEO_ENABLE_H264_VIDEO_DEVICE=y
75
+ CONFIG_ESP_VIDEO_ENABLE_HW_H264_VIDEO_DEVICE=y
76
+ # esp_video registers several /dev/video* VFS entries; with the console + the
77
+ # /sdcard FAT mount the default cap of 8 is exhausted (mount fails with NO_MEM).
78
+ CONFIG_VFS_MAX_COUNT=16
79
+ # microSD cards use 512-byte logical sectors; IDF's FATFS defaults to 4096 (for the
80
+ # on-flash wear-levelled FAT), which fails to mount an SD card (FR_NO_FILESYSTEM).
81
+ CONFIG_FATFS_SECTOR_512=y
82
+ # exFAT support is enabled in ffconf.h (FF_FS_EXFAT=1) so the board can read exFAT
83
+ # microSD cards; the exFAT code path references FF_USE_LABEL as a C value, so the
84
+ # volume-label option must be defined (it's "not set" => undefined => won't compile).
85
+ CONFIG_FATFS_USE_LABEL=y
86
+ # CONFIG_ESP_H264_DECODER_IRAM is not set
87
+
88
+ # WebRTC: mbedTLS DTLS + DTLS-SRTP for esp_peer.
89
+ CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
90
+ CONFIG_MBEDTLS_SSL_DTLS_SRTP=y
91
+ CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID=y
92
+ CONFIG_MBEDTLS_X509_CREATE_C=y
93
+ CONFIG_MBEDTLS_X509_CRT_WRITE_C=y
94
+ CONFIG_MBEDTLS_X509_CSR_WRITE_C=y
95
+
96
+ # Release optimization level for the large display workload.
97
+ CONFIG_COMPILER_OPTIMIZATION_PERF=y
98
+ CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
99
+ CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
100
+
101
+ # Development logging / diagnostics defaults.
102
+ # CONFIG_GEA_EMBEDDED_PRODUCTION_LOCKDOWN is not set
103
+ # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
104
+ CONFIG_LOG_DEFAULT_LEVEL_INFO=y
105
+ CONFIG_LOG_DEFAULT_LEVEL=3
106
+ CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
107
+ CONFIG_LOG_MAXIMUM_LEVEL=3
108
+ # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
109
+ CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
110
+ CONFIG_BOOTLOADER_LOG_LEVEL=3
111
+
112
+ # Keep standalone heap tracing available for framebuffer/app-init diagnosis.
113
+ # Heap tracing costs about a kilobyte of IRAM and puts a hook on the allocator's
114
+ # hot path. The framework's only users, the display and AXP2101 init traces, are
115
+ # already gated on GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG, which defaults to 0, so
116
+ # nothing traced by default and every app paid for it. Turn this and that macro
117
+ # on together when you actually want a trace.
118
+ CONFIG_HEAP_TRACING_OFF=y
119
+ # CONFIG_HEAP_TRACING_STANDALONE is not set
120
+ # CONFIG_HEAP_TRACING_TOHOST is not set
121
+ # CONFIG_HEAP_TRACING is not set
122
+ # CONFIG_HEAP_TRACE_HASH_MAP is not set
@@ -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,31 @@
1
+ {
2
+ "id": "esp32-s3-devkit-n16r8",
3
+ "extends": "esp32-s3",
4
+ "adapter": "esp32-idf",
5
+ "mcu": "esp32s3",
6
+
7
+ "_comment": "A bare ESP32-S3-WROOM-1-N16R8 module: 16MB quad flash, 8MB octal PSRAM, no panel, no touch, no PMIC, no IMU, no codec. Probed 2026-09-19: ESP32-S3 rev v0.2, flash MXIC c2/2018 16MB, embedded PSRAM 8MB.",
8
+
9
+ "flashSize": "16MB",
10
+
11
+ "_console": "This module is reached through its CH-series USB-UART bridge, not the native USB-Serial/JTAG port. The base target routes the console to USB-JTAG, which on this board logs into a port nobody is connected to.",
12
+ "console": { "transport": "uart", "uart": 0, "baud": 115200 },
13
+
14
+ "_psram": "N16R8 is 8MB OCTAL PSRAM (probed: AP generation-3, 64 Mbit, 3V). Declared rather than inherited — an octal setting on a quad-wired module boots wrong instead of failing.",
15
+ "psram": { "mode": "octal", "speed": 80 },
16
+
17
+ "_display": "No panel and no canvas: this module has no display at all, so the runtime builds no framebuffer, no app tree and no frame loop. A bare module that wants an offscreen surface to screenshot over OTA declares a `canvas` block instead.",
18
+
19
+ "controls": {
20
+ "launcherButton": { "pin": 0, "activeLevel": 0 }
21
+ },
22
+
23
+ "partitions": {
24
+ "nvs": { "type": "data", "subtype": "nvs", "offset": "0x9000", "size": "0x6000" },
25
+ "otadata": { "type": "data", "subtype": "ota", "offset": "0xf000", "size": "0x2000" },
26
+ "phy_init": { "type": "data", "subtype": "phy", "offset": "0x11000", "size": "0x1000" },
27
+ "ota_0": { "type": "app", "subtype": "ota_0", "offset": "0x20000", "size": "0x600000" },
28
+ "ota_1": { "type": "app", "subtype": "ota_1", "offset": "0x620000","size": "0x600000" },
29
+ "storage": { "type": "data", "subtype": "spiffs", "offset": "0xC20000","size": "0x3E0000" }
30
+ }
31
+ }
@@ -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,40 @@
1
+ dependencies:
2
+ espressif/esp_libsrtp:
3
+ component_hash: 131560184c73ec09f77d8904a2db709307803f0f9f111898921b6966776eac15
4
+ dependencies: []
5
+ source:
6
+ registry_url: https://components.espressif.com
7
+ type: service
8
+ version: 1.0.0
9
+ espressif/esp_peer:
10
+ component_hash: 2013edcc7d88756830055a74d86a3900f484d6015aacb820a6b7d81e53c7b05b
11
+ dependencies:
12
+ - name: espressif/esp_libsrtp
13
+ registry_url: https://components.espressif.com
14
+ require: private
15
+ version: ^1.0.0
16
+ source:
17
+ registry_url: https://components.espressif.com/
18
+ type: service
19
+ version: 1.4.1
20
+ espressif/esp_websocket_client:
21
+ component_hash: 3fb288702517ef4d75bf933a115f1056ee0c2540d964f9e1d856e0bb67e1dfeb
22
+ dependencies:
23
+ - name: idf
24
+ require: private
25
+ version: '>=5.0'
26
+ source:
27
+ registry_url: https://components.espressif.com/
28
+ type: service
29
+ version: 1.7.0
30
+ idf:
31
+ source:
32
+ type: idf
33
+ version: 6.0.2
34
+ direct_dependencies:
35
+ - espressif/esp_peer
36
+ - espressif/esp_websocket_client
37
+ - idf
38
+ manifest_hash: a95481ca1b3b5f42784f5a922c652118d52b1b70154ed81a0c4e8f5c72fd131e
39
+ target: esp32s3
40
+ version: 3.0.0