Skip to content

st7796: enable display inversion (INVON) like the st7789 init - #604

Open
bitcoin3us wants to merge 1 commit into
lvgl-micropython:mainfrom
bitcoin3us:fix/st7796-invon-upstream
Open

st7796: enable display inversion (INVON) like the st7789 init#604
bitcoin3us wants to merge 1 commit into
lvgl-micropython:mainfrom
bitcoin3us:fix/st7796-invon-upstream

Conversation

@bitcoin3us

Copy link
Copy Markdown

The st7796 init never sends INVON (0x21), so ST7796 IPS panels render everything in negative. The st7789 init already sends INVON unconditionally for exactly this reason; this brings st7796 in line.

Found while bringing up the Waveshare ESP32-S3-Touch-LCD-3.5 in MicroPythonOS (MicroPythonOS/MicroPythonOS#280): the inverted UI passed for a plausible dark theme during initial testing, and only became obvious once a camera preview looked like a photographic negative. Hardware-verified both ways on that board: sending INVON to the live panel flips it to correct colors instantly, and firmware built with this init renders correctly from boot.

Caveat: ST7796 also ships on non-IPS TN modules that would not want inversion. This PR mirrors st7789's unconditional choice for consistency, but if you'd prefer it settable (e.g. an invert constructor flag on the driver, defaulting to the current behavior of whichever family), I'm happy to rework it that way — the same flag would arguably benefit st7789 too.

🤖 Generated with Claude Code

Without INVON the ST7796 IPS panels render everything in negative.
Found on the Waveshare ESP32-S3-Touch-LCD-3.5: the inverted UI passed
for a dark theme during bring-up, and only camera preview photos made
the inversion obvious. Hardware-verified: sending INVON live flips the
panel to correct colors, and a firmware built with this init renders
correctly from boot.

The st7789 init already sends INVON for the same reason.

Co-Authored-By: Claude Fable 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