@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,124 @@
1
+ #pragma once
2
+
3
+ #include <array>
4
+ #include <cstdint>
5
+
6
+ #include "rtc/pcf85063/pcf85063.h"
7
+
8
+ namespace gea::platform::board {
9
+
10
+ struct I2cBusConfig {
11
+ int bus;
12
+ int sda;
13
+ int scl;
14
+ std::uint32_t frequencyHz;
15
+ };
16
+
17
+ struct St7789ParallelDisplayConfig {
18
+ int pio;
19
+ int stateMachine;
20
+ int cs;
21
+ int dc;
22
+ int wr;
23
+ int rd;
24
+ int data0;
25
+ int backlight;
26
+ int vsync;
27
+ int width;
28
+ int height;
29
+ };
30
+
31
+ struct Pcf85063RtcConfig {
32
+ std::uint8_t address;
33
+ std::uint32_t frequencyHz;
34
+ };
35
+
36
+ struct PowerConfig {
37
+ int powerKey;
38
+ int powerHold;
39
+ int batteryAdc;
40
+ int batteryAdcChannel;
41
+ };
42
+
43
+ struct StorageConfig {
44
+ std::uint32_t flashBytes;
45
+ std::uint32_t psramBytes;
46
+ };
47
+
48
+ struct ButtonConfig {
49
+ int pin;
50
+ int keyCode;
51
+ bool activeLow;
52
+ bool pullUp;
53
+ // When true, the button auto-repeats its keydown while held (typematic
54
+ // repeat) instead of firing once per press — used for the scroll buttons.
55
+ bool repeat = false;
56
+ };
57
+
58
+ class PimoroniTufty2350 {
59
+ public:
60
+ static constexpr int kKeyCodeButtonA = 65;
61
+ static constexpr int kKeyCodeButtonB = 66;
62
+ static constexpr int kKeyCodeButtonC = 67;
63
+ static constexpr int kKeyCodeArrowUp = 38;
64
+ static constexpr int kKeyCodeArrowDown = 40;
65
+ static constexpr int kKeyCodeEscape = 27;
66
+
67
+ static constexpr I2cBusConfig i2c{
68
+ .bus = 0,
69
+ .sda = 4,
70
+ .scl = 5,
71
+ .frequencyHz = 400000,
72
+ };
73
+
74
+ static constexpr St7789ParallelDisplayConfig display{
75
+ .pio = 1,
76
+ .stateMachine = 0,
77
+ .cs = 27,
78
+ .dc = 28,
79
+ .wr = 30,
80
+ .rd = 31,
81
+ .data0 = 32,
82
+ .backlight = 26,
83
+ .vsync = 21,
84
+ .width = 320,
85
+ .height = 240,
86
+ };
87
+
88
+ static constexpr Pcf85063RtcConfig rtc{
89
+ .address = gea::chips::pcf85063::kI2cAddress,
90
+ .frequencyHz = gea::chips::pcf85063::kI2cFrequencyHz,
91
+ };
92
+
93
+ static constexpr PowerConfig power{
94
+ .powerKey = 14,
95
+ .powerHold = 41,
96
+ .batteryAdc = 40,
97
+ .batteryAdcChannel = 0,
98
+ };
99
+
100
+ static constexpr StorageConfig storage{
101
+ .flashBytes = 16U * 1024U * 1024U,
102
+ .psramBytes = 8U * 1024U * 1024U,
103
+ };
104
+
105
+ static constexpr std::array<ButtonConfig, 6> buttons{{
106
+ {.pin = 6, .keyCode = kKeyCodeArrowDown, .activeLow = true, .pullUp = true, .repeat = true},
107
+ {.pin = 7, .keyCode = kKeyCodeButtonA, .activeLow = true, .pullUp = true},
108
+ {.pin = 9, .keyCode = kKeyCodeButtonB, .activeLow = true, .pullUp = true},
109
+ {.pin = 10, .keyCode = kKeyCodeButtonC, .activeLow = true, .pullUp = true},
110
+ {.pin = 11, .keyCode = kKeyCodeArrowUp, .activeLow = true, .pullUp = true, .repeat = true},
111
+ {.pin = 22, .keyCode = kKeyCodeEscape, .activeLow = true, .pullUp = true},
112
+ }};
113
+ };
114
+
115
+ using Board = PimoroniTufty2350;
116
+
117
+ inline constexpr auto i2c = Board::i2c;
118
+ inline constexpr auto display = Board::display;
119
+ inline constexpr auto rtc = Board::rtc;
120
+ inline constexpr auto power = Board::power;
121
+ inline constexpr auto storage = Board::storage;
122
+ inline constexpr auto buttons = Board::buttons;
123
+
124
+ } // namespace gea::platform::board
@@ -0,0 +1,428 @@
1
+ #include "rp2350_panel.h"
2
+
3
+ #include "board.h"
4
+ #include "st7789_parallel.pio.h"
5
+
6
+ #include "hardware/clocks.h"
7
+ #include "hardware/dma.h"
8
+ #include "hardware/gpio.h"
9
+ #include "hardware/pio.h"
10
+ #include "hardware/pwm.h"
11
+ #include "pico/stdlib.h"
12
+
13
+ #include <algorithm>
14
+ #include <cstddef>
15
+ #include <cstdint>
16
+ #include <cstring>
17
+
18
+ namespace gea::rp2350 {
19
+ namespace {
20
+
21
+ namespace board = gea::platform::board;
22
+
23
+ enum class Reg : std::uint8_t {
24
+ SwReset = 0x01,
25
+ MadCtl = 0x36,
26
+ ColMod = 0x3a,
27
+ PorCtrl = 0xb2,
28
+ RamCtrl = 0xb0,
29
+ GCtrl = 0xb7,
30
+ VComS = 0xbb,
31
+ LcmCtrl = 0xc0,
32
+ VdvVrhEn = 0xc2,
33
+ Vrhs = 0xc3,
34
+ Vdvs = 0xc4,
35
+ FrameCtrl2 = 0xc6,
36
+ PowerCtrl1 = 0xd0,
37
+ GammaPositive = 0xe0,
38
+ GammaNegative = 0xe1,
39
+ InvOn = 0x21,
40
+ SleepOut = 0x11,
41
+ DisplayOn = 0x29,
42
+ RamWrite = 0x2c,
43
+ ColumnAddress = 0x2a,
44
+ RowAddress = 0x2b,
45
+ };
46
+
47
+ struct PanelState {
48
+ PIO pio = pio1;
49
+ uint sm = 0;
50
+ uint offset = 0;
51
+ uint dma = 0;
52
+ dma_channel_config dmaConfig{};
53
+ bool ready = false;
54
+ int flushRows = 64;
55
+ int flushDepth = 1;
56
+ };
57
+
58
+ PanelState gPanel;
59
+ std::uint16_t gLineA[kNativePanelWidth];
60
+ std::uint16_t gLineB[kNativePanelWidth];
61
+ std::uint16_t gRasterLine[kPanelWidth];
62
+ PanelFlushStats gFlushStats;
63
+
64
+ std::uint16_t be16(std::uint16_t value)
65
+ {
66
+ return static_cast<std::uint16_t>((value << 8) | (value >> 8));
67
+ }
68
+
69
+ void waitForPioIdle()
70
+ {
71
+ const std::uint32_t stallMask = 1u << (PIO_FDEBUG_TXSTALL_LSB + gPanel.sm);
72
+ gPanel.pio->fdebug = stallMask;
73
+ while (!(gPanel.pio->fdebug & stallMask)) {
74
+ tight_loop_contents();
75
+ }
76
+ }
77
+
78
+ void waitDma()
79
+ {
80
+ const std::uint64_t startUs = time_us_64();
81
+ dma_channel_wait_for_finish_blocking(gPanel.dma);
82
+ waitForPioIdle();
83
+ gFlushStats.txWaitUs += static_cast<std::int64_t>(time_us_64() - startUs);
84
+ }
85
+
86
+ void startDma(const std::uint8_t *data, std::size_t bytes)
87
+ {
88
+ if (!data || bytes == 0) return;
89
+ gFlushStats.chunkCount++;
90
+ dma_channel_set_trans_count(gPanel.dma, static_cast<std::uint32_t>(bytes), false);
91
+ dma_channel_set_read_addr(gPanel.dma, data, true);
92
+ }
93
+
94
+ void writeBlocking(const std::uint8_t *data, std::size_t bytes)
95
+ {
96
+ startDma(data, bytes);
97
+ waitDma();
98
+ }
99
+
100
+ void command(std::uint8_t reg, const std::uint8_t *data = nullptr, std::size_t bytes = 0)
101
+ {
102
+ waitDma();
103
+ gpio_put(board::display.dc, 0);
104
+ gpio_put(board::display.cs, 0);
105
+ writeBlocking(&reg, 1);
106
+ if (data && bytes > 0) {
107
+ gpio_put(board::display.dc, 1);
108
+ writeBlocking(data, bytes);
109
+ }
110
+ gpio_put(board::display.cs, 1);
111
+ }
112
+
113
+ void command(Reg reg, const std::uint8_t *data = nullptr, std::size_t bytes = 0)
114
+ {
115
+ command(static_cast<std::uint8_t>(reg), data, bytes);
116
+ }
117
+
118
+ void commandBytes(Reg reg, const char *data, std::size_t bytes)
119
+ {
120
+ command(reg, reinterpret_cast<const std::uint8_t *>(data), bytes);
121
+ }
122
+
123
+ void setWindow(int x0, int y0, int x1, int y1)
124
+ {
125
+ x0 = std::clamp(x0, 0, kNativePanelWidth - 1);
126
+ y0 = std::clamp(y0, 0, kNativePanelHeight - 1);
127
+ x1 = std::clamp(x1, x0, kNativePanelWidth - 1);
128
+ y1 = std::clamp(y1, y0, kNativePanelHeight - 1);
129
+
130
+ const std::uint16_t columns[] = {
131
+ be16(static_cast<std::uint16_t>(x0)),
132
+ be16(static_cast<std::uint16_t>(x1)),
133
+ };
134
+ const std::uint16_t rows[] = {
135
+ be16(static_cast<std::uint16_t>(y0)),
136
+ be16(static_cast<std::uint16_t>(y1)),
137
+ };
138
+ command(Reg::ColumnAddress, reinterpret_cast<const std::uint8_t *>(columns), sizeof(columns));
139
+ command(Reg::RowAddress, reinterpret_cast<const std::uint8_t *>(rows), sizeof(rows));
140
+ }
141
+
142
+ void beginPixels(int x0, int y0, int x1, int y1)
143
+ {
144
+ const std::uint64_t startUs = time_us_64();
145
+ setWindow(x0, y0, x1, y1);
146
+ gFlushStats.setWindowUs += static_cast<std::int64_t>(time_us_64() - startUs);
147
+ waitDma();
148
+ const auto ramWrite = static_cast<std::uint8_t>(Reg::RamWrite);
149
+ gpio_put(board::display.dc, 0);
150
+ gpio_put(board::display.cs, 0);
151
+ writeBlocking(&ramWrite, 1);
152
+ gpio_put(board::display.dc, 1);
153
+ }
154
+
155
+ void endPixels()
156
+ {
157
+ waitDma();
158
+ gpio_put(board::display.cs, 1);
159
+ }
160
+
161
+ void configureDma(bool readIncrement)
162
+ {
163
+ gPanel.dmaConfig = dma_channel_get_default_config(gPanel.dma);
164
+ channel_config_set_read_increment(&gPanel.dmaConfig, readIncrement);
165
+ channel_config_set_transfer_data_size(&gPanel.dmaConfig, DMA_SIZE_8);
166
+ channel_config_set_dreq(&gPanel.dmaConfig, pio_get_dreq(gPanel.pio, gPanel.sm, true));
167
+ dma_channel_configure(gPanel.dma, &gPanel.dmaConfig, &gPanel.pio->txf[gPanel.sm], nullptr, 0, false);
168
+ }
169
+
170
+ void initParallelBus()
171
+ {
172
+ gPanel.pio = board::display.pio == 1 ? pio1 : pio0;
173
+ gPanel.sm = static_cast<uint>(board::display.stateMachine);
174
+ pio_set_gpio_base(gPanel.pio, board::display.data0 + 8 >= 32 ? 16 : 0);
175
+
176
+ pio_gpio_init(gPanel.pio, board::display.wr);
177
+ for (int pin = 0; pin < 8; ++pin) {
178
+ pio_gpio_init(gPanel.pio, board::display.data0 + pin);
179
+ }
180
+
181
+ pio_sm_claim(gPanel.pio, gPanel.sm);
182
+ gPanel.offset = pio_add_program(gPanel.pio, &st7789_parallel_program);
183
+
184
+ pio_sm_config config = st7789_parallel_program_get_default_config(gPanel.offset);
185
+ sm_config_set_out_pins(&config, board::display.data0, 8);
186
+ sm_config_set_sideset_pins(&config, board::display.wr);
187
+ sm_config_set_fifo_join(&config, PIO_FIFO_JOIN_TX);
188
+ sm_config_set_out_shift(&config, false, true, 8);
189
+ const std::uint32_t sysHz = clock_get_hz(clk_sys);
190
+ constexpr std::uint32_t maxPioHz = 44u * 1000u * 1000u;
191
+ float div = static_cast<float>(sysHz) / static_cast<float>(maxPioHz);
192
+ if (div < 1.0f) div = 1.0f;
193
+ sm_config_set_clkdiv(&config, div);
194
+
195
+ pio_sm_set_consecutive_pindirs(gPanel.pio, gPanel.sm, board::display.data0, 8, true);
196
+ pio_sm_set_consecutive_pindirs(gPanel.pio, gPanel.sm, board::display.wr, 1, true);
197
+ pio_sm_init(gPanel.pio, gPanel.sm, gPanel.offset, &config);
198
+ pio_sm_set_enabled(gPanel.pio, gPanel.sm, true);
199
+
200
+ gPanel.dma = dma_claim_unused_channel(true);
201
+ configureDma(true);
202
+ }
203
+
204
+ void initPins()
205
+ {
206
+ gpio_init(board::display.cs);
207
+ gpio_set_dir(board::display.cs, GPIO_OUT);
208
+ gpio_put(board::display.cs, 1);
209
+
210
+ gpio_init(board::display.dc);
211
+ gpio_set_dir(board::display.dc, GPIO_OUT);
212
+ gpio_put(board::display.dc, 1);
213
+
214
+ gpio_init(board::display.rd);
215
+ gpio_set_dir(board::display.rd, GPIO_OUT);
216
+ gpio_put(board::display.rd, 1);
217
+
218
+ if (board::display.vsync >= 0) {
219
+ gpio_init(board::display.vsync);
220
+ gpio_set_dir(board::display.vsync, GPIO_IN);
221
+ }
222
+
223
+ pwm_config config = pwm_get_default_config();
224
+ const uint slice = pwm_gpio_to_slice_num(board::display.backlight);
225
+ pwm_set_wrap(slice, 65535);
226
+ pwm_init(slice, &config, true);
227
+ gpio_set_function(board::display.backlight, GPIO_FUNC_PWM);
228
+ panelSetBrightness(0);
229
+ }
230
+
231
+ void initRegisters()
232
+ {
233
+ command(Reg::SwReset);
234
+ sleep_ms(150);
235
+
236
+ commandBytes(Reg::ColMod, "\x05", 1);
237
+ commandBytes(Reg::PorCtrl, "\x0c\x0c\x00\x33\x33", 5);
238
+ commandBytes(Reg::LcmCtrl, "\x2c", 1);
239
+ commandBytes(Reg::VdvVrhEn, "\x01", 1);
240
+ commandBytes(Reg::Vrhs, "\x0f", 1);
241
+ commandBytes(Reg::Vdvs, "\x20", 1);
242
+ commandBytes(Reg::PowerCtrl1, "\xa4\xa1", 2);
243
+ commandBytes(Reg::FrameCtrl2, "\x0f", 1);
244
+ commandBytes(Reg::RamCtrl, "\x00\xc0", 2);
245
+ commandBytes(Reg::GCtrl, "\x35", 1);
246
+ commandBytes(Reg::VComS, "\x1b", 1);
247
+ commandBytes(Reg::GammaPositive, "\xf0\x00\x06\x04\x05\x05\x31\x44\x48\x36\x12\x12\x2b\x34", 14);
248
+ commandBytes(Reg::GammaNegative, "\xf0\x0b\x0f\x0f\x0d\x26\x31\x43\x47\x38\x14\x14\x2c\x32", 14);
249
+ command(Reg::InvOn);
250
+ command(Reg::SleepOut);
251
+ sleep_ms(100);
252
+
253
+ constexpr std::uint8_t kMadctlNativeLandscape180 = 0x80 | 0x20 | 0x10;
254
+ command(Reg::MadCtl, &kMadctlNativeLandscape180, 1);
255
+
256
+ panelClear(0x0000);
257
+ command(Reg::DisplayOn);
258
+ panelSetBrightness(100);
259
+ }
260
+
261
+ int clipped(int value, int min, int max)
262
+ {
263
+ return std::max(min, std::min(max, value));
264
+ }
265
+
266
+ void flushPreparedLine(std::uint16_t *line, int count)
267
+ {
268
+ startDma(reinterpret_cast<const std::uint8_t *>(line), static_cast<std::size_t>(count) * sizeof(std::uint16_t));
269
+ }
270
+
271
+ int nativeStart(int logical)
272
+ {
273
+ return logical * kPanelScale;
274
+ }
275
+
276
+ int nativeEndInclusive(int logical)
277
+ {
278
+ return (logical + 1) * kPanelScale - 1;
279
+ }
280
+
281
+ int expandRowFromFramebuffer(std::uint16_t *out,
282
+ const std::uint16_t *pixels,
283
+ int stridePixels,
284
+ int y,
285
+ int x0,
286
+ int x1)
287
+ {
288
+ int count = 0;
289
+ for (int x = x0; x <= x1; ++x) {
290
+ const std::uint16_t color = pixels[static_cast<std::size_t>(y) * stridePixels + x];
291
+ for (int repeat = 0; repeat < kPanelScale; ++repeat) {
292
+ out[count++] = color;
293
+ }
294
+ }
295
+ return count;
296
+ }
297
+
298
+ int expandRowFromRaster(std::uint16_t *out, const std::uint16_t *source, int width)
299
+ {
300
+ int count = 0;
301
+ for (int x = 0; x < width; ++x) {
302
+ const std::uint16_t color = source[x];
303
+ for (int repeat = 0; repeat < kPanelScale; ++repeat) {
304
+ out[count++] = color;
305
+ }
306
+ }
307
+ return count;
308
+ }
309
+
310
+ } // namespace
311
+
312
+ bool panelInit()
313
+ {
314
+ if (gPanel.ready) return true;
315
+ initPins();
316
+ initParallelBus();
317
+ gPanel.ready = true;
318
+ initRegisters();
319
+ return true;
320
+ }
321
+
322
+ void panelSetBrightness(int percent)
323
+ {
324
+ percent = std::clamp(percent, 0, 100);
325
+ const std::uint32_t p = static_cast<std::uint32_t>(percent);
326
+ const std::uint16_t level = static_cast<std::uint16_t>((p * p * 65535u) / 10000u);
327
+ pwm_set_gpio_level(board::display.backlight, level);
328
+ }
329
+
330
+ void panelSetFlushConfig(int rows, int depth)
331
+ {
332
+ if (rows > 0) gPanel.flushRows = std::min(rows, kPanelHeight);
333
+ if (depth > 0) gPanel.flushDepth = std::max(1, depth);
334
+ }
335
+
336
+ void panelFlushRect(const std::uint16_t *pixels, int stridePixels, int x0, int y0, int x1, int y1)
337
+ {
338
+ if (!panelInit() || !pixels || stridePixels <= 0) return;
339
+ x0 = clipped(x0, 0, kPanelWidth - 1);
340
+ y0 = clipped(y0, 0, kPanelHeight - 1);
341
+ x1 = clipped(x1, x0, kPanelWidth - 1);
342
+ y1 = clipped(y1, y0, kPanelHeight - 1);
343
+
344
+ const std::uint64_t startUs = time_us_64();
345
+ gFlushStats.callCount++;
346
+ const int nativeX0 = nativeStart(x0);
347
+ const int nativeY0 = nativeStart(y0);
348
+ const int nativeX1 = nativeEndInclusive(x1);
349
+ const int nativeY1 = nativeEndInclusive(y1);
350
+ gFlushStats.pixelCount += (nativeX1 - nativeX0 + 1) * (nativeY1 - nativeY0 + 1);
351
+ beginPixels(nativeX0, nativeY0, nativeX1, nativeY1);
352
+ std::uint16_t *current = gLineA;
353
+ std::uint16_t *next = gLineB;
354
+ for (int y = y0; y <= y1; ++y) {
355
+ const std::uint64_t copyStartUs = time_us_64();
356
+ const int preparedWidth = expandRowFromFramebuffer(current, pixels, stridePixels, y, x0, x1);
357
+ gFlushStats.copyUs += static_cast<std::int64_t>(time_us_64() - copyStartUs);
358
+ for (int repeat = 0; repeat < kPanelScale; ++repeat) {
359
+ waitDma();
360
+ flushPreparedLine(current, preparedWidth);
361
+ }
362
+ std::swap(current, next);
363
+ }
364
+ endPixels();
365
+ gFlushStats.totalUs += static_cast<std::int64_t>(time_us_64() - startUs);
366
+ }
367
+
368
+ void panelStreamRect(int x0, int y0, int x1, int y1, PanelStreamRasterFn raster, void *user)
369
+ {
370
+ if (!panelInit() || !raster) return;
371
+ x0 = clipped(x0, 0, kPanelWidth - 1);
372
+ y0 = clipped(y0, 0, kPanelHeight - 1);
373
+ x1 = clipped(x1, x0, kPanelWidth - 1);
374
+ y1 = clipped(y1, y0, kPanelHeight - 1);
375
+
376
+ const std::uint64_t startUs = time_us_64();
377
+ gFlushStats.callCount++;
378
+ const int nativeX0 = nativeStart(x0);
379
+ const int nativeY0 = nativeStart(y0);
380
+ const int nativeX1 = nativeEndInclusive(x1);
381
+ const int nativeY1 = nativeEndInclusive(y1);
382
+ gFlushStats.pixelCount += (nativeX1 - nativeX0 + 1) * (nativeY1 - nativeY0 + 1);
383
+ beginPixels(nativeX0, nativeY0, nativeX1, nativeY1);
384
+ std::uint16_t *current = gLineA;
385
+ std::uint16_t *next = gLineB;
386
+ const int width = x1 - x0 + 1;
387
+ for (int y = y0; y <= y1; ++y) {
388
+ const std::uint64_t copyStartUs = time_us_64();
389
+ raster(gRasterLine, width, 1, x0, y, user);
390
+ const int preparedWidth = expandRowFromRaster(current, gRasterLine, width);
391
+ gFlushStats.copyUs += static_cast<std::int64_t>(time_us_64() - copyStartUs);
392
+ for (int repeat = 0; repeat < kPanelScale; ++repeat) {
393
+ waitDma();
394
+ flushPreparedLine(current, preparedWidth);
395
+ }
396
+ std::swap(current, next);
397
+ }
398
+ endPixels();
399
+ gFlushStats.totalUs += static_cast<std::int64_t>(time_us_64() - startUs);
400
+ }
401
+
402
+ void panelClear(std::uint16_t color)
403
+ {
404
+ if (!gPanel.ready) return;
405
+ for (std::uint16_t &pixel : gLineA) pixel = color;
406
+ const std::uint64_t startUs = time_us_64();
407
+ gFlushStats.callCount++;
408
+ gFlushStats.pixelCount += kNativePanelWidth * kNativePanelHeight;
409
+ beginPixels(0, 0, kNativePanelWidth - 1, kNativePanelHeight - 1);
410
+ for (int y = 0; y < kNativePanelHeight; ++y) {
411
+ waitDma();
412
+ flushPreparedLine(gLineA, kNativePanelWidth);
413
+ }
414
+ endPixels();
415
+ gFlushStats.totalUs += static_cast<std::int64_t>(time_us_64() - startUs);
416
+ }
417
+
418
+ PanelFlushStats panelFlushStatsRead()
419
+ {
420
+ return gFlushStats;
421
+ }
422
+
423
+ void panelFlushStatsReset()
424
+ {
425
+ gFlushStats = {};
426
+ }
427
+
428
+ } // namespace gea::rp2350
@@ -0,0 +1,46 @@
1
+ #pragma once
2
+
3
+ #include <cstdint>
4
+
5
+ #ifndef GEA_RP2350_PANEL_SCALE
6
+ #define GEA_RP2350_PANEL_SCALE 1
7
+ #endif
8
+
9
+ namespace gea::rp2350 {
10
+
11
+ inline constexpr int kNativePanelWidth = 320;
12
+ inline constexpr int kNativePanelHeight = 240;
13
+ inline constexpr int kPanelScale = GEA_RP2350_PANEL_SCALE;
14
+ static_assert(kPanelScale >= 1, "GEA_RP2350_PANEL_SCALE must be at least 1");
15
+ static_assert(kNativePanelWidth % kPanelScale == 0, "panel scale must divide native width");
16
+ static_assert(kNativePanelHeight % kPanelScale == 0, "panel scale must divide native height");
17
+ inline constexpr int kPanelWidth = kNativePanelWidth / kPanelScale;
18
+ inline constexpr int kPanelHeight = kNativePanelHeight / kPanelScale;
19
+
20
+ struct PanelFlushStats {
21
+ std::int64_t totalUs = 0;
22
+ std::int64_t setWindowUs = 0;
23
+ std::int64_t copyUs = 0;
24
+ std::int64_t txWaitUs = 0;
25
+ int callCount = 0;
26
+ int chunkCount = 0;
27
+ int pixelCount = 0;
28
+ };
29
+
30
+ using PanelStreamRasterFn = void (*)(std::uint16_t *pixels,
31
+ int width,
32
+ int height,
33
+ int originX,
34
+ int originY,
35
+ void *user);
36
+
37
+ bool panelInit();
38
+ void panelSetBrightness(int percent);
39
+ void panelSetFlushConfig(int rows, int depth);
40
+ void panelFlushRect(const std::uint16_t *pixels, int stridePixels, int x0, int y0, int x1, int y1);
41
+ void panelStreamRect(int x0, int y0, int x1, int y1, PanelStreamRasterFn raster, void *user);
42
+ void panelClear(std::uint16_t color);
43
+ PanelFlushStats panelFlushStatsRead();
44
+ void panelFlushStatsReset();
45
+
46
+ } // namespace gea::rp2350
@@ -0,0 +1,7 @@
1
+ .program st7789_parallel
2
+ .side_set 1
3
+
4
+ .wrap_target
5
+ out pins, 8 side 0
6
+ nop side 1
7
+ .wrap