Add support for V2 boards (CO5300 panel, CST820 touch) - #1
Open
pablogfb wants to merge 1 commit into
Open
Conversation
Waveshare ships two incompatible revisions of the ESP32-S3-Touch-AMOLED-1.8 under the same name. Boards from around 2026-05 are V2: the panel is a CO5300 rather than an SH8601, and the touch controller is a CST820 at 0x15 rather than an FT3168 at 0x38. The failure mode is unhelpful — a V1 build on a V2 board leaves the screen black while the firmware runs perfectly over serial, so it reads as a driver bug rather than a hardware mismatch. Selected with -DBOARD_V2=1 via a new env:esp32-s3-amoled-v2. Defaults to V1, so existing builds are byte-for-byte unaffected. Three changes were needed: - The panel driver becomes Arduino_CO5300, with a column offset of 16: the CO5300's visible 368 columns start at panel RAM column 16, and without the offset the image is shifted and wraps. - The touch address becomes 0x15. Nothing else in touch.cpp changes — FT3168 and CST820 share the FocalTech-style register map, so the existing reads of 0x02 for the finger count and 0x03..0x06 for coordinates are already correct. - platformio.ini gains a [base] section the two envs extend. The queued-DMA streaming path in display.cpp needed no changes at all: the CO5300 accepts the same write-continue framing (cmd 0x32, addr 0x003C00).
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.
Waveshare ships two incompatible revisions of the ESP32-S3-Touch-AMOLED-1.8 under the same name. Boards from around 2026-05 are V2: a CO5300 panel instead of the SH8601, and a CST820 touch controller at
0x15instead of the FT3168 at0x38.The failure mode is unhelpful — a V1 build on a V2 board leaves the screen black while the firmware runs perfectly over serial, so it reads as a driver bug rather than a hardware mismatch. That's what sent me here.
Selected with
-DBOARD_V2=1via a newenv:esp32-s3-amoled-v2. Defaults to V1, so existing builds are unaffected.What changed
Arduino_CO5300, with a column offset of 16 — the CO5300's visible 368 columns start at panel RAM column 16, and without the offset the image is shifted and wraps.0x15. Nothing else intouch.cppchanges: FT3168 and CST820 share the FocalTech-style register map, so the existing reads of0x02for finger count and0x03..0x06for coordinates are already correct.platformio.inigains a[base]section that both envs extend.The queued-DMA streaming path in
display.cppneeded no changes at all — the CO5300 accepts the same write-continue framing (cmd0x32, addr0x003C00). That was the part I expected to be painful, and it just worked; the comments there were very helpful in convincing me it was safe to leave alone.Testing
[boot] imu=1 touch=1 pmu=1 rtc=1 fs=1 sd=0, menu renders correctly, touch responds, apps run.mainother than moving shared settings into[base], so the risk is low — but it is untested by me, and worth a sanity check on your side before merging.Thanks for building this — the C64 BASIC environment is a delight.