Skip to content

Add Arduino_ST77922_1L4: QSPI ST77922 driver (id 52, bus 6) - #3

Open
EnygmaINC wants to merge 2 commits into
bmorcelli:mainfrom
EnygmaINC:lcdwiki-es3c35p-port
Open

EnygmaINC wants to merge 2 commits into
bmorcelli:mainfrom
EnygmaINC:lcdwiki-es3c35p-port

Conversation

@EnygmaINC

@EnygmaINC EnygmaINC commented Nov 9, 2026 •

Copy link
Copy Markdown

Summary

Adds a display driver for the ST77922 (320x480) used on the LCDwiki ES3C35P
3.5" ESP32-S3 module, for use by the Launcher board lcdwiki-es3c35p
(bmorcelli/Launcher#475, request #434).

The ST77922 wants register writes on one data line and pixel data on four.
Arduino_GFX's Arduino_ESP32QSPI hardcodes every phase onto four lines, so it
cannot drive this panel. Like Arduino_RGB_Display / Arduino_DSI_Display
(ids 49/50), the new class therefore owns its bus instead of taking an
Arduino_DataBus:

  • raw ESP-IDF spi_master on SPI2_HOST, IOMUX pins, QUAD, 80 MHz
  • register write: opcode 0x02, 24-bit address reg << 8, params on one line
  • pixel write: opcode 0x32, address 0x003C00, four lines, 0x4000-pixel chunks
  • window X start / width are multiples of 4 (the panel's requirement)
  • init table taken verbatim from the vendor's example (see Provenance)

The panel's MADCTL does not remap addressing, so rotation is software:
USE_CANVAS=1 has Arduino_Canvas hand over native-portrait frames, and the
driver's per-rect paths transform coordinates for the non-canvas case.

Changes

File Change
src/panels/Arduino_ST77922_1L4.h new driver
src/panels/st77922_1l4/st77922_1l4_init_table.h new, init commands + 4-field command struct
src/DisplayConfig.h TFT_DATABUS_N=6 / TFT_DISPLAY_DRIVER_N=52 plumbing
src/backends/ardgfx.{h,cpp} bus-6 branch passing cs, sclk, d0..d3, rst, rotation
src/backends/ardgfx_driver.inc, ardgfx_driver_class.inc id 52 selection

Everything is behind id 52 / bus 6, so no other panel's code path changes. Id 51
is upstream's NV3031B, which is why this uses 52.

Verification

Verified through the Launcher lcdwiki-es3c35p env on one physical unit:
display image, orientation and colour order correct; all four rotations;
stable backlight; Launcher menu, Wi-Fi password entry. See bmorcelli/Launcher#475's
verification table for the full result list and the build/regression checks.

Provenance / licensing note

The init-command table comes from the board vendor's published example
(https://github.com/ydedox/st77922, Example_01 -- the active st77922_lcd_init[]),
which has no license file. It is panel register data, confirmed working on
hardware. Flagged so the maintainer can decide whether to keep it or substitute
the equivalent from the MIT-licensed 78/xiaozhi-esp32. The driver code itself
is original.

Related: bmorcelli/Launcher#434

🤖 Generated with Claude Code

EnygmaINC and others added 2 commits November 9, 2026 14:40
ST77922 wants register writes on 1 line and pixel data on 4 lines, which
Arduino_ESP32QSPI cannot do (it hardcodes 4-4-4). Adds an own-bus raw
ESP-IDF spi_master driver modelled on the vendor example, using the
vendor's active init table verbatim, plus the DisplayConfig / ardgfx
wiring for TFT_DATABUS_N=6 and TFT_DISPLAY_DRIVER_N=52.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Drop the debug prints and the ST77922_BRINGUP_TEST fill routine, and the
Espressif esp_lcd_st77922 files that nothing compiled against (only the
4-field init-command struct was used; it now lives in the init table header).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant