@geastack/targets 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +83 -0
- package/package.json +50 -0
- package/targets/cmake/geatsc-generated-archive-build.mjs +614 -0
- package/targets/cmake/geatsc_generated_archive.cmake +116 -0
- package/targets/cmake/geatsc_generated_archive_build.cmake +50 -0
- package/targets/esp32/app_project.cmake +33 -0
- package/targets/esp32/apps/app_manager.cpp +188 -0
- package/targets/esp32/apps/app_manager.h +10 -0
- package/targets/esp32/chip_bindings/README.md +58 -0
- package/targets/esp32/chip_bindings/audio/es8311.cpp +556 -0
- package/targets/esp32/chip_bindings/displays/co5300.cpp +510 -0
- package/targets/esp32/chip_bindings/displays/co5300.h +47 -0
- package/targets/esp32/chip_bindings/displays/co5300_async_stream.inc +79 -0
- package/targets/esp32/chip_bindings/displays/qspi_panel.h +65 -0
- package/targets/esp32/chip_bindings/displays/sh8601.cpp +583 -0
- package/targets/esp32/chip_bindings/displays/sh8601.h +36 -0
- package/targets/esp32/chip_bindings/gps/lc76g.cpp +296 -0
- package/targets/esp32/chip_bindings/gps/lc76g.h +7 -0
- package/targets/esp32/chip_bindings/imu/bmi270.cpp +299 -0
- package/targets/esp32/chip_bindings/imu/bmi270_config.inl +439 -0
- package/targets/esp32/chip_bindings/imu/qmi8658.cpp +213 -0
- package/targets/esp32/chip_bindings/power/axp2101.cpp +185 -0
- package/targets/esp32/chip_bindings/touch/cst9217.cpp +229 -0
- package/targets/esp32/chip_bindings/touch/cst9217_controller.h +78 -0
- package/targets/esp32/chip_bindings/touch/ft3168.cpp +340 -0
- package/targets/esp32/chip_bindings/touch/ft3168_controller.h +103 -0
- package/targets/esp32/chip_bindings/touch/ft6336.cpp +310 -0
- package/targets/esp32/chip_bindings/touch/ft6336_controller.h +90 -0
- package/targets/esp32/components/gea_framework/CMakeLists.txt +62 -0
- package/targets/esp32/connectivity/ble_hid.cpp +2916 -0
- package/targets/esp32/connectivity/ble_hid.h +8 -0
- package/targets/esp32/connectivity/diagnostics_transport.cpp +523 -0
- package/targets/esp32/connectivity/diagnostics_transport_offline.cpp +108 -0
- package/targets/esp32/connectivity/wifi.cpp +615 -0
- package/targets/esp32/connectivity/wifi_debug_offline.cpp +37 -0
- package/targets/esp32/connectivity/wifi_task_stack.h +119 -0
- package/targets/esp32/display.cpp +6010 -0
- package/targets/esp32/display_headless.cpp +468 -0
- package/targets/esp32/gea/platform_random.h +11 -0
- package/targets/esp32/gea_framework.cmake +382 -0
- package/targets/esp32/gpio.cpp +229 -0
- package/targets/esp32/host_sources.cmake +35 -0
- package/targets/esp32/imu_absent.cpp +36 -0
- package/targets/esp32/ldfragments/gea_ui_state_external.lf +35 -0
- package/targets/esp32/memory_config.h +64 -0
- package/targets/esp32/power_absent.cpp +22 -0
- package/targets/esp32/sdk-patches/0001-esp_ptr_dma_capable-accept-PSRAM.patch +70 -0
- package/targets/esp32/sdk-patches/0002-gdma-access_ext_mem-spi_master.patch +59 -0
- package/targets/esp32/sdk-patches/README.md +127 -0
- package/targets/esp32/services/app_runner.cpp +248 -0
- package/targets/esp32/services/app_state.cpp +56 -0
- package/targets/esp32/services/audio_runtime_stub.cpp +86 -0
- package/targets/esp32/services/battery_service.cpp +31 -0
- package/targets/esp32/services/device_control.cpp +1896 -0
- package/targets/esp32/services/device_control.h +31 -0
- package/targets/esp32/services/frame_scheduler.cpp +1571 -0
- package/targets/esp32/services/heap.cpp +129 -0
- package/targets/esp32/services/memory.cpp +103 -0
- package/targets/esp32/services/ota.cpp +840 -0
- package/targets/esp32/services/ota_image.cpp +162 -0
- package/targets/esp32/services/ota_image.h +16 -0
- package/targets/esp32/services/storage_service.cpp +159 -0
- package/targets/esp32/touch_absent.cpp +44 -0
- package/targets/esp32-m5stack-m5paper/CMakeLists.txt +10 -0
- package/targets/esp32-m5stack-m5paper/README.md +55 -0
- package/targets/esp32-m5stack-m5paper/dependencies.lock +76 -0
- package/targets/esp32-m5stack-m5paper/main/CMakeLists.txt +46 -0
- package/targets/esp32-m5stack-m5paper/main/Kconfig.projbuild +10 -0
- package/targets/esp32-m5stack-m5paper/main/app_main.cpp +114 -0
- package/targets/esp32-m5stack-m5paper/main/audio_stub.cpp +27 -0
- package/targets/esp32-m5stack-m5paper/main/buttons.cpp +111 -0
- package/targets/esp32-m5stack-m5paper/main/display.cpp +1074 -0
- package/targets/esp32-m5stack-m5paper/main/i2c.cpp +36 -0
- package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -0
- package/targets/esp32-m5stack-m5paper/main/imu_stub.cpp +20 -0
- package/targets/esp32-m5stack-m5paper/main/include/board.h +100 -0
- package/targets/esp32-m5stack-m5paper/main/include/buttons.h +8 -0
- package/targets/esp32-m5stack-m5paper/main/launcher_button.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/m5paper_psram.lf +20 -0
- package/targets/esp32-m5stack-m5paper/main/power.cpp +73 -0
- package/targets/esp32-m5stack-m5paper/main/sdcard_mount.cpp +82 -0
- package/targets/esp32-m5stack-m5paper/main/touch.cpp +279 -0
- package/targets/esp32-m5stack-m5paper/partitions.csv +9 -0
- package/targets/esp32-m5stack-m5paper/sdkconfig.defaults +84 -0
- package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +10 -0
- package/targets/esp32-p4-m5stack-tab5/dependencies.lock +276 -0
- package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +586 -0
- package/targets/esp32-p4-m5stack-tab5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-m5stack-tab5/main/app_main.cpp +177 -0
- package/targets/esp32-p4-m5stack-tab5/main/camera.cpp +2025 -0
- package/targets/esp32-p4-m5stack-tab5/main/display.cpp +4033 -0
- package/targets/esp32-p4-m5stack-tab5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-m5stack-tab5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +21 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/board.h +130 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/tab5_drivers.h +68 -0
- package/targets/esp32-p4-m5stack-tab5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-m5stack-tab5/main/launcher_button.cpp +188 -0
- package/targets/esp32-p4-m5stack-tab5/main/power.cpp +22 -0
- package/targets/esp32-p4-m5stack-tab5/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_audio.cpp +345 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_drivers.cpp +871 -0
- package/targets/esp32-p4-m5stack-tab5/main/tab5_imu.cpp +246 -0
- package/targets/esp32-p4-m5stack-tab5/main/touch.cpp +206 -0
- package/targets/esp32-p4-m5stack-tab5/partitions.csv +12 -0
- package/targets/esp32-p4-m5stack-tab5/sdkconfig.defaults +128 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +19 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/0001-esp_video-csi-raw-passthrough-p4-rev-lt-v3.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/README.md +45 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/apply.sh +37 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/dependencies.lock +196 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +562 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/app_main.cpp +166 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/camera.cpp +2105 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +1730 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +11 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/board.h +87 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/panel_native.h +59 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/touch.cpp +306 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/partitions.csv +13 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/README.md +22 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/espressif__esp_video-csi-bypass.patch +28 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/sdkconfig.defaults +109 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/capture-camera.py +369 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +10 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/dependencies.lock +258 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +577 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/Kconfig.projbuild +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/app_main.cpp +177 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/camera.cpp +1935 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +2832 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/fatfs_ffconf.h +383 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/i2c.cpp +39 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +23 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/board.h +68 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/launcher_button.cpp +191 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/power.cpp +15 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/sdcard_mount.cpp +125 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/touch.cpp +332 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/partitions.csv +12 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/sdkconfig.defaults +122 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/README-camera-capture.md +84 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py +369 -0
- package/targets/esp32-s3-devkit-n16r8.json +31 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +10 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/dependencies.lock +40 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +549 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +187 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +1338 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/i2c.cpp +39 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/board.h +142 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/pcf8574.h +16 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/include/rotary_encoder.h +7 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/pcf8574.cpp +86 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/platform_stubs.cpp +47 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/rotary_encoder.cpp +135 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/touch.cpp +250 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/partitions.csv +8 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/sdkconfig.defaults +116 -0
- package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +10 -0
- package/targets/esp32-s3-epaper-1.54/dependencies.lock +76 -0
- package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +691 -0
- package/targets/esp32-s3-epaper-1.54/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-epaper-1.54/main/app_main.cpp +181 -0
- package/targets/esp32-s3-epaper-1.54/main/buttons.cpp +144 -0
- package/targets/esp32-s3-epaper-1.54/main/display.cpp +1281 -0
- package/targets/esp32-s3-epaper-1.54/main/fatfs_ffconf.h +377 -0
- package/targets/esp32-s3-epaper-1.54/main/i2c.cpp +39 -0
- package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -0
- package/targets/esp32-s3-epaper-1.54/main/imu_stub.cpp +21 -0
- package/targets/esp32-s3-epaper-1.54/main/include/board.h +119 -0
- package/targets/esp32-s3-epaper-1.54/main/include/buttons.h +9 -0
- package/targets/esp32-s3-epaper-1.54/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-epaper-1.54/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-epaper-1.54/main/power.cpp +15 -0
- package/targets/esp32-s3-epaper-1.54/main/sdcard_mount.cpp +89 -0
- package/targets/esp32-s3-epaper-1.54/main/touch.cpp +299 -0
- package/targets/esp32-s3-epaper-1.54/partitions.csv +8 -0
- package/targets/esp32-s3-epaper-1.54/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +10 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/README.md +29 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/dependencies.lock +116 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +90 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/include/board.h +61 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/touch.cpp +299 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/partitions.csv +7 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/sdkconfig.defaults +50 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +12 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/CMakeLists.txt +17 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.c +269 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.h +142 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.c +1114 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.h +410 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/gea_epd.c +989 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.c +489 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.h +104 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.c +136 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.h +78 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/utilities.h +49 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/dependencies.lock +35 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/CMakeLists.txt +30 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/app_main.cpp +95 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/buttons.cpp +40 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/display.cpp +627 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/i2c.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/imu_stub.cpp +20 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/board.h +85 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/buttons.h +8 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/launcher_button.cpp +82 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/power.cpp +36 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/sdcard_mount.cpp +90 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/touch.cpp +293 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/partitions.csv +9 -0
- package/targets/esp32-s3-lilygo-t5-epaper-4.7/sdkconfig.defaults +217 -0
- package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +13 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/CMakeLists.txt +5 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/include/papers3_epd.h +74 -0
- package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/papers3_epd.c +671 -0
- package/targets/esp32-s3-m5stack-papers3/dependencies.lock +76 -0
- package/targets/esp32-s3-m5stack-papers3/main/CMakeLists.txt +64 -0
- package/targets/esp32-s3-m5stack-papers3/main/Kconfig.projbuild +10 -0
- package/targets/esp32-s3-m5stack-papers3/main/app_main.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/audio_stub.cpp +27 -0
- package/targets/esp32-s3-m5stack-papers3/main/buttons.cpp +49 -0
- package/targets/esp32-s3-m5stack-papers3/main/display.cpp +706 -0
- package/targets/esp32-s3-m5stack-papers3/main/i2c.cpp +36 -0
- package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +14 -0
- package/targets/esp32-s3-m5stack-papers3/main/imu.cpp +351 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/board.h +101 -0
- package/targets/esp32-s3-m5stack-papers3/main/include/buttons.h +8 -0
- package/targets/esp32-s3-m5stack-papers3/main/launcher_button.cpp +96 -0
- package/targets/esp32-s3-m5stack-papers3/main/power.cpp +102 -0
- package/targets/esp32-s3-m5stack-papers3/main/sdcard_mount.cpp +88 -0
- package/targets/esp32-s3-m5stack-papers3/main/touch.cpp +287 -0
- package/targets/esp32-s3-m5stack-papers3/partitions.csv +9 -0
- package/targets/esp32-s3-m5stack-papers3/sdkconfig.defaults +232 -0
- package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +10 -0
- package/targets/esp32-s3-m5stack-sticks3/dependencies.lock +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +51 -0
- package/targets/esp32-s3-m5stack-sticks3/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-m5stack-sticks3/main/app_main.cpp +130 -0
- package/targets/esp32-s3-m5stack-sticks3/main/buttons.cpp +101 -0
- package/targets/esp32-s3-m5stack-sticks3/main/display.cpp +1391 -0
- package/targets/esp32-s3-m5stack-sticks3/main/i2c.cpp +39 -0
- package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/imu_stub.cpp +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/board.h +89 -0
- package/targets/esp32-s3-m5stack-sticks3/main/include/buttons.h +9 -0
- package/targets/esp32-s3-m5stack-sticks3/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-m5stack-sticks3/main/power.cpp +15 -0
- package/targets/esp32-s3-m5stack-sticks3/main/sdcard_mount.cpp +8 -0
- package/targets/esp32-s3-m5stack-sticks3/main/touch.cpp +65 -0
- package/targets/esp32-s3-m5stack-sticks3/partitions.csv +8 -0
- package/targets/esp32-s3-m5stack-sticks3/sdkconfig.defaults +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.75/dependencies.lock +130 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +589 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/app_main.cpp +153 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +9 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/board.h +110 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/touch.cpp +45 -0
- package/targets/esp32-s3-touch-amoled-1.75/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.75/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +105 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +768 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +172 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +83 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +191 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/touch.cpp +41 -0
- package/targets/esp32-s3-touch-amoled-1.8/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +179 -0
- package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +64 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +1121 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +333 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/i2c.cpp +39 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +114 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +199 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/sdcard_mount.cpp +105 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.06/partitions.csv +14 -0
- package/targets/esp32-s3-touch-amoled-2.06/sdkconfig.defaults +273 -0
- package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +10 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/CMakeLists.txt +71 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/Kconfig.projbuild +12 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +27 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/board.h +108 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/include/wifi_config.h.example +5 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/panel_reset.cpp +82 -0
- package/targets/esp32-s3-touch-amoled-2.41/main/touch.cpp +49 -0
- package/targets/esp32-s3-touch-amoled-2.41/partitions.csv +8 -0
- package/targets/esp32-s3-touch-amoled-2.41/sdkconfig.defaults +273 -0
- package/targets/rp2350-tufty-2350/CMakeLists.txt +348 -0
- package/targets/rp2350-tufty-2350/README.md +53 -0
- package/targets/rp2350-tufty-2350/boards/pimoroni_tufty2350.h +87 -0
- package/targets/rp2350-tufty-2350/main/bringup.cpp +187 -0
- package/targets/rp2350-tufty-2350/main/include/board.h +124 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.cpp +428 -0
- package/targets/rp2350-tufty-2350/main/rp2350_panel.h +46 -0
- package/targets/rp2350-tufty-2350/main/st7789_parallel.pio +7 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +345 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/README.md +153 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/boards/waveshare_rp2350_touch_amoled_2_41.h +59 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/app.cpp +984 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/bringup.cpp +222 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/include/board.h +138 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +2553 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.h +18 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_host_fetch_stub.cpp +64 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.cpp +677 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.h +48 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.c +354 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.h +56 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.c +1284 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.h +95 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_block_functions.h +123 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_common.h +127 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-bench.py +162 -0
- package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-parity.py +198 -0
- package/targets.json +154 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
#include "chip_bindings/displays/co5300.h"
|
|
2
|
+
|
|
3
|
+
#include "displays/co5300/co5300.h"
|
|
4
|
+
|
|
5
|
+
#include <cstddef>
|
|
6
|
+
#include <cstdint>
|
|
7
|
+
#include <cstring>
|
|
8
|
+
|
|
9
|
+
#include "driver/spi_master.h"
|
|
10
|
+
#include "esp_check.h"
|
|
11
|
+
#include "esp_err.h"
|
|
12
|
+
// IDF 6.0 no longer pulls FreeRTOS transitively through the esp_lcd/spi headers,
|
|
13
|
+
// so portMAX_DELAY (used in the SPI transaction calls below) needs an explicit
|
|
14
|
+
// include.
|
|
15
|
+
#include "freertos/FreeRTOS.h"
|
|
16
|
+
#include "esp_lcd_co5300.h"
|
|
17
|
+
#include "esp_lcd_panel_io_interface.h"
|
|
18
|
+
#include "esp_lcd_panel_commands.h"
|
|
19
|
+
#include "esp_lcd_panel_io.h"
|
|
20
|
+
#include "esp_lcd_panel_ops.h"
|
|
21
|
+
#include "esp_log.h"
|
|
22
|
+
#include "esp_memory_utils.h"
|
|
23
|
+
|
|
24
|
+
#ifndef GEA_EMBEDDED_CO5300_SPI_MANUAL_DMA_ALIGN_FLAG
|
|
25
|
+
#define GEA_EMBEDDED_CO5300_SPI_MANUAL_DMA_ALIGN_FLAG 0
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#ifndef GEA_EMBEDDED_CO5300_SPI_DMA_ALIGN_BYTES
|
|
29
|
+
#define GEA_EMBEDDED_CO5300_SPI_DMA_ALIGN_BYTES 64
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
namespace gea::platform::esp32::chip_bindings::co5300
|
|
33
|
+
{
|
|
34
|
+
|
|
35
|
+
namespace
|
|
36
|
+
{
|
|
37
|
+
|
|
38
|
+
constexpr const char *kTag = "co5300";
|
|
39
|
+
|
|
40
|
+
#if GEA_EMBEDDED_CO5300_WAVESHARE_175_INIT
|
|
41
|
+
static const std::uint8_t kCmdFe20[] = {0x20};
|
|
42
|
+
static const std::uint8_t kCmd19[] = {0x10};
|
|
43
|
+
static const std::uint8_t kCmd1c[] = {0xA0};
|
|
44
|
+
static const std::uint8_t kCmdFe00[] = {0x00};
|
|
45
|
+
static const std::uint8_t kCmdC4[] = {0x80};
|
|
46
|
+
static const std::uint8_t kCmd3a[] = {0x55};
|
|
47
|
+
static const std::uint8_t kCmd35[] = {0x00};
|
|
48
|
+
static const std::uint8_t kCmd53[] = {0x20};
|
|
49
|
+
static const std::uint8_t kCmd51[] = {0xFF};
|
|
50
|
+
static const std::uint8_t kCmd63[] = {0xFF};
|
|
51
|
+
static const std::uint8_t kCmd2a[] = {0x00, 0x06, 0x01, 0xD7};
|
|
52
|
+
static const std::uint8_t kCmd2b[] = {0x00, 0x00, 0x01, 0xD1};
|
|
53
|
+
|
|
54
|
+
static const co5300_lcd_init_cmd_t kWaveshare175InitCommands[] = {
|
|
55
|
+
{0xFE, kCmdFe20, sizeof(kCmdFe20), 0},
|
|
56
|
+
{0x19, kCmd19, sizeof(kCmd19), 0},
|
|
57
|
+
{0x1C, kCmd1c, sizeof(kCmd1c), 0},
|
|
58
|
+
{0xFE, kCmdFe00, sizeof(kCmdFe00), 0},
|
|
59
|
+
{0xC4, kCmdC4, sizeof(kCmdC4), 0},
|
|
60
|
+
{0x3A, kCmd3a, sizeof(kCmd3a), 0},
|
|
61
|
+
{0x35, kCmd35, sizeof(kCmd35), 0},
|
|
62
|
+
{0x53, kCmd53, sizeof(kCmd53), 0},
|
|
63
|
+
{0x51, kCmd51, sizeof(kCmd51), 0},
|
|
64
|
+
{0x63, kCmd63, sizeof(kCmd63), 0},
|
|
65
|
+
{0x2A, kCmd2a, sizeof(kCmd2a), 0},
|
|
66
|
+
{0x2B, kCmd2b, sizeof(kCmd2b), 600},
|
|
67
|
+
{0x11, nullptr, 0, 600},
|
|
68
|
+
{0x29, nullptr, 0, 0},
|
|
69
|
+
};
|
|
70
|
+
#endif
|
|
71
|
+
|
|
72
|
+
esp_lcd_panel_handle_t panelHandle(void *panel)
|
|
73
|
+
{
|
|
74
|
+
return static_cast<esp_lcd_panel_handle_t>(panel);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
esp_lcd_panel_io_handle_t panelIoHandle(void *panelIo)
|
|
78
|
+
{
|
|
79
|
+
return static_cast<esp_lcd_panel_io_handle_t>(panelIo);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
struct LcdSpiTransDescriptor
|
|
83
|
+
{
|
|
84
|
+
spi_transaction_t base;
|
|
85
|
+
struct
|
|
86
|
+
{
|
|
87
|
+
unsigned int dc_gpio_level : 1;
|
|
88
|
+
unsigned int en_trans_done_cb : 1;
|
|
89
|
+
} flags;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
struct EspLcdPanelIoSpiPrivate
|
|
93
|
+
{
|
|
94
|
+
esp_lcd_panel_io_t base;
|
|
95
|
+
spi_device_handle_t spiDev;
|
|
96
|
+
std::size_t spiTransMaxBytes;
|
|
97
|
+
int dcGpioNum;
|
|
98
|
+
esp_lcd_panel_io_color_trans_done_cb_t onColorTransDone;
|
|
99
|
+
void *userCtx;
|
|
100
|
+
std::size_t queueSize;
|
|
101
|
+
std::size_t numTransInflight;
|
|
102
|
+
int lcdCmdBits;
|
|
103
|
+
int lcdParamBits;
|
|
104
|
+
std::uint8_t csEnaPretrans;
|
|
105
|
+
std::uint8_t csEnaPosttrans;
|
|
106
|
+
struct
|
|
107
|
+
{
|
|
108
|
+
unsigned int dcCmdLevel : 1;
|
|
109
|
+
unsigned int dcDataLevel : 1;
|
|
110
|
+
unsigned int dcParamLevel : 1;
|
|
111
|
+
unsigned int octalMode : 1;
|
|
112
|
+
unsigned int quadMode : 1;
|
|
113
|
+
} flags;
|
|
114
|
+
LcdSpiTransDescriptor transPool[1];
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
static_assert(offsetof(LcdSpiTransDescriptor, base) == 0,
|
|
118
|
+
"LCD SPI transaction descriptor must begin with spi_transaction_t");
|
|
119
|
+
static_assert(offsetof(EspLcdPanelIoSpiPrivate, base) == 0,
|
|
120
|
+
"ESP LCD SPI private IO must begin with esp_lcd_panel_io_t");
|
|
121
|
+
|
|
122
|
+
EspLcdPanelIoSpiPrivate *spiPanelIo(void *panelIo)
|
|
123
|
+
{
|
|
124
|
+
return reinterpret_cast<EspLcdPanelIoSpiPrivate *>(panelIoHandle(panelIo));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
LcdSpiTransDescriptor *transDescriptorAt(EspLcdPanelIoSpiPrivate *io, std::size_t index)
|
|
128
|
+
{
|
|
129
|
+
auto *pool = reinterpret_cast<LcdSpiTransDescriptor *>(
|
|
130
|
+
reinterpret_cast<std::uint8_t *>(io) + offsetof(EspLcdPanelIoSpiPrivate, transPool));
|
|
131
|
+
return &pool[index];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
void prepareCommandBuffer(int &command, int commandBits)
|
|
135
|
+
{
|
|
136
|
+
if (commandBits <= 8)
|
|
137
|
+
return;
|
|
138
|
+
auto *bytes = reinterpret_cast<std::uint8_t *>(&command);
|
|
139
|
+
const int byteCount = commandBits / 8;
|
|
140
|
+
for (int left = 0, right = byteCount - 1; left < right; left++, right--)
|
|
141
|
+
{
|
|
142
|
+
const std::uint8_t tmp = bytes[left];
|
|
143
|
+
bytes[left] = bytes[right];
|
|
144
|
+
bytes[right] = tmp;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
esp_err_t drainInflight(EspLcdPanelIoSpiPrivate *io)
|
|
149
|
+
{
|
|
150
|
+
spi_transaction_t *spiTrans = nullptr;
|
|
151
|
+
const std::size_t inflight = io->numTransInflight;
|
|
152
|
+
for (std::size_t i = 0; i < inflight; i++)
|
|
153
|
+
{
|
|
154
|
+
const esp_err_t ret = spi_device_get_trans_result(io->spiDev, &spiTrans, portMAX_DELAY);
|
|
155
|
+
if (ret != ESP_OK)
|
|
156
|
+
return ret;
|
|
157
|
+
io->numTransInflight--;
|
|
158
|
+
}
|
|
159
|
+
return ESP_OK;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
LcdSpiTransDescriptor *nextQueuedDescriptor(EspLcdPanelIoSpiPrivate *io, esp_err_t &ret)
|
|
163
|
+
{
|
|
164
|
+
if (io->numTransInflight < io->queueSize)
|
|
165
|
+
{
|
|
166
|
+
ret = ESP_OK;
|
|
167
|
+
return transDescriptorAt(io, io->numTransInflight);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
spi_transaction_t *spiTrans = nullptr;
|
|
171
|
+
ret = spi_device_get_trans_result(io->spiDev, &spiTrans, portMAX_DELAY);
|
|
172
|
+
if (ret != ESP_OK)
|
|
173
|
+
return nullptr;
|
|
174
|
+
io->numTransInflight--;
|
|
175
|
+
return reinterpret_cast<LcdSpiTransDescriptor *>(spiTrans);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
} // namespace
|
|
179
|
+
|
|
180
|
+
Panel &Panel::instance()
|
|
181
|
+
{
|
|
182
|
+
static Panel panel;
|
|
183
|
+
return panel;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
bool Panel::initialized() const
|
|
187
|
+
{
|
|
188
|
+
return panel_ && panelIo_;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
esp_err_t Panel::init(const PanelConfig &config)
|
|
192
|
+
{
|
|
193
|
+
if (initialized())
|
|
194
|
+
return ESP_OK;
|
|
195
|
+
|
|
196
|
+
spi_bus_config_t busConfig = {};
|
|
197
|
+
busConfig.data0_io_num = config.pinData0;
|
|
198
|
+
busConfig.data1_io_num = config.pinData1;
|
|
199
|
+
busConfig.sclk_io_num = config.pinPclk;
|
|
200
|
+
busConfig.data2_io_num = config.pinData2;
|
|
201
|
+
busConfig.data3_io_num = config.pinData3;
|
|
202
|
+
busConfig.data4_io_num = -1;
|
|
203
|
+
busConfig.data5_io_num = -1;
|
|
204
|
+
busConfig.data6_io_num = -1;
|
|
205
|
+
busConfig.data7_io_num = -1;
|
|
206
|
+
busConfig.max_transfer_sz = config.maxTransferBytes;
|
|
207
|
+
|
|
208
|
+
const esp_err_t busErr = spi_bus_initialize(config.spiHost, &busConfig, SPI_DMA_CH_AUTO);
|
|
209
|
+
if (busErr != ESP_OK && busErr != ESP_ERR_INVALID_STATE)
|
|
210
|
+
{
|
|
211
|
+
ESP_LOGE(kTag, "SPI bus init failed: %s", esp_err_to_name(busErr));
|
|
212
|
+
return busErr;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
esp_lcd_panel_io_handle_t ioHandle = nullptr;
|
|
216
|
+
// Open-code CO5300_PANEL_IO_QSPI_CONFIG: under IDF 6.0 esp_lcd_panel_io_spi_config_t's
|
|
217
|
+
// cs_gpio_num/dc_gpio_num are gpio_num_t, but the component's macro hard-codes
|
|
218
|
+
// `.dc_gpio_num = -1` (an int literal) which is an invalid int->gpio_num_t
|
|
219
|
+
// conversion in C++. Build it by hand with GPIO_NUM_NC instead.
|
|
220
|
+
esp_lcd_panel_io_spi_config_t ioConfig = {};
|
|
221
|
+
ioConfig.cs_gpio_num = static_cast<gpio_num_t>(config.pinCs);
|
|
222
|
+
ioConfig.dc_gpio_num = GPIO_NUM_NC;
|
|
223
|
+
ioConfig.spi_mode = 0;
|
|
224
|
+
ioConfig.pclk_hz = config.qspiPclkHz;
|
|
225
|
+
ioConfig.trans_queue_depth = config.transactionQueueDepth;
|
|
226
|
+
ioConfig.on_color_trans_done = config.onColorTransferDone;
|
|
227
|
+
ioConfig.user_ctx = config.callbackContext;
|
|
228
|
+
ioConfig.lcd_cmd_bits = 32;
|
|
229
|
+
ioConfig.lcd_param_bits = 8;
|
|
230
|
+
ioConfig.flags.quad_mode = true;
|
|
231
|
+
ESP_RETURN_ON_ERROR(esp_lcd_new_panel_io_spi(config.spiHost, &ioConfig, &ioHandle), kTag, "create panel io failed");
|
|
232
|
+
panelIo_ = ioHandle;
|
|
233
|
+
|
|
234
|
+
{
|
|
235
|
+
// The requested pclk is not what the SPI driver necessarily achieves —
|
|
236
|
+
// log the negotiated clock so link-throughput math uses reality.
|
|
237
|
+
auto *io = spiPanelIo(panelIo_);
|
|
238
|
+
int actualFreqKhz = 0;
|
|
239
|
+
if (spi_device_get_actual_freq(io->spiDev, &actualFreqKhz) == ESP_OK)
|
|
240
|
+
ESP_LOGI(kTag, "SPI actual clock: %d kHz (requested %d), trans max %u bytes, queue %u",
|
|
241
|
+
actualFreqKhz, config.qspiPclkHz, static_cast<unsigned>(io->spiTransMaxBytes),
|
|
242
|
+
static_cast<unsigned>(io->queueSize));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
co5300_vendor_config_t vendorConfig = {};
|
|
246
|
+
#if GEA_EMBEDDED_CO5300_WAVESHARE_175_INIT
|
|
247
|
+
vendorConfig.init_cmds = kWaveshare175InitCommands;
|
|
248
|
+
vendorConfig.init_cmds_size = sizeof(kWaveshare175InitCommands) / sizeof(kWaveshare175InitCommands[0]);
|
|
249
|
+
#endif
|
|
250
|
+
vendorConfig.flags.use_qspi_interface = 1;
|
|
251
|
+
|
|
252
|
+
esp_lcd_panel_dev_config_t panelConfig = {};
|
|
253
|
+
panelConfig.reset_gpio_num = static_cast<gpio_num_t>(config.pinReset);
|
|
254
|
+
panelConfig.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB;
|
|
255
|
+
panelConfig.bits_per_pixel = 16;
|
|
256
|
+
panelConfig.vendor_config = &vendorConfig;
|
|
257
|
+
|
|
258
|
+
esp_lcd_panel_handle_t panelHandleValue = nullptr;
|
|
259
|
+
ESP_RETURN_ON_ERROR(esp_lcd_new_panel_co5300(ioHandle, &panelConfig, &panelHandleValue), kTag, "create panel failed");
|
|
260
|
+
panel_ = panelHandleValue;
|
|
261
|
+
|
|
262
|
+
ESP_RETURN_ON_ERROR(esp_lcd_panel_reset(panelHandle(panel_)), kTag, "panel reset failed");
|
|
263
|
+
ESP_RETURN_ON_ERROR(esp_lcd_panel_init(panelHandle(panel_)), kTag, "panel init failed");
|
|
264
|
+
ESP_RETURN_ON_ERROR(esp_lcd_panel_set_gap(panelHandle(panel_), gea::chips::co5300::kPanelXGap, gea::chips::co5300::kPanelYGap),
|
|
265
|
+
kTag,
|
|
266
|
+
"panel gap failed");
|
|
267
|
+
return ESP_OK;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
esp_err_t Panel::setDisplayOn(bool enabled)
|
|
271
|
+
{
|
|
272
|
+
if (!panel_)
|
|
273
|
+
return ESP_ERR_INVALID_STATE;
|
|
274
|
+
return esp_lcd_panel_disp_on_off(panelHandle(panel_), enabled);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
esp_err_t Panel::setBrightness(int brightnessPercent)
|
|
278
|
+
{
|
|
279
|
+
if (!panel_)
|
|
280
|
+
return ESP_ERR_INVALID_STATE;
|
|
281
|
+
if (brightnessPercent < 0)
|
|
282
|
+
brightnessPercent = 0;
|
|
283
|
+
if (brightnessPercent > 100)
|
|
284
|
+
brightnessPercent = 100;
|
|
285
|
+
return esp_lcd_panel_co5300_set_brightness(panelHandle(panel_), static_cast<std::uint8_t>(brightnessPercent));
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// HBM is a SEPARATE command from the brightness registers, which is why
|
|
289
|
+
// loading 0x63 alone changes nothing: 0x51 holds the normal-mode brightness,
|
|
290
|
+
// 0x63 holds the value used WHILE HBM is active, and 0x66 (HBMEN, datasheet
|
|
291
|
+
// 7.5.49) is the only thing that switches between them. Bit D[1] is the enable;
|
|
292
|
+
// every other bit is reserved. Note that 0x53 (WRCTRLD) has no HBM bit at all
|
|
293
|
+
// -- only BCTRL (D[5]) and DD (D[3]) -- so "write 0x53 with a bigger value" is
|
|
294
|
+
// a dead end on this controller.
|
|
295
|
+
//
|
|
296
|
+
// The panel ships an Automatic Current Limit block (0x55/0x56) whose stated
|
|
297
|
+
// purpose is to protect AMOLED lifetime, and the datasheet documents no duty
|
|
298
|
+
// cycle for HBM, so treat this as a sunlight boost to switch on and off, not
|
|
299
|
+
// as a brightness setting to leave on.
|
|
300
|
+
esp_err_t Panel::setHighBrightnessMode(bool enabled)
|
|
301
|
+
{
|
|
302
|
+
if (!panelIo_)
|
|
303
|
+
return ESP_ERR_INVALID_STATE;
|
|
304
|
+
const std::uint8_t hbm[] = {static_cast<std::uint8_t>(enabled ? 0x02 : 0x00)};
|
|
305
|
+
return txParam(0x66, hbm, sizeof(hbm));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
esp_err_t Panel::drawBitmap(int x0, int y0, int x1Exclusive, int y1Exclusive, const void *pixels)
|
|
309
|
+
{
|
|
310
|
+
if (!panel_)
|
|
311
|
+
return ESP_ERR_INVALID_STATE;
|
|
312
|
+
return esp_lcd_panel_draw_bitmap(panelHandle(panel_), x0, y0, x1Exclusive, y1Exclusive, pixels);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
esp_err_t Panel::setWindow(int x0, int y0, int x1, int y1)
|
|
316
|
+
{
|
|
317
|
+
const auto window = gea::chips::co5300::CommandSet::addressWindow(x0, y0, x1, y1);
|
|
318
|
+
ESP_RETURN_ON_ERROR(txParam(LCD_CMD_CASET, window.columns.data(), window.columns.size()), kTag, "send CASET failed");
|
|
319
|
+
ESP_RETURN_ON_ERROR(txParam(LCD_CMD_RASET, window.rows.data(), window.rows.size()), kTag, "send RASET failed");
|
|
320
|
+
return ESP_OK;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
esp_err_t Panel::txColor(int command, const void *color, std::size_t colorSize)
|
|
324
|
+
{
|
|
325
|
+
if (!panelIo_)
|
|
326
|
+
return ESP_ERR_INVALID_STATE;
|
|
327
|
+
const int lcdCommand = gea::chips::co5300::CommandSet::qspiColorCommand(command);
|
|
328
|
+
return esp_lcd_panel_io_tx_color(panelIoHandle(panelIo_), lcdCommand, color, colorSize);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
esp_err_t Panel::beginColorStream(int command)
|
|
332
|
+
{
|
|
333
|
+
if (!panelIo_ || colorStreamActive_)
|
|
334
|
+
return ESP_ERR_INVALID_STATE;
|
|
335
|
+
|
|
336
|
+
auto *io = spiPanelIo(panelIo_);
|
|
337
|
+
ESP_RETURN_ON_ERROR(spi_device_acquire_bus(io->spiDev, portMAX_DELAY), kTag, "acquire SPI bus failed");
|
|
338
|
+
|
|
339
|
+
esp_err_t ret = drainInflight(io);
|
|
340
|
+
if (ret != ESP_OK)
|
|
341
|
+
{
|
|
342
|
+
spi_device_release_bus(io->spiDev);
|
|
343
|
+
return ret;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
auto *lcdTrans = transDescriptorAt(io, 0);
|
|
347
|
+
std::memset(lcdTrans, 0, sizeof(LcdSpiTransDescriptor));
|
|
348
|
+
|
|
349
|
+
int lcdCommand = gea::chips::co5300::CommandSet::qspiColorCommand(command);
|
|
350
|
+
prepareCommandBuffer(lcdCommand, io->lcdCmdBits);
|
|
351
|
+
lcdTrans->base.user = io;
|
|
352
|
+
lcdTrans->flags.dc_gpio_level = io->flags.dcCmdLevel;
|
|
353
|
+
lcdTrans->base.length = io->lcdCmdBits;
|
|
354
|
+
lcdTrans->base.tx_buffer = &lcdCommand;
|
|
355
|
+
lcdTrans->base.flags |= SPI_TRANS_CS_KEEP_ACTIVE;
|
|
356
|
+
if (io->flags.octalMode)
|
|
357
|
+
{
|
|
358
|
+
lcdTrans->base.flags |= SPI_TRANS_MULTILINE_CMD | SPI_TRANS_MULTILINE_ADDR | SPI_TRANS_MODE_OCT;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
ret = spi_device_polling_transmit(io->spiDev, &lcdTrans->base);
|
|
362
|
+
if (ret != ESP_OK)
|
|
363
|
+
{
|
|
364
|
+
spi_device_release_bus(io->spiDev);
|
|
365
|
+
return ret;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
colorStreamActive_ = true;
|
|
369
|
+
return ESP_OK;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
esp_err_t Panel::queueColorStreamData(const void *color, std::size_t colorSize, bool keepCsActiveAfter, bool signalCompletion)
|
|
373
|
+
{
|
|
374
|
+
if (!panelIo_ || !colorStreamActive_)
|
|
375
|
+
return ESP_ERR_INVALID_STATE;
|
|
376
|
+
if (!color || colorSize == 0)
|
|
377
|
+
return ESP_ERR_INVALID_ARG;
|
|
378
|
+
|
|
379
|
+
auto *io = spiPanelIo(panelIo_);
|
|
380
|
+
const auto *bytes = static_cast<const std::uint8_t *>(color);
|
|
381
|
+
std::size_t remaining = colorSize;
|
|
382
|
+
|
|
383
|
+
while (remaining > 0)
|
|
384
|
+
{
|
|
385
|
+
std::size_t chunkSize = remaining;
|
|
386
|
+
if (chunkSize > io->spiTransMaxBytes)
|
|
387
|
+
chunkSize = io->spiTransMaxBytes;
|
|
388
|
+
const bool isLastChunk = chunkSize == remaining;
|
|
389
|
+
|
|
390
|
+
esp_err_t ret = ESP_OK;
|
|
391
|
+
auto *lcdTrans = nextQueuedDescriptor(io, ret);
|
|
392
|
+
if (ret != ESP_OK)
|
|
393
|
+
return ret;
|
|
394
|
+
if (!lcdTrans)
|
|
395
|
+
return ESP_ERR_INVALID_STATE;
|
|
396
|
+
std::memset(lcdTrans, 0, sizeof(LcdSpiTransDescriptor));
|
|
397
|
+
|
|
398
|
+
lcdTrans->base.user = io;
|
|
399
|
+
lcdTrans->flags.dc_gpio_level = io->flags.dcDataLevel;
|
|
400
|
+
lcdTrans->flags.en_trans_done_cb = signalCompletion && isLastChunk;
|
|
401
|
+
lcdTrans->base.length = chunkSize * 8;
|
|
402
|
+
lcdTrans->base.tx_buffer = bytes;
|
|
403
|
+
#if GEA_EMBEDDED_CO5300_SPI_MANUAL_DMA_ALIGN_FLAG
|
|
404
|
+
if (esp_ptr_external_ram(bytes))
|
|
405
|
+
{
|
|
406
|
+
static bool warnedExternalDmaCapability = false;
|
|
407
|
+
if (!warnedExternalDmaCapability)
|
|
408
|
+
{
|
|
409
|
+
ESP_LOGW(kTag,
|
|
410
|
+
"external LCD DMA source: ptr=%p len=%zu dma_capable=%d",
|
|
411
|
+
bytes,
|
|
412
|
+
chunkSize,
|
|
413
|
+
esp_ptr_dma_capable(bytes) ? 1 : 0);
|
|
414
|
+
warnedExternalDmaCapability = true;
|
|
415
|
+
}
|
|
416
|
+
const auto address = reinterpret_cast<std::uintptr_t>(bytes);
|
|
417
|
+
constexpr std::size_t kDmaAlignBytes = GEA_EMBEDDED_CO5300_SPI_DMA_ALIGN_BYTES;
|
|
418
|
+
if (((address | chunkSize) & (kDmaAlignBytes - 1)) != 0)
|
|
419
|
+
{
|
|
420
|
+
ESP_LOGE(kTag,
|
|
421
|
+
"external LCD DMA chunk is not %zu-byte aligned: ptr=%p len=%zu",
|
|
422
|
+
kDmaAlignBytes,
|
|
423
|
+
bytes,
|
|
424
|
+
chunkSize);
|
|
425
|
+
return ESP_ERR_INVALID_ARG;
|
|
426
|
+
}
|
|
427
|
+
// External PSRAM color buffers are already cache-synced by the display
|
|
428
|
+
// backend. Force the SPI driver to reject, rather than silently bounce,
|
|
429
|
+
// any external transaction that no longer satisfies DMA alignment.
|
|
430
|
+
lcdTrans->base.flags |= SPI_TRANS_DMA_BUFFER_ALIGN_MANUAL;
|
|
431
|
+
}
|
|
432
|
+
#endif
|
|
433
|
+
if (!isLastChunk || keepCsActiveAfter)
|
|
434
|
+
lcdTrans->base.flags |= SPI_TRANS_CS_KEEP_ACTIVE;
|
|
435
|
+
if (io->flags.octalMode)
|
|
436
|
+
{
|
|
437
|
+
lcdTrans->base.flags |= SPI_TRANS_MULTILINE_CMD | SPI_TRANS_MULTILINE_ADDR | SPI_TRANS_MODE_OCT;
|
|
438
|
+
}
|
|
439
|
+
else if (io->flags.quadMode)
|
|
440
|
+
{
|
|
441
|
+
lcdTrans->base.flags |= SPI_TRANS_MODE_QIO;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
ret = spi_device_queue_trans(io->spiDev, &lcdTrans->base, portMAX_DELAY);
|
|
445
|
+
if (ret != ESP_OK)
|
|
446
|
+
return ret;
|
|
447
|
+
io->numTransInflight++;
|
|
448
|
+
|
|
449
|
+
bytes += chunkSize;
|
|
450
|
+
remaining -= chunkSize;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
return ESP_OK;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
void Panel::endColorStream()
|
|
457
|
+
{
|
|
458
|
+
if (!panelIo_ || !colorStreamActive_)
|
|
459
|
+
return;
|
|
460
|
+
auto *io = spiPanelIo(panelIo_);
|
|
461
|
+
spi_device_release_bus(io->spiDev);
|
|
462
|
+
colorStreamActive_ = false;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// Autonomous (no-acquire) color-stream methods for the gea3d present. Kept in a
|
|
466
|
+
// separate file, #included here so it reaches the panel-IO internals above.
|
|
467
|
+
#include "chip_bindings/displays/co5300_async_stream.inc"
|
|
468
|
+
|
|
469
|
+
esp_err_t Panel::txParam(int command, const void *param, std::size_t paramSize)
|
|
470
|
+
{
|
|
471
|
+
if (!panelIo_)
|
|
472
|
+
return ESP_ERR_INVALID_STATE;
|
|
473
|
+
return esp_lcd_panel_io_tx_param(panelIoHandle(panelIo_),
|
|
474
|
+
gea::chips::co5300::CommandSet::qspiParameterCommand(command),
|
|
475
|
+
param,
|
|
476
|
+
paramSize);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
esp_err_t Panel::setTearScanline(int line)
|
|
480
|
+
{
|
|
481
|
+
if (!panelIo_)
|
|
482
|
+
return ESP_ERR_INVALID_STATE;
|
|
483
|
+
if (line < 0)
|
|
484
|
+
line = 0;
|
|
485
|
+
// TEON mode 0 (TE at the programmed line) then set_tear_scanline (0x44). The
|
|
486
|
+
// init already enables TE; re-asserting the mode here is idempotent and makes
|
|
487
|
+
// the scanline take effect.
|
|
488
|
+
const std::uint8_t teon[] = {0x00};
|
|
489
|
+
ESP_RETURN_ON_ERROR(txParam(0x35, teon, sizeof(teon)), kTag, "TEON failed");
|
|
490
|
+
const std::uint8_t scanline[] = {static_cast<std::uint8_t>((line >> 8) & 0xFF),
|
|
491
|
+
static_cast<std::uint8_t>(line & 0xFF)};
|
|
492
|
+
return txParam(0x44, scanline, sizeof(scanline));
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
} // namespace gea::platform::esp32::chip_bindings::co5300
|
|
496
|
+
|
|
497
|
+
namespace gea::platform::esp32::chip_bindings::displays
|
|
498
|
+
{
|
|
499
|
+
|
|
500
|
+
QspiPanel &qspiPanel()
|
|
501
|
+
{
|
|
502
|
+
return co5300::Panel::instance();
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
const char *qspiPanelDriverName()
|
|
506
|
+
{
|
|
507
|
+
return "CO5300";
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
} // namespace gea::platform::esp32::chip_bindings::displays
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "chip_bindings/displays/qspi_panel.h"
|
|
4
|
+
|
|
5
|
+
namespace gea::platform::esp32::chip_bindings::co5300
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
using PanelConfig = displays::QspiPanelConfig;
|
|
9
|
+
|
|
10
|
+
class Panel final : public displays::QspiPanel
|
|
11
|
+
{
|
|
12
|
+
public:
|
|
13
|
+
static Panel &instance();
|
|
14
|
+
|
|
15
|
+
bool initialized() const override;
|
|
16
|
+
esp_err_t init(const PanelConfig &config) override;
|
|
17
|
+
esp_err_t setDisplayOn(bool enabled) override;
|
|
18
|
+
esp_err_t setBrightness(int brightnessPercent) override;
|
|
19
|
+
esp_err_t setHighBrightnessMode(bool enabled) override;
|
|
20
|
+
esp_err_t drawBitmap(int x0, int y0, int x1Exclusive, int y1Exclusive, const void *pixels) override;
|
|
21
|
+
esp_err_t setWindow(int x0, int y0, int x1, int y1) override;
|
|
22
|
+
esp_err_t txColor(int command, const void *color, std::size_t colorSize) override;
|
|
23
|
+
esp_err_t beginColorStream(int command) override;
|
|
24
|
+
esp_err_t queueColorStreamData(const void *color, std::size_t colorSize, bool keepCsActiveAfter, bool signalCompletion) override;
|
|
25
|
+
void endColorStream() override;
|
|
26
|
+
// Autonomous (no acquire_bus) variant — ISR-driven DMA so the wire streams
|
|
27
|
+
// while the CPU rasters the next chunk. gea3d half-res present only; see
|
|
28
|
+
// co5300_async_stream.inc. Data uses the same queueColorStreamData.
|
|
29
|
+
esp_err_t beginColorStreamAsync(int command) override;
|
|
30
|
+
void endColorStreamAsync() override;
|
|
31
|
+
esp_err_t setTearScanline(int line) override;
|
|
32
|
+
|
|
33
|
+
private:
|
|
34
|
+
Panel() = default;
|
|
35
|
+
|
|
36
|
+
esp_err_t txParam(int command, const void *param, std::size_t paramSize);
|
|
37
|
+
|
|
38
|
+
void *panel_ = nullptr;
|
|
39
|
+
void *panelIo_ = nullptr;
|
|
40
|
+
bool colorStreamActive_ = false;
|
|
41
|
+
// Persistent home for the async stream's opening RAMWR command word: the
|
|
42
|
+
// ISR-driven DMA reads it after beginColorStreamAsync returns, so it can't
|
|
43
|
+
// live on the stack. Alignment matches spi_transaction_t tx_buffer needs.
|
|
44
|
+
alignas(4) int asyncCmdWord_ = 0;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
} // namespace gea::platform::esp32::chip_bindings::co5300
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
//
|
|
3
|
+
// Autonomous QSPI color stream for the CO5300 — the "new driver path" used ONLY
|
|
4
|
+
// by the gea3d half-res present. Included into co5300.cpp so it can reach the
|
|
5
|
+
// panel-IO internals (spiPanelIo / LcdSpiTransDescriptor / nextQueuedDescriptor).
|
|
6
|
+
//
|
|
7
|
+
// Difference from the normal beginColorStream/queueColorStreamData path: it does
|
|
8
|
+
// NOT call spi_device_acquire_bus. An acquired bus routes the queued transfers
|
|
9
|
+
// through a path that only advances when the present task drives/drains it, so
|
|
10
|
+
// the wire and the CPU (raster on the other core) can't overlap — they serialize
|
|
11
|
+
// to ~25ms/frame. Without acquire, spi_device_queue_trans is ISR-driven: once the
|
|
12
|
+
// opening RAMWR + the chunk data are queued, the GDMA chains through them in the
|
|
13
|
+
// background while the present task rasters the next chunk on the worker core.
|
|
14
|
+
// The command bytes live in the transaction's inline tx_data (SPI_TRANS_USE_TXDATA)
|
|
15
|
+
// because the async DMA reads them AFTER beginColorStreamAsync returns — a stack
|
|
16
|
+
// buffer (as the polling path uses) would be gone by then.
|
|
17
|
+
//
|
|
18
|
+
// Every other app keeps the acquired-bus path untouched; this file adds two new
|
|
19
|
+
// Panel methods and changes nothing existing.
|
|
20
|
+
|
|
21
|
+
esp_err_t Panel::beginColorStreamAsync(int command)
|
|
22
|
+
{
|
|
23
|
+
if (!panelIo_ || colorStreamActive_)
|
|
24
|
+
return ESP_ERR_INVALID_STATE;
|
|
25
|
+
|
|
26
|
+
auto *io = spiPanelIo(panelIo_);
|
|
27
|
+
// Collect any transactions still queued from the previous present (their DMA
|
|
28
|
+
// already completed — the present tail spun on it) so numTransInflight and the
|
|
29
|
+
// descriptor pool start clean. No acquire_bus: the ISR queue is autonomous.
|
|
30
|
+
esp_err_t ret = drainInflight(io);
|
|
31
|
+
if (ret != ESP_OK)
|
|
32
|
+
{
|
|
33
|
+
static bool w = false; if (!w) { w = true; ESP_LOGE(kTag, "async begin: drainInflight %s", esp_err_to_name(ret)); }
|
|
34
|
+
return ret;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
esp_err_t qret = ESP_OK;
|
|
38
|
+
auto *lcdTrans = nextQueuedDescriptor(io, qret);
|
|
39
|
+
if (qret != ESP_OK)
|
|
40
|
+
{
|
|
41
|
+
static bool w = false; if (!w) { w = true; ESP_LOGE(kTag, "async begin: nextDesc %s", esp_err_to_name(qret)); }
|
|
42
|
+
return qret;
|
|
43
|
+
}
|
|
44
|
+
if (!lcdTrans)
|
|
45
|
+
return ESP_ERR_INVALID_STATE;
|
|
46
|
+
std::memset(lcdTrans, 0, sizeof(LcdSpiTransDescriptor));
|
|
47
|
+
|
|
48
|
+
asyncCmdWord_ = gea::chips::co5300::CommandSet::qspiColorCommand(command);
|
|
49
|
+
prepareCommandBuffer(asyncCmdWord_, io->lcdCmdBits);
|
|
50
|
+
lcdTrans->base.user = io;
|
|
51
|
+
lcdTrans->flags.dc_gpio_level = io->flags.dcCmdLevel;
|
|
52
|
+
lcdTrans->base.length = io->lcdCmdBits;
|
|
53
|
+
// Persistent (member) command buffer: the async DMA reads it after we return.
|
|
54
|
+
lcdTrans->base.tx_buffer = &asyncCmdWord_;
|
|
55
|
+
lcdTrans->base.flags |= SPI_TRANS_CS_KEEP_ACTIVE;
|
|
56
|
+
if (io->flags.octalMode)
|
|
57
|
+
lcdTrans->base.flags |= SPI_TRANS_MULTILINE_CMD | SPI_TRANS_MULTILINE_ADDR | SPI_TRANS_MODE_OCT;
|
|
58
|
+
|
|
59
|
+
ret = spi_device_queue_trans(io->spiDev, &lcdTrans->base, portMAX_DELAY);
|
|
60
|
+
if (ret != ESP_OK)
|
|
61
|
+
{
|
|
62
|
+
static bool w = false; if (!w) { w = true; ESP_LOGE(kTag, "async begin: queue_trans %s", esp_err_to_name(ret)); }
|
|
63
|
+
return ret;
|
|
64
|
+
}
|
|
65
|
+
io->numTransInflight++;
|
|
66
|
+
|
|
67
|
+
colorStreamActive_ = true;
|
|
68
|
+
return ESP_OK;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
void Panel::endColorStreamAsync()
|
|
72
|
+
{
|
|
73
|
+
if (!panelIo_ || !colorStreamActive_)
|
|
74
|
+
return;
|
|
75
|
+
// Never acquired the bus, so nothing to release. The present's region tail has
|
|
76
|
+
// already spun until the last chunk's DMA completed; leftover descriptors are
|
|
77
|
+
// reclaimed by the next present's drainInflight.
|
|
78
|
+
colorStreamActive_ = false;
|
|
79
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <cstddef>
|
|
4
|
+
|
|
5
|
+
#include "driver/spi_master.h"
|
|
6
|
+
#include "esp_err.h"
|
|
7
|
+
#include "esp_lcd_types.h"
|
|
8
|
+
|
|
9
|
+
namespace gea::platform::esp32::chip_bindings::displays
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
struct QspiPanelConfig
|
|
13
|
+
{
|
|
14
|
+
spi_host_device_t spiHost;
|
|
15
|
+
int pinCs;
|
|
16
|
+
int pinPclk;
|
|
17
|
+
int pinData0;
|
|
18
|
+
int pinData1;
|
|
19
|
+
int pinData2;
|
|
20
|
+
int pinData3;
|
|
21
|
+
int pinReset;
|
|
22
|
+
int qspiPclkHz;
|
|
23
|
+
int maxTransferBytes;
|
|
24
|
+
int transactionQueueDepth;
|
|
25
|
+
esp_lcd_panel_io_color_trans_done_cb_t onColorTransferDone;
|
|
26
|
+
void *callbackContext;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
class QspiPanel
|
|
30
|
+
{
|
|
31
|
+
public:
|
|
32
|
+
virtual ~QspiPanel() = default;
|
|
33
|
+
|
|
34
|
+
virtual bool initialized() const = 0;
|
|
35
|
+
virtual esp_err_t init(const QspiPanelConfig &config) = 0;
|
|
36
|
+
virtual esp_err_t setDisplayOn(bool enabled) = 0;
|
|
37
|
+
virtual esp_err_t setBrightness(int brightnessPercent) = 0;
|
|
38
|
+
// High-brightness mode: a sunlight-readability boost that drives the panel
|
|
39
|
+
// above its normal-mode ceiling. Not every controller has one, so the
|
|
40
|
+
// default reports "unsupported" rather than being pure-virtual.
|
|
41
|
+
virtual esp_err_t setHighBrightnessMode(bool /*enabled*/) { return ESP_ERR_NOT_SUPPORTED; }
|
|
42
|
+
virtual esp_err_t drawBitmap(int x0, int y0, int x1Exclusive, int y1Exclusive, const void *pixels) = 0;
|
|
43
|
+
virtual esp_err_t setWindow(int x0, int y0, int x1, int y1) = 0;
|
|
44
|
+
virtual esp_err_t txColor(int command, const void *color, std::size_t colorSize) = 0;
|
|
45
|
+
virtual esp_err_t beginColorStream(int command) = 0;
|
|
46
|
+
virtual esp_err_t queueColorStreamData(const void *color, std::size_t colorSize, bool keepCsActiveAfter, bool signalCompletion) = 0;
|
|
47
|
+
virtual void endColorStream() = 0;
|
|
48
|
+
// Autonomous (no bus-acquire) color stream: ISR-driven DMA so the wire overlaps
|
|
49
|
+
// CPU work on another core. Default = the acquired-bus stream, so a binding
|
|
50
|
+
// without an override behaves exactly as before; co5300 overrides it.
|
|
51
|
+
virtual esp_err_t beginColorStreamAsync(int command) { return beginColorStream(command); }
|
|
52
|
+
virtual void endColorStreamAsync() { endColorStream(); }
|
|
53
|
+
// Program the scanline at which the panel emits its TE (vsync) pulse. Firing
|
|
54
|
+
// it a few lines before the frame end gives the host lead time to write the
|
|
55
|
+
// next frame's top rows into GRAM before scanout wraps to them. Default
|
|
56
|
+
// no-op for panels/bindings without tear-scanline support.
|
|
57
|
+
virtual esp_err_t setTearScanline(int /*line*/) { return ESP_OK; }
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Each board target links exactly one chip binding (co5300, sh8601, …) that
|
|
61
|
+
// provides these symbols. display.cpp talks only to this interface.
|
|
62
|
+
QspiPanel &qspiPanel();
|
|
63
|
+
const char *qspiPanelDriverName();
|
|
64
|
+
|
|
65
|
+
} // namespace gea::platform::esp32::chip_bindings::displays
|