Skip to content

Commit

Permalink
TFT Refactoring (MarlinFirmware#19192)
Browse files Browse the repository at this point in the history
* split tft folder in two: tft for color ui; tft_io for shared tft code

* after the files got moved, now the code was moved to the right place

* classic ui using TFT IO init lcd codes

* feature to compile tft_io when enabled

* compiling fix

* lvgl spi tft working with tft io init codes

* there is no need for separeted fsmc and spi class in lvgl anymore, as tft io handle everything

* remove debug

* base for TFT rotation and mirroring API, and ILI9488 support

* ST7796S rotate and mirror support

* ST7789V rotate and mirror support

* ST7735 rotate and mirror support

* ILI9341 rotate and mirror support

* ILI9328 rotate and mirror support

* R61505 rotate and mirror support

* MKS TFT definitions

* more configs for mks tfts

* update config

* naming typo

* to configure the user interface

* ANYCUBIC_TFT35

* tft configs

* support for SSD1963

* tft display types

* updated conditionals lcd; first board fully working with the new code - all 3 ui!

* compatiblity

* changed name

* move classic ui file name

* rename TURN -> ROTATE

* GRAPHICAL_TFT_ROTATE_180 deprecated

* first fsmc board fully working - chitu v5

* mks robin nano v1.2 + tft 35 ok!

* right pin name

* anycubic tft tested in a TRIGORILLA_PRO

* chitu v6

* nano 32 tft orientation

* mks tft43

* mks tft43 rotation

* fixed LONGER LK tft setup

* GRAPHICAL_TFT_UPSCALE defined by the display type

* better offsets defaults

* Update Configuration.h

* Update tft_fsmc.cpp

* Update Conditionals_LCD.h

* Tweak comments

* update nano tests

* Revert "update nano tests"

This reverts commit a071ebb.

* default tft

* outdated comments

* to not break non-vscode builds

* upscale tft 35

* support tft 180 rotation for color ui

* Each TFT Driver is responsible for its default color mode.

* use auto detect in mks displays, because some of them could be shipped with diferent drivers

* extra s

* unused code

* wrong -1

* missing mirror options

* Smaller regex pattern

* Comment updates

* Clean up old defines

* Apply pins formatting

* GRAPHICAL_TFT_ROTATE_180 => TFT_ROTATE_180

* MKS_ROBIN_TFT_V1_1R

* merge fix

* correct resolution

* auto is default, dont need be there, and it will allow the user to configure it even for named displays

* to not use rotation with MKS_ROBIN_TFT_V1_1R

* i like () in macros

* avoid sleepy commits

* default for st7789 is rgb

* nano follow up

* to allow ili9328 rotation

* default is rgb

* boards merge follow up

* to match bootloader orientation

* HAS_TOUCH_XPT2046 is not hal specific anymore

* lets not forget LPC

* 180 rotation for ili9328 and R61505

* Clean up whitespace

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
  • Loading branch information
3 people authored and tharts committed Jan 6, 2021
1 parent 6cafc4d commit a92a2a5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 402 deletions.
42 changes: 21 additions & 21 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@
#elif ENABLED(CARTESIO_UI)

#define DOGLCD
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

#elif EITHER(DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE)

#define IS_DWIN_MARLINUI 1
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

#elif ENABLED(ZONESTAR_LCD)

#define ADC_KEYPAD
#define IS_RRW_KEYPAD
#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
#define ADC_KEY_NUM 8
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

// This helps to implement ADC_KEYPAD menus
#define REVERSE_MENU_DIRECTION
Expand All @@ -98,7 +98,7 @@
#define IS_U8GLIB_SSD1306

#elif ENABLED(RADDS_DISPLAY)
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#define ENCODER_PULSES_PER_STEP 2

#elif EITHER(ANET_FULL_GRAPHICS_LCD, BQ_LCD_SMART_CONTROLLER)
Expand All @@ -108,7 +108,7 @@
#elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864)

#define DOGLCD
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

#if ENABLED(miniVIKI)
#define U8GLIB_ST7565_64128N
Expand All @@ -123,19 +123,19 @@
#elif ENABLED(OLED_PANEL_TINYBOY2)

#define IS_U8GLIB_SSD1306
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

#elif ENABLED(RA_CONTROL_PANEL)

#define LCD_I2C_TYPE_PCA8574
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)

#define DOGLCD
#define U8GLIB_ST7920
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

#elif ENABLED(CR10_STOCKDISPLAY)

Expand Down Expand Up @@ -179,7 +179,7 @@

#define FYSETC_MINI_12864
#define DOGLCD
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#define LED_COLORS_REDUCE_GREEN
#if ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)
#define LED_BACKLIGHT_TIMEOUT 10000
Expand All @@ -205,7 +205,7 @@

#elif ENABLED(ULTI_CONTROLLER)

#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#define U8GLIB_SSD1309
#define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin
#define ENCODER_PULSES_PER_STEP 2
Expand All @@ -220,7 +220,7 @@
#elif EITHER(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C)

#define IS_TFTGLCD_PANEL 1
#define IS_ULTIPANEL 1 // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD
#define IS_ULTIPANEL // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD

#if ENABLED(SDSUPPORT) && DISABLED(LCD_PROGRESS_BAR)
#define LCD_PROGRESS_BAR
Expand All @@ -246,7 +246,7 @@
#endif

#if EITHER(MAKRPANEL, MINIPANEL)
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#define DOGLCD
#if ENABLED(MAKRPANEL)
#define U8GLIB_ST7565_64128N
Expand All @@ -258,7 +258,7 @@
#endif

#if ENABLED(OVERLORD_OLED)
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#define U8GLIB_SH1106
/**
* PCA9632 for buzzer and LEDs via i2c
Expand Down Expand Up @@ -302,13 +302,13 @@

// Basic Ultipanel-like displays
#if ANY(ULTIMAKERCONTROLLER, REPRAP_DISCOUNT_SMART_CONTROLLER, G3D_PANEL, RIGIDBOT_PANEL, PANEL_ONE, U8GLIB_SH1106)
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#endif

// Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h
#if ENABLED(U8GLIB_SH1106_EINSTART)
#define DOGLCD
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#endif

// Compatibility
Expand Down Expand Up @@ -350,7 +350,7 @@

#if TFT_SCALED_DOGLCD
#define DOGLCD
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#define DELAYED_BACKLIGHT_INIT
#elif ENABLED(TFT_LVGL_UI)
#define DELAYED_BACKLIGHT_INIT
Expand All @@ -359,7 +359,7 @@
// Color UI
#if ENABLED(TFT_COLOR_UI)
#define HAS_GRAPHICAL_TFT 1
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#endif

/**
Expand All @@ -383,7 +383,7 @@
#define LCD_I2C_TYPE_MCP23017
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional)
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

#elif ENABLED(LCD_I2C_VIKI)

Expand All @@ -398,7 +398,7 @@
#define LCD_I2C_TYPE_MCP23017
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL

#define ENCODER_FEEDRATE_DEADZONE 4

Expand Down Expand Up @@ -443,10 +443,10 @@
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
#if ENABLED(FF_INTERFACEBOARD)
#define SR_LCD_3W_NL // Non latching 3 wire shift register
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#elif ENABLED(SAV_3DLCD)
#define SR_LCD_2W_NL // Non latching 2 wire shift register
#define IS_ULTIPANEL 1
#define IS_ULTIPANEL
#endif

#if ENABLED(IS_ULTIPANEL)
Expand Down
Loading

0 comments on commit a92a2a5

Please sign in to comment.