-
Notifications
You must be signed in to change notification settings - Fork 1.2k
adding support for the ST7796 + creating a new variant of the T-beam #6575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…/meshtastic-firmware into T-beam-display-no-touch
converted it to draft because i seem to get SPI related errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall, though i'd prefer if you got the touchscreen working as well
e145e10
to
e0bb762
Compare
…/meshtastic-firmware into T-beam-display-no-touch
… for the lora module, display shield pumps out EMI?
yesterday i had a SPI related error every ~20 minutes, also next to zero Bluetooth reception i first want to resolve that issue before i start implementing the touchscreen edit: resolved, Bluetooth reception is resolved with higher pinheaders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for the ST7796 display and a matching T-Beam variant, plus a new CST226SE touchscreen driver.
- Define ST7796 pin mappings, dimensions, and backlight settings in
variants/tbeam/variant.h
- Introduce a
tbeam-displayshield
PlatformIO environment with ST7796 and touchscreen library dependencies - Update conditional compilation in display setup, NodeDB, and I2C scanning—and add
TouchScreenCST226SE
driver
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
variants/tbeam/variant.h | ST7796 macros and screen parameters |
variants/tbeam/platformio.ini | New env with USE_ST7796 flag and lib_deps |
src/mesh/NodeDB.cpp | Include USE_ST7796 in default-config screen check |
src/main.cpp | Add USE_ST7796 to setup guards and CPU speed logic |
src/input/TouchScreenCST226SE.h | New CST226SE touchscreen interface declaration |
src/input/TouchScreenCST226SE.cpp | Implementation of CST226SE touchscreen handling |
src/graphics/images.h | Extend image conditions to include USE_ST7796 |
src/graphics/ScreenFonts.h | Include USE_ST7796 in font-size guard |
src/graphics/Screen.h | Add #include <ST7796Spi.h> for the new driver |
src/graphics/Screen.cpp | Instantiate ST7796Spi, backlight and cleanup logic |
src/detect/ScanI2CTwoWire.cpp | Detect CST226SE in I2C scan sequence |
src/detect/ScanI2C.h | Add CST226SE to DeviceType enum |
src/configuration.h | Define CST226SE_ADDR and CST226SE_ADDR_ALT |
Comments suppressed due to low confidence (1)
src/input/TouchScreenCST226SE.cpp:21
- [nitpick] Consider adding unit or integration tests for the CST226SE driver initialization and touch event handling to ensure the new touchscreen code is covered and behaves as expected.
void TouchScreenCST226SE::init()
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using lovyanGFX (TFTDisplay.cpp) would have saved some work as it natively supports the ST7796 display driver and also the CST226 touch screen driver (in its develop branch). It would have allowed smoother integration into TFTDisplay.cpp and avoided some code duplication for the touch driver (e.g. onEvent()) as it would have been handled automatically by class TouchScreenImpl1. As a benefit screen powersave functions could have been inherited as well.
lovyangfx makes the program to large to fit on the t-beam (iram overflow ~2700) edit: maybe i'm stupid but i got the display working in the arduino ide with lovyangfx but i couldn't fit it in the meshtastic code. |
The current tbeam size in master is:
I wouldn't expect lovyanGFX being that large (260kB)?! |
the IRAM is insufficient by 2736 bytes
edit: if i compile the exact same code with 1 modification it fits on a esp 32S3 |
modified the existing library for the ST7789 to support the ST7796
created a new variant of the T-beam that supports the ST7796 shield
edit:
the touchscreen is
notworkingyet, the address has been added to the scani2c, should i separate it?🤝 Attestations