st7796: enable display inversion (INVON) like the st7789 init - #604
Open
bitcoin3us wants to merge 1 commit into
Open
st7796: enable display inversion (INVON) like the st7789 init#604bitcoin3us wants to merge 1 commit into
bitcoin3us wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
invertconstructor 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