@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,95 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2006-2016 Matthew Conte
3
+ *
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+
7
+ #ifndef INCLUDED_tlsf
8
+ #define INCLUDED_tlsf
9
+
10
+ #include <stddef.h>
11
+ #include <stdbool.h>
12
+
13
+ #if defined(__cplusplus)
14
+ extern "C" {
15
+ #endif
16
+
17
+ /* tlsf_t: a TLSF structure. Can contain 1 to N pools. */
18
+ /* pool_t: a block of memory that TLSF can manage. */
19
+ typedef void* tlsf_t;
20
+ typedef void* pool_t;
21
+
22
+ /* Create/destroy a memory pool. */
23
+ tlsf_t tlsf_create(void* mem, size_t max_bytes);
24
+ tlsf_t tlsf_create_with_pool(void* mem, size_t pool_bytes, size_t max_bytes);
25
+ void tlsf_destroy(tlsf_t tlsf);
26
+ pool_t tlsf_get_pool(tlsf_t tlsf);
27
+
28
+ /* Add/remove memory pools. */
29
+ pool_t tlsf_add_pool(tlsf_t tlsf, void* mem, size_t bytes);
30
+ void tlsf_remove_pool(tlsf_t tlsf, pool_t pool);
31
+
32
+ /* malloc/memalign/realloc/free replacements. */
33
+ void* tlsf_malloc(tlsf_t tlsf, size_t size);
34
+ void* tlsf_memalign(tlsf_t tlsf, size_t align, size_t size);
35
+ void* tlsf_memalign_offs(tlsf_t tlsf, size_t align, size_t size, size_t offset);
36
+ void* tlsf_malloc_addr(tlsf_t tlsf, size_t size, void *address);
37
+ void* tlsf_realloc(tlsf_t tlsf, void* ptr, size_t size);
38
+ void tlsf_free(tlsf_t tlsf, void* ptr);
39
+
40
+ /* Returns internal block size, not original request size */
41
+ size_t tlsf_block_size(void* ptr);
42
+
43
+ /* Overheads/limits of internal structures. */
44
+ size_t tlsf_size(tlsf_t tlsf);
45
+ size_t tlsf_align_size(void);
46
+ size_t tlsf_block_size_min(void);
47
+ size_t tlsf_block_size_max(tlsf_t tlsf);
48
+ size_t tlsf_pool_overhead(void);
49
+ size_t tlsf_alloc_overhead(void);
50
+
51
+ /**
52
+ * @brief Return the allocable size based on the size passed
53
+ * as parameter
54
+ *
55
+ * @param tlsf Pointer to the tlsf structure
56
+ * @param size The allocation size
57
+ * @return size_t The updated allocation size
58
+ */
59
+ size_t tlsf_fit_size(tlsf_t tlsf, size_t size);
60
+
61
+ /* Debugging. */
62
+ typedef bool (*tlsf_walker)(void* ptr, size_t size, int used, void* user);
63
+ void tlsf_walk_pool(pool_t pool, tlsf_walker walker, void* user);
64
+ /* Returns nonzero if any internal consistency check fails. */
65
+ int tlsf_check(tlsf_t tlsf);
66
+ int tlsf_check_pool(pool_t pool);
67
+
68
+ /*!
69
+ * @brief Weak function filling the given memory with a given fill pattern.
70
+ *
71
+ * @param start: pointer to the start of the memory region to fill
72
+ * @param size: size of the memory region to fill
73
+ * @param is_free: Indicate if the pattern to use the fill the region should be
74
+ * an after free or after allocation pattern.
75
+ */
76
+ __attribute__((weak)) void block_absorb_post_hook(void *start, size_t size, bool is_free);
77
+
78
+ /**
79
+ * @brief Weak function called on every free block of memory allowing the user to implement
80
+ * application specific checks on the memory.
81
+ *
82
+ * @param start The start pointer to the memory of a block
83
+ * @param size The size of the memory in the block
84
+ * @param is_free Set to true when the memory belongs to a free block.
85
+ * False if it belongs to an allocated block.
86
+ * @return true The checks found no inconsistency in the memory
87
+ * @return false The checks in the function highlighted an inconsistency in the memory
88
+ */
89
+ __attribute__((weak)) bool tlsf_check_hook(void *start, size_t size, bool is_free);
90
+
91
+ #if defined(__cplusplus)
92
+ };
93
+ #endif
94
+
95
+ #endif
@@ -0,0 +1,123 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2006-2016 Matthew Conte
3
+ *
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+
7
+ #pragma once
8
+ #include "tlsf_common.h"
9
+
10
+ #if defined(__cplusplus)
11
+ extern "C" {
12
+ #endif
13
+
14
+ /*
15
+ ** block_header_t member functions.
16
+ */
17
+
18
+ static inline __attribute__((always_inline)) size_t block_size(const block_header_t* block)
19
+ {
20
+ return block->size & ~(block_header_free_bit | block_header_prev_free_bit);
21
+ }
22
+
23
+ static inline __attribute__((always_inline)) void block_set_size(block_header_t* block, size_t size)
24
+ {
25
+ const size_t oldsize = block->size;
26
+ block->size = size | (oldsize & (block_header_free_bit | block_header_prev_free_bit));
27
+ }
28
+
29
+ static inline __attribute__((always_inline)) int block_is_last(const block_header_t* block)
30
+ {
31
+ return block_size(block) == 0;
32
+ }
33
+
34
+ static inline __attribute__((always_inline)) int block_is_free(const block_header_t* block)
35
+ {
36
+ return tlsf_cast(int, block->size & block_header_free_bit);
37
+ }
38
+
39
+ static inline __attribute__((always_inline)) void block_set_free(block_header_t* block)
40
+ {
41
+ block->size |= block_header_free_bit;
42
+ }
43
+
44
+ static inline __attribute__((always_inline)) void block_set_used(block_header_t* block)
45
+ {
46
+ block->size &= ~block_header_free_bit;
47
+ }
48
+
49
+ static inline __attribute__((always_inline)) int block_is_prev_free(const block_header_t* block)
50
+ {
51
+ return tlsf_cast(int, block->size & block_header_prev_free_bit);
52
+ }
53
+
54
+ static inline __attribute__((always_inline)) void block_set_prev_free(block_header_t* block)
55
+ {
56
+ block->size |= block_header_prev_free_bit;
57
+ }
58
+
59
+ static inline __attribute__((always_inline)) void block_set_prev_used(block_header_t* block)
60
+ {
61
+ block->size &= ~block_header_prev_free_bit;
62
+ }
63
+
64
+ static inline __attribute__((always_inline)) block_header_t* block_from_ptr(const void* ptr)
65
+ {
66
+ return tlsf_cast(block_header_t*,
67
+ tlsf_cast(unsigned char*, ptr) - block_start_offset);
68
+ }
69
+
70
+ static inline __attribute__((always_inline)) void* block_to_ptr(const block_header_t* block)
71
+ {
72
+ return tlsf_cast(void*,
73
+ tlsf_cast(unsigned char*, block) + block_start_offset);
74
+ }
75
+
76
+ /* Return location of next block after block of given size. */
77
+ static inline __attribute__((always_inline)) block_header_t* offset_to_block(const void* ptr, size_t size)
78
+ {
79
+ return tlsf_cast(block_header_t*, tlsf_cast(tlsfptr_t, ptr) + size);
80
+ }
81
+
82
+ /* Return location of previous block. */
83
+ static inline __attribute__((always_inline)) block_header_t* block_prev(const block_header_t* block)
84
+ {
85
+ tlsf_assert(block_is_prev_free(block) && "previous block must be free");
86
+ return block->prev_phys_block;
87
+ }
88
+
89
+ /* Return location of next existing block. */
90
+ static inline __attribute__((always_inline)) block_header_t* block_next(const block_header_t* block)
91
+ {
92
+ block_header_t* next = offset_to_block(block_to_ptr(block),
93
+ block_size(block) - block_header_overhead);
94
+ tlsf_assert(!block_is_last(block));
95
+ return next;
96
+ }
97
+
98
+ /* Link a new block with its physical neighbor, return the neighbor. */
99
+ static inline __attribute__((always_inline)) block_header_t* block_link_next(block_header_t* block)
100
+ {
101
+ block_header_t* next = block_next(block);
102
+ next->prev_phys_block = block;
103
+ return next;
104
+ }
105
+
106
+ static inline __attribute__((always_inline)) void block_mark_as_free(block_header_t* block)
107
+ {
108
+ /* Link the block to the next block, first. */
109
+ block_header_t* next = block_link_next(block);
110
+ block_set_prev_free(next);
111
+ block_set_free(block);
112
+ }
113
+
114
+ static inline __attribute__((always_inline)) void block_mark_as_used(block_header_t* block)
115
+ {
116
+ block_header_t* next = block_next(block);
117
+ block_set_prev_used(next);
118
+ block_set_used(block);
119
+ }
120
+
121
+ #if defined(__cplusplus)
122
+ };
123
+ #endif
@@ -0,0 +1,127 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2006-2016 Matthew Conte
3
+ *
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+
7
+ #pragma once
8
+ #include <stddef.h>
9
+ #include <assert.h>
10
+
11
+ #if defined(__cplusplus)
12
+ extern "C" {
13
+ #endif
14
+
15
+ /*
16
+ ** Constants definition for poisoning.
17
+ ** These defines are used as 3rd argument of tlsf_poison_fill_region() for readability purposes.
18
+ */
19
+ #define POISONING_AFTER_FREE true
20
+ #define POISONING_AFTER_MALLOC !POISONING_AFTER_FREE
21
+
22
+ /*
23
+ ** Cast and min/max macros.
24
+ */
25
+ #define tlsf_cast(t, exp) ((t) (exp))
26
+ #define tlsf_min(a, b) ((a) < (b) ? (a) : (b))
27
+ #define tlsf_max(a, b) ((a) > (b) ? (a) : (b))
28
+
29
+ /*
30
+ ** Set assert macro, if it has not been provided by the user.
31
+ */
32
+ #if !defined (tlsf_assert)
33
+ #define tlsf_assert assert
34
+ #endif
35
+
36
+ enum tlsf_config
37
+ {
38
+ /* All allocation sizes and addresses are aligned to 4 bytes. */
39
+ ALIGN_SIZE_LOG2 = 2,
40
+ ALIGN_SIZE = (1 << ALIGN_SIZE_LOG2),
41
+ };
42
+
43
+ /*
44
+ ** Data structures and associated constants.
45
+ */
46
+
47
+ /* A type used for casting when doing pointer arithmetic. */
48
+ typedef ptrdiff_t tlsfptr_t;
49
+
50
+ typedef struct block_header_t
51
+ {
52
+ /* Points to the previous physical block. */
53
+ struct block_header_t* prev_phys_block;
54
+
55
+ /* The size of this block, excluding the block header. */
56
+ size_t size;
57
+
58
+ /* Next and previous free blocks. */
59
+ struct block_header_t* next_free;
60
+ struct block_header_t* prev_free;
61
+ } block_header_t;
62
+
63
+ /*
64
+ ** Since block sizes are always at least a multiple of 4, the two least
65
+ ** significant bits of the size field are used to store the block status:
66
+ ** - bit 0: whether block is busy or free
67
+ ** - bit 1: whether previous block is busy or free
68
+ */
69
+ static const size_t block_header_free_bit = 1 << 0;
70
+ static const size_t block_header_prev_free_bit = 1 << 1;
71
+
72
+ /*
73
+ ** The size of the block header exposed to used blocks is the size field.
74
+ ** The prev_phys_block field is stored *inside* the previous free block.
75
+ */
76
+ static const size_t block_header_overhead = sizeof(size_t);
77
+
78
+ /* User data starts directly after the size field in a used block. */
79
+ static const size_t block_start_offset =
80
+ offsetof(block_header_t, size) + sizeof(size_t);
81
+
82
+ /*
83
+ ** A free block must be large enough to store its header minus the size of
84
+ ** the prev_phys_block field, and no larger than the number of addressable
85
+ ** bits for FL_INDEX.
86
+ */
87
+ static const size_t block_size_min =
88
+ sizeof(block_header_t) - sizeof(block_header_t*);
89
+
90
+ /* The TLSF control structure. */
91
+ typedef struct control_t
92
+ {
93
+ /* Empty lists point at this block to indicate they are free. */
94
+ block_header_t block_null;
95
+
96
+ /* Local parameter for the pool. Given the maximum
97
+ * value of each field, all the following parameters
98
+ * can fit on 4 bytes when using bitfields
99
+ */
100
+ unsigned int fl_index_count : 5; // 5 cumulated bits
101
+ unsigned int fl_index_shift : 3; // 8 cumulated bits
102
+ unsigned int fl_index_max : 6; // 14 cumulated bits
103
+ unsigned int sl_index_count : 6; // 20 cumulated bits
104
+
105
+ /* log2 of number of linear subdivisions of block sizes. Larger
106
+ ** values require more memory in the control structure. Values of
107
+ ** 4 or 5 are typical.
108
+ */
109
+ unsigned int sl_index_count_log2 : 3; // 23 cumulated bits
110
+ unsigned int small_block_size : 8; // 31 cumulated bits
111
+
112
+ /* size of the metadata ( size of control block,
113
+ * sl_bitmap and blocks )
114
+ */
115
+ size_t size;
116
+
117
+ /* Bitmaps for free lists. */
118
+ unsigned int fl_bitmap;
119
+ unsigned int *sl_bitmap;
120
+
121
+ /* Head of free lists. */
122
+ block_header_t** blocks;
123
+ } control_t;
124
+
125
+ #if defined(__cplusplus)
126
+ };
127
+ #endif
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/env python3
2
+ """Reproducible scroll benchmark for RP2350 gea targets.
3
+
4
+ Drives the firmware's GEADEV DRAG synthetic-touch command (see
5
+ rp2350_gea_platform.cpp: startSyntheticDrag) with a fixed gesture script and
6
+ summarizes the gea.rp2350.perf / .phase / .refresh / .text_cache counters the
7
+ firmware prints once per second (GEA_RP2350_PERF_LOG, and
8
+ GEA_RP2350_FRAME_PHASE_PERF / GEA_RP2350_REFRESH_DETAIL_PERF when compiled in).
9
+
10
+ Usage:
11
+ python3 rp2350-scroll-bench.py [--port /dev/cu.usbmodemXXX] [--label name]
12
+ [--drags 6] [--out capture.log]
13
+
14
+ The workload: N full-height up-drags (content scrolls down) with momentum,
15
+ then N down-drags back, ~1.4s apart. "Active" seconds are those with
16
+ flush_calls >= 5; idle seconds are excluded from the scroll averages.
17
+ """
18
+
19
+ import argparse
20
+ import glob
21
+ import re
22
+ import sys
23
+ import threading
24
+ import time
25
+
26
+ import serial
27
+
28
+
29
+ def find_port(explicit):
30
+ if explicit:
31
+ return explicit
32
+ # Identify the RP2350 by its once-per-second gea.rp2350.* stats lines
33
+ # (GEA_RP2350_PERF_LOG) — a GEADEV:PONG alone could be any gea device on
34
+ # another board.
35
+ for dev in sorted(glob.glob("/dev/cu.usbmodem*")):
36
+ try:
37
+ s = serial.Serial(dev, 115200, timeout=0.2)
38
+ except Exception:
39
+ continue
40
+ try:
41
+ s.reset_input_buffer()
42
+ deadline = time.time() + 2.5
43
+ buf = b""
44
+ while time.time() < deadline:
45
+ try:
46
+ buf += s.read(1024)
47
+ except serial.SerialException:
48
+ break # port vanished mid-probe (device re-enumerating)
49
+ if b"gea.rp2350." in buf:
50
+ return dev
51
+ finally:
52
+ s.close()
53
+ return None
54
+
55
+
56
+ class Capture(threading.Thread):
57
+ def __init__(self, port):
58
+ super().__init__(daemon=True)
59
+ self.serial = serial.Serial(port, 115200, timeout=0.5)
60
+ self.lines = []
61
+ self.ok_drags = 0
62
+ self.stop_flag = False
63
+ self.t0 = time.time()
64
+
65
+ def run(self):
66
+ while not self.stop_flag:
67
+ raw = self.serial.readline()
68
+ if not raw:
69
+ continue
70
+ line = raw.decode("utf-8", "replace").rstrip()
71
+ if not line:
72
+ continue
73
+ self.lines.append((time.time() - self.t0, line))
74
+ if line.startswith("GEADEV:OK DRAG"):
75
+ self.ok_drags += 1
76
+
77
+ def send(self, cmd):
78
+ self.serial.write((cmd + "\n").encode())
79
+ self.serial.flush()
80
+
81
+
82
+ def kv_ints(line):
83
+ return {k: int(v) for k, v in re.findall(r"(\w+)=(-?\d+)", line)}
84
+
85
+
86
+ def main():
87
+ ap = argparse.ArgumentParser()
88
+ ap.add_argument("--port")
89
+ ap.add_argument("--label", default="run")
90
+ ap.add_argument("--drags", type=int, default=6)
91
+ ap.add_argument("--out")
92
+ args = ap.parse_args()
93
+
94
+ port = find_port(args.port)
95
+ if not port:
96
+ print("ERROR: no GEADEV-responding serial port found", file=sys.stderr)
97
+ return 1
98
+ print(f"[{args.label}] port={port}")
99
+
100
+ cap = Capture(port)
101
+ cap.start()
102
+ time.sleep(2.5) # settle + one idle second of stats
103
+
104
+ gestures = [(225, 520, 225, 120)] * args.drags + [(225, 120, 225, 520)] * args.drags
105
+ for i, (x1, y1, x2, y2) in enumerate(gestures):
106
+ before = cap.ok_drags
107
+ cap.send(f"GEADEV DRAG {x1} {y1} {x2} {y2} 25 16")
108
+ deadline = time.time() + 4
109
+ while cap.ok_drags == before and time.time() < deadline:
110
+ time.sleep(0.05)
111
+ if cap.ok_drags == before:
112
+ print(f"WARN: drag {i} not acknowledged", file=sys.stderr)
113
+ time.sleep(1.4) # let momentum play out
114
+
115
+ time.sleep(3) # idle tail
116
+ cap.stop_flag = True
117
+ time.sleep(0.8)
118
+
119
+ if args.out:
120
+ with open(args.out, "w") as f:
121
+ for ts, line in cap.lines:
122
+ f.write(f"{ts:7.2f} {line}\n")
123
+
124
+ perf = [kv_ints(l) for _, l in cap.lines if "gea.rp2350.perf " in l]
125
+ phase = [kv_ints(l) for _, l in cap.lines if "gea.rp2350.phase " in l]
126
+ text = [kv_ints(l) for _, l in cap.lines if "gea.rp2350.text_cache " in l]
127
+
128
+ active = [p for p in perf if p.get("flush_calls", 0) >= 5]
129
+ if not active:
130
+ print("no active seconds captured — did the drags scroll anything?")
131
+ return 1
132
+
133
+ def mean(xs):
134
+ return sum(xs) / len(xs)
135
+
136
+ fps = [p["fps"] for p in active]
137
+ tot = [p["total_ms"] for p in active]
138
+ txw = [p["txwait_ms"] for p in active]
139
+ kpx = [p["flush_kpx"] for p in active]
140
+
141
+ # phase lines aligned to active seconds by index in the shared cadence
142
+ act_idx = [i for i, p in enumerate(perf) if p.get("flush_calls", 0) >= 5]
143
+ aphase = [phase[i] for i in act_idx if i < len(phase)]
144
+ work = [p["work_ms"] for p in aphase] if aphase else [0]
145
+ avg_work = [p["avg_work_us"] for p in aphase] if aphase else [0]
146
+ worst = max((p["worst_work_us"] for p in aphase), default=0)
147
+ over = sum(p["over_budget"] for p in aphase) if aphase else 0
148
+ frames = sum(p["frames"] for p in aphase) if aphase else 0
149
+
150
+ tc_calls = sum(t.get("calls", 0) for t in text)
151
+ tc_hits = sum(t.get("hits", 0) for t in text)
152
+
153
+ print(f"[{args.label}] active_seconds={len(active)} ok_drags={cap.ok_drags}")
154
+ print(f"[{args.label}] fps mean={mean(fps):.1f} min={min(fps)} max={max(fps)}")
155
+ print(f"[{args.label}] work_ms/s mean={mean(work):.0f} avg_work_us={mean(avg_work):.0f} worst_work_us={worst} over_budget={over}/{frames}")
156
+ print(f"[{args.label}] flush total_ms/s mean={mean(tot):.0f} txwait_ms/s mean={mean(txw):.0f} kpx/s mean={mean(kpx):.0f}")
157
+ print(f"[{args.label}] text_cache calls={tc_calls} hits={tc_hits}")
158
+ return 0
159
+
160
+
161
+ if __name__ == "__main__":
162
+ sys.exit(main())
@@ -0,0 +1,198 @@
1
+ #!/usr/bin/env python3
2
+ """Pixel-parity capture for RP2350 scroll-path changes.
3
+
4
+ Drives GEADEV DRAG gestures to the scroll clamps (deterministic positions),
5
+ takes GEADEV SCREENSHOT captures (logical row order — scroll-offset invariant)
6
+ and saves the decoded RGB565 pixel arrays. Run once against a reference build
7
+ and once against a candidate build, then compare with --compare a.bin b.bin.
8
+
9
+ python3 rp2350-scroll-parity.py --label ref --outdir /tmp/parity
10
+ python3 rp2350-scroll-parity.py --label new --outdir /tmp/parity
11
+ python3 rp2350-scroll-parity.py --compare /tmp/parity/ref_bottom.pix /tmp/parity/new_bottom.pix
12
+ """
13
+
14
+ import argparse
15
+ import base64
16
+ import glob
17
+ import os
18
+ import struct
19
+ import sys
20
+ import time
21
+
22
+ import serial
23
+
24
+
25
+ def find_port(explicit):
26
+ if explicit:
27
+ return explicit
28
+ for dev in sorted(glob.glob("/dev/cu.usbmodem*")):
29
+ try:
30
+ s = serial.Serial(dev, 115200, timeout=0.2)
31
+ except Exception:
32
+ continue
33
+ try:
34
+ s.reset_input_buffer()
35
+ deadline = time.time() + 2.5
36
+ buf = b""
37
+ while time.time() < deadline:
38
+ try:
39
+ buf += s.read(1024)
40
+ except serial.SerialException:
41
+ break
42
+ if b"gea.rp2350." in buf:
43
+ return dev
44
+ finally:
45
+ s.close()
46
+ return None
47
+
48
+
49
+ def read_line(port, timeout):
50
+ deadline = time.time() + timeout
51
+ while time.time() < deadline:
52
+ line = port.readline().decode("utf-8", "replace").rstrip()
53
+ if line:
54
+ yield line
55
+ return
56
+
57
+
58
+ def drag(port, x1, y1, x2, y2, steps=25, delay=16):
59
+ port.reset_input_buffer()
60
+ port.write(f"GEADEV DRAG {x1} {y1} {x2} {y2} {steps} {delay}\n".encode())
61
+ port.flush()
62
+ for line in read_line(port, 4):
63
+ if line.startswith("GEADEV:OK DRAG"):
64
+ return True
65
+ if line.startswith("GEADEV:ERR"):
66
+ print("drag error:", line, file=sys.stderr)
67
+ return False
68
+ print("drag not acknowledged", file=sys.stderr)
69
+ return False
70
+
71
+
72
+ def screenshot(port):
73
+ port.reset_input_buffer()
74
+ port.write(b"GEADEV SCREENSHOT\n")
75
+ port.flush()
76
+ width = height = None
77
+ chunks = []
78
+ # Bulk-read the whole dump: a full-screen dithered frame RLE-encodes to
79
+ # ~1MB of base64, and per-line reads fall behind the CDC stream (the OS
80
+ # input buffer overflows and drops bytes mid-line -> corrupt payload).
81
+ deadline = time.time() + 60
82
+ buf = b""
83
+ while time.time() < deadline:
84
+ chunk = port.read(65536)
85
+ if chunk:
86
+ buf += chunk
87
+ if b"GEADEV:SCREENSHOT END" in buf:
88
+ break
89
+ elif b"GEADEV:SCREENSHOT END" in buf:
90
+ break
91
+ in_shot = False
92
+ for raw in buf.split(b"\n"):
93
+ line = raw.decode("utf-8", "replace").rstrip()
94
+ if line.startswith("GEADEV:SCREENSHOT BEGIN"):
95
+ in_shot = True
96
+ for tok in line.split():
97
+ if tok.startswith("width="):
98
+ width = int(tok[6:])
99
+ if tok.startswith("height="):
100
+ height = int(tok[7:])
101
+ continue
102
+ if line.startswith("GEADEV:SCREENSHOT END"):
103
+ break
104
+ if in_shot and line.startswith("GEADEV:DATA "):
105
+ chunks.append(line[len("GEADEV:DATA "):].strip())
106
+ if not width or not chunks:
107
+ return None, 0, 0
108
+ data = base64.b64decode("".join(chunks))
109
+ pixels = []
110
+ for i in range(0, len(data) - 3, 4):
111
+ count, value = struct.unpack_from("<HH", data, i)
112
+ pixels.extend([value] * count)
113
+ n = width * height
114
+ if len(pixels) != n:
115
+ print(f"WARN: decoded {len(pixels)} px, expected {n}", file=sys.stderr)
116
+ pixels = (pixels + [0] * n)[:n]
117
+ return pixels, width, height
118
+
119
+
120
+ def save(path, pixels, width, height):
121
+ with open(path, "wb") as f:
122
+ f.write(struct.pack("<HH", width, height))
123
+ f.write(struct.pack(f"<{len(pixels)}H", *pixels))
124
+ print("saved", path)
125
+
126
+
127
+ def save_png(path, pixels, width, height):
128
+ try:
129
+ from PIL import Image
130
+ except ImportError:
131
+ return
132
+ rgb = bytearray(width * height * 3)
133
+ for i, v in enumerate(pixels):
134
+ # framebuffer is panel-endian: swap bytes back before unpacking 565
135
+ v = ((v & 0xFF) << 8) | (v >> 8)
136
+ r = (v >> 11) & 0x1F
137
+ g = (v >> 5) & 0x3F
138
+ b = v & 0x1F
139
+ rgb[i * 3 + 0] = (r << 3) | (r >> 2)
140
+ rgb[i * 3 + 1] = (g << 2) | (g >> 4)
141
+ rgb[i * 3 + 2] = (b << 3) | (b >> 2)
142
+ Image.frombytes("RGB", (width, height), bytes(rgb)).save(path)
143
+ print("saved", path)
144
+
145
+
146
+ def compare(a, b):
147
+ da = open(a, "rb").read()
148
+ db = open(b, "rb").read()
149
+ if da == db:
150
+ print("IDENTICAL")
151
+ return 0
152
+ wa, ha = struct.unpack_from("<HH", da, 0)
153
+ pa = struct.unpack_from(f"<{wa*ha}H", da, 4)
154
+ pb = struct.unpack_from(f"<{wa*ha}H", db, 4)
155
+ diff = [i for i in range(len(pa)) if pa[i] != pb[i]]
156
+ rows = sorted({i // wa for i in diff})
157
+ print(f"DIFFER: {len(diff)} px, rows {rows[:10]}{'...' if len(rows) > 10 else ''} ({len(rows)} rows)")
158
+ return 1
159
+
160
+
161
+ def main():
162
+ ap = argparse.ArgumentParser()
163
+ ap.add_argument("--port")
164
+ ap.add_argument("--label", default="run")
165
+ ap.add_argument("--outdir", default=".")
166
+ ap.add_argument("--drags", type=int, default=10)
167
+ ap.add_argument("--compare", nargs=2)
168
+ args = ap.parse_args()
169
+
170
+ if args.compare:
171
+ return compare(*args.compare)
172
+
173
+ dev = find_port(args.port)
174
+ if not dev:
175
+ print("no rp2350 port found", file=sys.stderr)
176
+ return 1
177
+ port = serial.Serial(dev, 115200, timeout=0.5)
178
+ os.makedirs(args.outdir, exist_ok=True)
179
+ print(f"[{args.label}] port={dev}")
180
+
181
+ for name, gesture in (("bottom", (225, 520, 225, 120)), ("top", (225, 120, 225, 520))):
182
+ for _ in range(args.drags):
183
+ drag(port, *gesture)
184
+ time.sleep(1.3)
185
+ time.sleep(2) # settle
186
+ pixels, w, h = screenshot(port)
187
+ if pixels is None:
188
+ print("screenshot failed", file=sys.stderr)
189
+ return 1
190
+ base = os.path.join(args.outdir, f"{args.label}_{name}")
191
+ save(base + ".pix", pixels, w, h)
192
+ save_png(base + ".png", pixels, w, h)
193
+ port.close()
194
+ return 0
195
+
196
+
197
+ if __name__ == "__main__":
198
+ sys.exit(main())