-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Emulated DOGM using standard HAL TFT and XPT IO #19017
Emulated DOGM using standard HAL TFT and XPT IO #19017
Conversation
@thinkyhead I played a bit with the tft defines. I have organised some boards TFT definitions too. Take a look in the ongoing work. Now I will focus to make Emulated DOGM use the same XPT class of the others UI, so we will have only one XPT code per Hal!! |
@thinkyhead what do you think about divide the folder
This way, we could have a class responsible for tft init, that color ui, dogm and lvgl could use. It will allow all the touch logic (hold, double touch, calibration screen) available for all UI too. |
Or, maybe we need reorganise some folders. In TFT, we have:
|
eba6682
to
146f412
Compare
TouchButtons could be merged with tft/touch, as the last one have all that needed by the first, and more. |
There's only one xpt now. We can call back the dogm defines of TOUCH_BUTTONS. |
We can change all LCD_FULL_PIXEL_WIDTH/HEIGHT* to just TFT_WIDTH/HEIGHT. |
@thinkyhead do the last commit makes sense for you? |
One thing that could be changed, is the way we enable the new color ui.
those defines are too generic. Looks like you just are defining the size and interface of the tft. It a little weird to have a "TFT_320x240", and defines like TFT_WIDTH and TFT_HEIGHT Anyway, |
Now that all standard ui share the same base code, we could have something like this:
One set of configuration for all standard TFT UIs |
ab865df
to
cff285c
Compare
Those items should be defined in The emphasis should be on keeping the number of user-facing options minimal, and only things which might be tuned according to preference. |
Right now, it's not really true. Emulated dogm and the new color ui are kind of "generic". Even if it was true, the new Color ui expose it to the user anyway.
Sure, but we aren't talking about a specific TFT. Those 3 UI is now kind of generic UI that may works in any TFT brand! That is the point of reflecting it in the config. |
We really have now 3 UI that may work in almost any TFT. The user just need configure the TFT parameters: resolution, interface and driver. And which one of the 3 he wants. |
Today we have 9 configurations!! // For new color UI
//
//#define TFT_320x240
//#define TFT_320x240_SPI
//#define TFT_480x320
//#define TFT_480x320_SPI
//#define TFT_DRIVER AUTO
// Upscaled 128x64 Marlin UI
//
//#define SPI_GRAPHICAL_TFT
//#define FSMC_GRAPHICAL_TFT
// TFT LVGL UI
//
//#define TFT_LVGL_UI_FSMC // Robin nano v1.2 uses FSMC
//#define TFT_LVGL_UI_SPI // Robin nano v2.0 uses SPI It could be just:
Or:
|
Anyway, right now, we have not merged the duplicated lcd init codes... when we do it, the config could be simplified as above. |
As long as the updated configuration options are finally settled and stable…. I'm getting tired of updating the Configurations repository because of all the indecision. |
When we merge the init code, we get back this subject. |
…PI_TFT -> for every tft SPI, independent of UI. And HAS_GRAPHICAL_TFT for color UI
…gic now, and it uses the XPT IO from HAL.
…tft, and tft for tft displays)
…FSMC GRAPHICAL TFT
@thinkyhead I think I finished the macro changes (by now). All LCD macros now is for non touch, and all touch macros are TFT_* ones. |
I will some last tests before the merge. |
Tests:
Chitu V5 + TFT 35 (FSMC)
Robin Nano V1.2 + TFT 35 (FSMC)
@thisiskeithb Can you test nano v1.2, if you dont mind and have some time? Mks tested it, but they said that nano v1.2 needs a config to use hw spi for touch. I changed it, but I can't test. It would good if you can do a double check. |
It'd be helpful to know which options I should/can choose for a MKS Robin Nano 1.2 and 2.0 with a TFT35 since I can't keep track of all these changes. Adding comments above each section as to which options apply to which boards/TFTs would be REALLY helpful. Do you have a cheat sheet? |
This PR don't change the current configuration options. I'm planning change it after the last refactoring (the lcd init codes one). Right now:
|
I still think adding some specific board names/TFT models in the comments above each section or somehow group/simplify those options would be helpful to everyone. I try to follow new PRs and these new UI options, but it's confusing as to which options work for which boards/TFTs and certainly isn't clear for someone looking at this for the first time. |
I concur that it is a lot to track, and lots of new screens are coming out at a rapid pace. I suggest that we add a page to the Documentation with a photograph of each of these displays along with a list of stats, and that we link to URLs with anchors on that page in the configuration comments. |
These are the boards that have some setup for a Marlin controlled TFT: TFT_LVGL_UI_(SPI|FSMC) = LVGL UI
|
From that list, I refactored: BOARD_CHITU3D_V5, BOARD_CHITU3D_V6, BOARD_MKS_ROBIN_NANO and BOARD_MKS_ROBIN_NANO_V2 to support everything that I or @thisiskeithb could test. |
It would help a lot. But remember: this 3 UI are generic, they aren't brand specific. The board just need have pins for TOUCH, and FSMC or the SPI. And done. The TFT will work. The user may need some further setup, like rotating it or discovering the init code that works. But we need to keep mind is that: those 3 ui aren't anymore board or brand specific. |
That is the reason that I will suggest (in the next PR) to change all those confusing TFT configs to something like:
|
For a long time Marlin has had these settings (for //#define LCD_SCREEN_ROT_90
#define LCD_SCREEN_ROT_180
//#define LCD_SCREEN_ROT_270 …and I suggest that all the screen rotation settings be consolidated down to these (or better yet, a single setting taking a value of 0, 180, or 270). So that would include the settings above plus:
|
It is for text/graphical LCD, right? I think we can have a separated set of configs, LCD_ ones for non TFT, and TFT_ ones for TFT displays.
Sure, the general idea is unify all those TFT options. But it could only be done after we join and refactor all those lcd init code. The user will show the rotation and other params, and all those init code will be ready to accept it. Right now, only a few init codes are ready for those options. I will start this work after this PR get merged. |
🐕🛷! |
Description
Marlin STMF1 had: 3 FSCM code, 3 TFT SPI code. All seems copy of each other. For example: all the FSCM code had the same bug that made it slow.
The objective is that all UI use a standard set os tft io classes that are available in the HAL. This PR is a continuation work of #18974.
Now we are making emulated DOGM to use the same HAL TFT IO, in
I changed all DOGM
_FSMC_
and_SPI_
defines to only_TFT_
. Removed old FSCM and SPI TFT codes, in favor of the TFT_IO classes.Benefits
Related Issues
#18974
TODO List
Next PR: