Skip to content
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

SPI Emulated DOGM (like FSMC_GRAPHICAL_TFT, but SPI) #18817

Merged

Conversation

rhapsodyv
Copy link
Sponsor Member

@rhapsodyv rhapsodyv commented Jul 28, 2020

Description

This add support for the emulated DOGM through SPI: SPI_GRAPHICAL_TFT. Add XPT2046 HW SPI version too.

Benefits

  • Recent MKS boards have only SPI for the tft. Currently, the users can just use their LVGL UI. But the LVGL UI isn't complete.
  • MKS Robin Nano v2 and MKS Gen L 2.0
  • This PR add an option any other users that have only SPI tft. May work with any SPI TFT.
  • The default marlin default text menu is by far the most complete UI. A lot of users do prefer it.
  • Supports 180 screen rotation.

Text UI will never die!! 🎸

@thisiskeithb
Copy link
Member

Users were asking about this in the Makerbase Facebook group, so it’s a welcome addition 🙂

@ils15
Copy link
Contributor

ils15 commented Jul 28, 2020

Users were asking about this in the Makerbase Facebook group, so it’s a welcome addition 🙂

i asked him it cause makerbase inverted display area. Cause of if, a lot of users (including me) need to mount display inverted...
MKS commit a change to enable this feature in your LVGL interface.
Classic marlin adition is very good. With rotate screen? Its a Dream

@thinkyhead
Copy link
Member

Is this new SPI_GRAPHICAL_TFT the same as the previous SPI_GRAPHICAL_TFT?
And how does this differ from TFT_LVGL_UI_SPI?

@rhapsodyv
Copy link
Sponsor Member Author

rhapsodyv commented Jul 28, 2020

Is this new SPI_GRAPHICAL_TFT the same as the previous SPI_GRAPHICAL_TFT?

No. What MKS called SPI_GRAPHICAL_TFT wasn't really a new UI. They just used it as if to check if the LVGL is FSMC or SPI... For that reason I proposed the rename to TFT_LVGL_UI_FSMC -> LVGL using FSMC and TFT_LVGL_UI_SPI -> LVGL using SPI.

No user got SPI_GRAPHICAL_TFT in their configs, because it came and gone in the same PR, before the merge...

And how does this differ from TFT_LVGL_UI_SPI?

LVGL:
TFT_LVGL_UI_SPI -> LVGL UI using SPI
TFT_LVGL_UI_FSMC -> LVGL UI using FSMC

DOGM upscaled:
FSMC_GRAPHICAL_TFT -> DOGM Emulated using FSMC
SPI_GRAPHICAL_TFT -> DOGM Emulated using SPI (this PR)

Its just the SPI version of the emulated dogm we already have, for display/boards that are SPI only, like the Robin Nano v2 and MKS Gen L 2.0.

@thisiskeithb
Copy link
Member

thisiskeithb commented Jul 28, 2020

For users who want the classic Marlin GUI on the Nano V2 since LVGL is missing a lot of features still:
image

@thinkyhead
Copy link
Member

thinkyhead commented Jul 28, 2020

I did some cleanups and as far as I can tell all functionality is preserved as-written. The one "correction" I made was to change && (which would always result in true making the left side moot) into a & (to isolate the upper bits).

Please review the code as it is not, and especially the LCD initializations done with WRITE_ESC_SEQUENCE. They are probably correct, but I can't tell by my limited knowledge.

@ils15
Copy link
Contributor

ils15 commented Jul 28, 2020

Hi
tested code and checked Z only move in one direction, no matter configuration i do

@ils15
Copy link
Contributor

ils15 commented Jul 28, 2020

Another issue
Motor only goes down in 2.0.6 with robin nano V2 and LVGL library

@rhapsodyv
Copy link
Sponsor Member Author

Confirmed. In the marlin the Z only moves for one side in Nano v2 board. Tried MKS marlin version, and it's working fine. I will try to find out the reason.

@rhapsodyv
Copy link
Sponsor Member Author

Just found the problem and sent a fix... Waiting for 2.0.6.1 heheh

#18832

@rhapsodyv
Copy link
Sponsor Member Author

I did some cleanups and as far as I can tell all functionality is preserved as-written. The one "correction" I made was to change && (which would always result in true making the left side moot) into a & (to isolate the upper bits).

Please review the code as it is not, and especially the LCD initializations done with WRITE_ESC_SEQUENCE. They are probably correct, but I can't tell by my limited knowledge.

Seems everything ok.

I dont know it the && is a bug... seems to be... its origin: #16401

@ils15
Copy link
Contributor

ils15 commented Jul 28, 2020

Just found the problem and sent a fix... Waiting for 2.0.6.1 heheh

#18832

testing here
everything works fine so far
moviments, pins, UART and all features working like a charm
Classical Marlin working with SPI, without noticiable bugsIMG_20200728_172752.jpgIMG_20200728_172745.jpgIMG_20200728_172725.jpg

@thinkyhead
Copy link
Member

Does the Robin nano V2 have no BEEPER_PIN at all? Or, does it have a pin that a beeper may be attached to?

Boards that have a BEEPER_PIN are permitted to make beeps, but they aren't able to make specific tones unless the device attached to the pin can be modulated. Even though a board may not have a BEEPER_PIN by default, a Piezo can be attached to any 5V pin and then it can be made to work as a SPEAKER. So, it is okay to compile with SPEAKER for any board, as long as there is a viable BEEPER_PIN defined.

If the base beeper that comes with this board can only make beeps, then it might be good to disallow SPEAKER when BEEPER_PIN is set to the default pin.

@rhapsodyv
Copy link
Sponsor Member Author

Does the Robin nano V2 have no BEEPER_PIN at all? Or, does it have a pin that a beeper may be attached to?

Boards that have a BEEPER_PIN are permitted to make beeps, but they aren't able to make specific tones unless the device attached to the pin can be modulated. Even though a board may not have a BEEPER_PIN by default, a Piezo can be attached to any 5V pin and then it can be made to work as a SPEAKER. So, it is okay to compile with SPEAKER for any board, as long as there is a viable BEEPER_PIN defined.

If the base beeper that comes with this board can only make beeps, then it might be good to disallow SPEAKER when BEEPER_PIN is set to the default pin.

History: first I thought that was a problem in the beep and I disabled it at all, because it was freezing everything. After I found that my config was wrong - I had SPEAKER enabled, but this board only have a beeper. So I restored the BEEPER_PIN and added that safe check.

@thinkyhead thinkyhead merged commit 38ce596 into MarlinFirmware:bugfix-2.0.x Jul 30, 2020
thinkyhead added a commit to MarlinFirmware/Configurations that referenced this pull request Jul 30, 2020
domrim pushed a commit to domrim/Marlin that referenced this pull request Aug 2, 2020
Speaka pushed a commit to Speaka/Marlin that referenced this pull request Aug 13, 2020
thinkyhead pushed a commit that referenced this pull request Aug 14, 2020
albertogg pushed a commit to albertogg/Marlin that referenced this pull request Aug 31, 2020
@rhapsodyv rhapsodyv deleted the robin-nano-v2-text-menu branch October 25, 2020 00:27
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
ahmetcemturan pushed a commit to ahmetcemturan/Marlin that referenced this pull request Jan 21, 2021
ahmetcemturan added a commit to ahmetcemturan/Marlin that referenced this pull request Jan 23, 2021
kageurufu pushed a commit to CR30-Users/Marlin-CR30 that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants