2016-07-26 03:07:15 +02:00
/**
* Marlin 3 D Printer Firmware
2020-02-03 15:00:57 +01:00
* Copyright ( c ) 2020 MarlinFirmware [ https : //github.com/MarlinFirmware/Marlin]
2016-07-26 03:07:15 +02:00
*
* Based on Sprinter and grbl .
2019-06-28 06:57:50 +02:00
* Copyright ( c ) 2011 Camiel Gubbels / Erik van der Zalm
2016-07-26 03:07:15 +02:00
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2020-07-23 05:20:14 +02:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
2016-07-26 03:07:15 +02:00
*
*/
2018-11-03 08:13:10 +01:00
# pragma once
2016-07-26 03:07:15 +02:00
/**
* Conditionals_LCD . h
2016-08-22 22:02:19 +02:00
* Conditionals that need to be set before Configuration_adv . h or pins . h
2016-07-26 03:07:15 +02:00
*/
2021-05-05 11:24:42 +02:00
// MKS_LCD12864A/B is a variant of MKS_MINI_12864
# if EITHER(MKS_LCD12864A, MKS_LCD12864B)
2020-06-16 09:43:09 +02:00
# define MKS_MINI_12864
# endif
2020-09-07 04:40:58 +02:00
/**
* General Flags that may be set below by specific LCDs
*
* DOGLCD : Run a Graphical LCD through U8GLib ( with MarlinUI )
* IS_ULTIPANEL : Define LCD_PINS_D5 / 6 / 7 for direct - connected " Ultipanel " LCDs
2020-10-15 10:00:27 +02:00
* IS_ULTRA_LCD : Ultra LCD , not necessarily Ultipanel .
2020-09-07 04:40:58 +02:00
* IS_RRD_SC : Common RRD Smart Controller digital interface pins
* IS_RRD_FG_SC : Common RRD Full Graphical Smart Controller digital interface pins
* U8GLIB_ST7920 : Most common DOGM display SPI interface , supporting a " lightweight " display mode .
* U8GLIB_SH1106 : SH1106 OLED with I2C interface via U8GLib
* IS_U8GLIB_SSD1306 : SSD1306 OLED with I2C interface via U8GLib
* U8GLIB_SSD1309 : SSD1309 OLED with I2C interface via U8GLib
* U8GLIB_ST7565_64128N : ST7565 128 x64 LCD with SPI interface via U8GLib
* U8GLIB_LM6059_AF : LM6059 with Hardware SPI via U8GLib
*/
2020-06-16 09:43:09 +02:00
# if EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
# define MINIPANEL
2021-02-17 03:29:55 +01:00
# elif ENABLED(YHCB2004)
# define IS_ULTIPANEL 1
2020-06-16 09:43:09 +02:00
# elif ENABLED(CARTESIO_UI)
2017-06-24 20:56:07 +02:00
2017-10-19 07:43:07 +02:00
# define DOGLCD
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2016-07-26 03:07:15 +02:00
2020-09-07 04:40:58 +02:00
# elif EITHER(DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE)
# define IS_DWIN_MARLINUI 1
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2020-09-07 04:40:58 +02:00
2017-12-16 02:05:57 +01:00
# elif ENABLED(ZONESTAR_LCD)
2017-06-10 07:12:18 +02:00
2020-10-15 10:00:27 +02:00
# define HAS_ADC_BUTTONS 1
2017-10-19 07:43:07 +02:00
# define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
# define ADC_KEY_NUM 8
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2017-06-10 07:12:18 +02:00
2020-10-15 10:00:27 +02:00
// This helps to implement HAS_ADC_BUTTONS menus
2018-11-22 13:00:00 +01:00
# define REVERSE_MENU_DIRECTION
2017-10-19 07:43:07 +02:00
# define ENCODER_PULSES_PER_STEP 1
# define ENCODER_STEPS_PER_MENU_ITEM 1
2017-11-05 03:22:53 +01:00
# define ENCODER_FEEDRATE_DEADZONE 2
2017-06-24 20:56:07 +02:00
2020-08-08 00:03:59 +02:00
# elif ENABLED(ZONESTAR_12864LCD)
# define DOGLCD
2020-10-15 10:00:27 +02:00
# define IS_RRD_SC 1
2020-08-08 00:03:59 +02:00
# define U8GLIB_ST7920
# elif ENABLED(ZONESTAR_12864OLED)
2020-10-15 10:00:27 +02:00
# define IS_RRD_SC 1
2020-08-08 00:03:59 +02:00
# define U8GLIB_SH1106
# elif ENABLED(ZONESTAR_12864OLED_SSD1306)
2020-10-15 10:00:27 +02:00
# define IS_RRD_SC 1
2020-08-08 00:03:59 +02:00
# define IS_U8GLIB_SSD1306
2018-01-05 17:10:55 +01:00
# elif ENABLED(RADDS_DISPLAY)
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2017-12-23 21:23:05 +01:00
# define ENCODER_PULSES_PER_STEP 2
2019-03-17 05:43:06 +01:00
# elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864)
2017-06-24 20:56:07 +02:00
2019-03-11 11:07:14 +01:00
# define DOGLCD
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2017-06-24 20:56:07 +02:00
2017-10-19 07:43:07 +02:00
# if ENABLED(miniVIKI)
# define U8GLIB_ST7565_64128N
# elif ENABLED(VIKI2)
# define U8GLIB_ST7565_64128N
# elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
# define U8GLIB_LM6059_AF
# elif ENABLED(AZSMZ_12864)
# define U8GLIB_ST7565_64128N
# endif
2017-06-24 20:56:07 +02:00
2017-10-19 07:43:07 +02:00
# elif ENABLED(OLED_PANEL_TINYBOY2)
2017-06-24 20:56:07 +02:00
2019-07-14 16:19:29 +02:00
# define IS_U8GLIB_SSD1306
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2017-06-24 20:56:07 +02:00
2017-10-19 07:43:07 +02:00
# elif ENABLED(RA_CONTROL_PANEL)
2017-10-09 22:58:02 +02:00
2017-10-19 07:43:07 +02:00
# define LCD_I2C_TYPE_PCA8574
# define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2017-10-09 22:58:02 +02:00
2017-10-19 07:43:07 +02:00
# elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
2017-10-09 22:58:02 +02:00
2017-10-19 07:43:07 +02:00
# define DOGLCD
# define U8GLIB_ST7920
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2016-07-26 03:07:15 +02:00
2017-10-19 07:43:07 +02:00
# elif ENABLED(MKS_12864OLED)
2017-10-09 22:58:02 +02:00
2020-10-15 10:00:27 +02:00
# define IS_RRD_SC 1
2017-10-19 07:43:07 +02:00
# define U8GLIB_SH1106
2017-10-09 22:58:02 +02:00
2017-12-17 01:47:04 +01:00
# elif ENABLED(MKS_12864OLED_SSD1306)
2020-10-15 10:00:27 +02:00
# define IS_RRD_SC 1
2019-07-14 16:19:29 +02:00
# define IS_U8GLIB_SSD1306
2017-12-17 01:47:04 +01:00
2020-07-03 03:33:52 +02:00
# elif ENABLED(FYSETC_242_OLED_12864)
2020-07-07 08:57:05 +02:00
2020-10-15 10:00:27 +02:00
# define IS_RRD_SC 1
2020-07-03 03:33:52 +02:00
# define U8GLIB_SH1106
2020-07-07 08:57:05 +02:00
2020-07-03 03:33:52 +02:00
# define LED_CONTROL_MENU
# define NEOPIXEL_LED
# undef NEOPIXEL_TYPE
# define NEOPIXEL_TYPE NEO_RGB
# if NEOPIXEL_PIXELS < 3
# undef NEOPIXELS_PIXELS
# define NEOPIXEL_PIXELS 3
# endif
# ifndef NEOPIXEL_BRIGHTNESS
# define NEOPIXEL_BRIGHTNESS 127
# endif
2020-07-07 08:57:05 +02:00
2020-07-03 03:33:52 +02:00
# if ENABLED(PSU_CONTROL)
# define LED_BACKLIGHT_TIMEOUT 10000
# endif
2020-01-17 20:16:05 +01:00
# elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1)
2019-04-10 01:34:29 +02:00
2019-05-02 03:05:29 +02:00
# define FYSETC_MINI_12864
2019-04-10 01:34:29 +02:00
# define DOGLCD
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2019-04-10 01:34:29 +02:00
# define LED_COLORS_REDUCE_GREEN
2019-10-22 22:43:37 +02:00
# if ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)
2019-06-13 04:59:39 +02:00
# define LED_BACKLIGHT_TIMEOUT 10000
# endif
2019-04-10 01:34:29 +02:00
2019-05-02 03:05:29 +02:00
// Require LED backlighting enabled
# if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
# define RGB_LED
# elif ENABLED(FYSETC_MINI_12864_2_1)
2019-09-30 09:11:58 +02:00
# define LED_CONTROL_MENU
2019-05-02 03:05:29 +02:00
# define NEOPIXEL_LED
2019-05-11 23:51:39 +02:00
# undef NEOPIXEL_TYPE
# define NEOPIXEL_TYPE NEO_RGB
2019-07-21 06:14:09 +02:00
# if NEOPIXEL_PIXELS < 3
# undef NEOPIXELS_PIXELS
# define NEOPIXEL_PIXELS 3
# endif
2019-05-11 23:51:39 +02:00
# ifndef NEOPIXEL_BRIGHTNESS
# define NEOPIXEL_BRIGHTNESS 127
# endif
2019-07-21 06:14:09 +02:00
//#define NEOPIXEL_STARTUP_TEST
2019-05-02 03:05:29 +02:00
# endif
2019-07-14 16:19:29 +02:00
# elif ENABLED(ULTI_CONTROLLER)
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2019-07-14 16:19:29 +02:00
# define U8GLIB_SSD1309
# define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin
# define ENCODER_PULSES_PER_STEP 2
# define ENCODER_STEPS_PER_MENU_ITEM 2
# elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602)
2020-10-15 10:00:27 +02:00
# define IS_RRD_SC 1
2019-07-14 16:19:29 +02:00
# define LCD_WIDTH 16
# define LCD_HEIGHT 2
2020-09-28 08:52:38 +02:00
# elif EITHER(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C)
# define IS_TFTGLCD_PANEL 1
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1 // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD
2020-09-28 08:52:38 +02:00
# if ENABLED(SDSUPPORT) && DISABLED(LCD_PROGRESS_BAR)
# define LCD_PROGRESS_BAR
# endif
# if ENABLED(TFTGLCD_PANEL_I2C)
# define LCD_I2C_ADDRESS 0x27 // Must be equal to panel's I2C slave addres
# endif
2020-10-10 12:01:46 +02:00
# define LCD_USE_I2C_BUZZER // Enable buzzer on LCD, used for both I2C and SPI buses (LiquidTWI2 not required)
2020-09-28 08:52:38 +02:00
# define STD_ENCODER_PULSES_PER_STEP 2
# define STD_ENCODER_STEPS_PER_MENU_ITEM 1
# define LCD_WIDTH 20 // 20 or 24 chars in line
# define LCD_HEIGHT 10 // Character lines
# define LCD_CONTRAST_MIN 127
# define LCD_CONTRAST_MAX 255
# define DEFAULT_LCD_CONTRAST 250
# define CONVERT_TO_EXT_ASCII // Use extended 128-255 symbols from ASCII table.
// At this time present conversion only for cyrillic - bg, ru and uk languages.
// First 7 ASCII symbols in panel font must be replaced with Marlin's special symbols.
2020-10-15 10:00:27 +02:00
# elif ENABLED(CR10_STOCKDISPLAY)
# define IS_RRD_FG_SC 1
# define BOARD_ST7920_DELAY_1 DELAY_NS(125)
# define BOARD_ST7920_DELAY_2 DELAY_NS(125)
# define BOARD_ST7920_DELAY_3 DELAY_NS(125)
2021-03-15 17:02:40 +01:00
# elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING, BQ_LCD_SMART_CONTROLLER, K3D_FULL_GRAPHIC_SMART_CONTROLLER)
2020-10-15 10:00:27 +02:00
# define IS_RRD_FG_SC 1
# elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
2021-03-15 17:02:40 +01:00
# define IS_RRD_SC 1 // RepRapDiscount LCD or Graphical LCD with rotary click encoder
# elif ENABLED(K3D_242_OLED_CONTROLLER)
2020-10-15 10:00:27 +02:00
# define IS_RRD_SC 1
2021-03-15 17:02:40 +01:00
# define U8GLIB_SSD1309
2020-10-15 10:00:27 +02:00
2019-07-14 16:19:29 +02:00
# endif
2020-10-15 10:00:27 +02:00
// ST7920-based graphical displays
# if ANY(IS_RRD_FG_SC, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER)
# define DOGLCD
# define U8GLIB_ST7920
# define IS_RRD_SC 1
2017-10-19 07:43:07 +02:00
# endif
2016-07-26 03:07:15 +02:00
2020-10-15 10:00:27 +02:00
// ST7565 / 64128N graphical displays
2019-03-17 05:43:06 +01:00
# if EITHER(MAKRPANEL, MINIPANEL)
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2017-10-19 07:43:07 +02:00
# define DOGLCD
2019-07-14 16:19:29 +02:00
# if ENABLED(MAKRPANEL)
# define U8GLIB_ST7565_64128N
# endif
2017-10-19 07:43:07 +02:00
# endif
2016-07-26 03:07:15 +02:00
2019-07-14 16:19:29 +02:00
# if ENABLED(IS_U8GLIB_SSD1306)
# define U8GLIB_SSD1306
2018-02-06 05:25:49 +01:00
# endif
2019-08-02 13:19:45 +02:00
# if ENABLED(OVERLORD_OLED)
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2019-08-02 13:19:45 +02:00
# define U8GLIB_SH1106
/**
* PCA9632 for buzzer and LEDs via i2c
* No auto - inc , red and green leds switched , buzzer
*/
# define PCA9632
# define PCA9632_NO_AUTO_INC
# define PCA9632_GRN 0x00
# define PCA9632_RED 0x02
# define PCA9632_BUZZER
# define PCA9632_BUZZER_DATA { 0x09, 0x02 }
# define ENCODER_PULSES_PER_STEP 1 // Overlord uses buttons
# define ENCODER_STEPS_PER_MENU_ITEM 1
# endif
2019-02-23 02:08:36 +01:00
// 128x64 I2C OLED LCDs - SSD1306/SSD1309/SH1106
2020-03-08 05:20:41 +01:00
# if ANY(U8GLIB_SSD1306, U8GLIB_SSD1309, U8GLIB_SH1106)
2020-09-07 04:40:58 +02:00
# define HAS_U8GLIB_I2C_OLED 1
2020-10-15 10:00:27 +02:00
# define IS_ULTRA_LCD 1
2019-02-23 02:08:36 +01:00
# define DOGLCD
2017-10-19 07:43:07 +02:00
# endif
2016-07-26 03:07:15 +02:00
2019-08-02 13:19:45 +02:00
/**
* SPI Ultipanels
*/
// Basic Ultipanel-like displays
2020-10-15 10:00:27 +02:00
# if ANY(ULTIMAKERCONTROLLER, IS_RRD_SC, G3D_PANEL, RIGIDBOT_PANEL, PANEL_ONE, U8GLIB_SH1106)
# define IS_ULTIPANEL 1
2017-10-19 07:43:07 +02:00
# endif
2016-07-26 03:07:15 +02:00
2019-08-02 13:19:45 +02:00
// Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h
# if ENABLED(U8GLIB_SH1106_EINSTART)
# define DOGLCD
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2019-08-02 13:19:45 +02:00
# endif
2018-07-26 12:52:22 +02:00
2020-10-15 10:00:27 +02:00
// TFT Compatibility
# if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI)
# define IS_LEGACY_TFT 1
2020-10-12 23:38:07 +02:00
# define TFT_GENERIC
2020-10-15 10:00:27 +02:00
# warning "Don't forget to update your TFT settings in Configuration.h."
# endif
# if ANY(FSMC_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_LVGL_UI_FSMC)
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
2020-10-15 10:00:27 +02:00
# elif ANY(SPI_GRAPHICAL_TFT, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_SPI)
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_SPI
2020-10-15 10:00:27 +02:00
# endif
# if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT)
# define TFT_CLASSIC_UI
# elif ANY(TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI)
# define TFT_COLOR_UI
# elif EITHER(TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI)
2020-10-12 23:38:07 +02:00
# define TFT_LVGL_UI
# endif
2020-07-30 08:43:19 +02:00
// FSMC/SPI TFT Panels (LVGL)
2020-10-12 23:38:07 +02:00
# if ENABLED(TFT_LVGL_UI)
2020-07-25 07:52:07 +02:00
# define HAS_TFT_LVGL_UI 1
2021-01-28 09:02:06 +01:00
# define SERIAL_RUNTIME_HOOK 1
2020-07-25 07:52:07 +02:00
# endif
2019-08-02 13:19:45 +02:00
// FSMC/SPI TFT Panels
2020-10-12 23:38:07 +02:00
# if ENABLED(TFT_CLASSIC_UI)
2020-07-30 04:25:07 +02:00
# define TFT_SCALED_DOGLCD 1
# endif
# if TFT_SCALED_DOGLCD
2019-08-02 13:19:45 +02:00
# define DOGLCD
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2019-08-02 13:19:45 +02:00
# define DELAYED_BACKLIGHT_INIT
2020-10-21 19:45:27 +02:00
# elif HAS_TFT_LVGL_UI
2020-06-16 04:05:33 +02:00
# define DELAYED_BACKLIGHT_INIT
2019-08-02 13:19:45 +02:00
# endif
2019-01-03 17:38:39 +01:00
2020-08-22 01:54:21 +02:00
// Color UI
2020-10-12 23:38:07 +02:00
# if ENABLED(TFT_COLOR_UI)
2020-07-30 08:43:19 +02:00
# define HAS_GRAPHICAL_TFT 1
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2020-07-30 08:43:19 +02:00
# endif
2017-10-19 07:43:07 +02:00
/**
2019-08-02 13:19:45 +02:00
* I2C Panels
2017-10-19 07:43:07 +02:00
*/
2017-06-24 20:56:07 +02:00
2019-03-17 05:43:06 +01:00
# if EITHER(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004)
2016-08-03 00:54:33 +02:00
2017-10-19 07:43:07 +02:00
# define LCD_I2C_TYPE_PCF8575
# define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
2018-02-21 07:46:25 +01:00
# if ENABLED(LCD_SAINSMART_I2C_2004)
# define LCD_WIDTH 20
# define LCD_HEIGHT 4
# endif
2017-09-27 06:34:09 +02:00
2017-10-19 07:43:07 +02:00
# elif ENABLED(LCD_I2C_PANELOLU2)
2017-09-27 06:34:09 +02:00
2017-10-19 07:43:07 +02:00
// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
2017-09-27 06:34:09 +02:00
2017-10-19 07:43:07 +02:00
# define LCD_I2C_TYPE_MCP23017
# define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
2018-02-21 07:46:25 +01:00
# define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional)
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2016-07-26 03:07:15 +02:00
2017-10-19 07:43:07 +02:00
# elif ENABLED(LCD_I2C_VIKI)
/**
* Panucatt VIKI LCD with status LEDs , integrated click & L / R / U / P buttons , separate encoder inputs
*
* This uses the LiquidTWI2 library v1 .2 .3 or later ( https : //github.com/lincomatic/LiquidTWI2 )
* Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory .
* Note : The pause / stop / resume LCD button pin should be connected to the Arduino
* BTN_ENC pin ( or set BTN_ENC to - 1 if not used )
*/
# define LCD_I2C_TYPE_MCP23017
# define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
2018-02-21 07:46:25 +01:00
# define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2017-10-19 07:43:07 +02:00
# define ENCODER_FEEDRATE_DEADZONE 4
# define STD_ENCODER_PULSES_PER_STEP 1
# define STD_ENCODER_STEPS_PER_MENU_ITEM 2
# elif ENABLED(G3D_PANEL)
# define STD_ENCODER_PULSES_PER_STEP 2
# define STD_ENCODER_STEPS_PER_MENU_ITEM 1
2020-10-15 10:00:27 +02:00
# elif ANY(IS_RRD_SC, miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2)
2019-03-17 05:43:06 +01:00
2017-10-19 07:43:07 +02:00
# define STD_ENCODER_PULSES_PER_STEP 4
# define STD_ENCODER_STEPS_PER_MENU_ITEM 1
2019-03-17 05:43:06 +01:00
2017-10-19 07:43:07 +02:00
# endif
2021-06-08 14:51:28 +02:00
# if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && DISABLED(NO_LCD_DETECT)
# define DETECT_I2C_LCD_DEVICE 1
# endif
2017-10-19 07:43:07 +02:00
# ifndef STD_ENCODER_PULSES_PER_STEP
2020-07-30 08:43:19 +02:00
# if ENABLED(TOUCH_SCREEN)
2019-12-06 07:47:50 +01:00
# define STD_ENCODER_PULSES_PER_STEP 2
2019-09-04 20:13:05 +02:00
# else
# define STD_ENCODER_PULSES_PER_STEP 5
# endif
2017-10-19 07:43:07 +02:00
# endif
# ifndef STD_ENCODER_STEPS_PER_MENU_ITEM
# define STD_ENCODER_STEPS_PER_MENU_ITEM 1
# endif
# ifndef ENCODER_PULSES_PER_STEP
# define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP
# endif
# ifndef ENCODER_STEPS_PER_MENU_ITEM
# define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM
# endif
# ifndef ENCODER_FEEDRATE_DEADZONE
# define ENCODER_FEEDRATE_DEADZONE 6
# endif
// Shift register panels
// ---------------------
// 2 wire Non-latching LCD SR from:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
2019-01-14 21:29:55 +01:00
# if ENABLED(FF_INTERFACEBOARD)
# define SR_LCD_3W_NL // Non latching 3 wire shift register
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
2019-07-14 16:19:29 +02:00
# elif ENABLED(SAV_3DLCD)
# define SR_LCD_2W_NL // Non latching 2 wire shift register
2020-10-15 10:00:27 +02:00
# define IS_ULTIPANEL 1
# elif ENABLED(ULTIPANEL)
# define IS_ULTIPANEL 1
2019-01-14 21:29:55 +01:00
# endif
2017-10-19 07:43:07 +02:00
2020-10-15 10:00:27 +02:00
# if EITHER(IS_ULTIPANEL, ULTRA_LCD)
# define IS_ULTRA_LCD 1
2017-10-19 07:43:07 +02:00
# endif
2020-10-15 10:00:27 +02:00
# if EITHER(IS_ULTIPANEL, REPRAPWORLD_KEYPAD)
# define IS_NEWPANEL 1
2019-07-14 16:19:29 +02:00
# endif
2020-10-15 10:00:27 +02:00
# if EITHER(ZONESTAR_LCD, REPRAPWORLD_KEYPAD)
# define IS_RRW_KEYPAD 1
2019-07-14 16:19:29 +02:00
# ifndef REPRAPWORLD_KEYPAD_MOVE_STEP
# define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
# endif
# endif
2020-03-11 09:40:30 +01:00
// Aliases for LCD features
2021-02-28 00:35:32 +01:00
# if ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY,DGUS_LCD_UI_MKS)
2020-03-08 05:20:41 +01:00
# define HAS_DGUS_LCD 1
# endif
2020-04-25 05:35:46 +02:00
// Extensible UI serial touch screens. (See src/lcd/extui)
2021-03-19 02:51:19 +01:00
# if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT)
2020-10-15 10:00:27 +02:00
# define IS_EXTUI 1
2019-05-08 03:32:50 +02:00
# define EXTENSIBLE_UI
# endif
2018-10-23 23:00:34 +02:00
// Aliases for LCD features
2020-10-15 10:00:27 +02:00
# if EITHER(IS_ULTRA_LCD, EXTENSIBLE_UI)
2020-03-08 05:20:41 +01:00
# define HAS_DISPLAY 1
2020-07-30 08:43:19 +02:00
# endif
2020-10-15 10:00:27 +02:00
# if IS_ULTRA_LCD
2020-09-28 08:13:27 +02:00
# define HAS_WIRED_LCD 1
2020-07-30 08:43:19 +02:00
# if ENABLED(DOGLCD)
2020-09-28 08:13:27 +02:00
# define HAS_MARLINUI_U8GLIB 1
2020-09-28 08:52:38 +02:00
# elif IS_TFTGLCD_PANEL
// Neither DOGM nor HD44780. Fully customized interface.
2020-07-30 08:43:19 +02:00
# elif DISABLED(HAS_GRAPHICAL_TFT)
2020-09-28 08:13:27 +02:00
# define HAS_MARLINUI_HD44780 1
2020-03-08 05:20:41 +01:00
# endif
# endif
2021-03-24 16:12:57 +01:00
# if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD, GLOBAL_STATUS_MESSAGE)
2020-11-23 01:44:17 +01:00
# define HAS_STATUS_MESSAGE 1
# endif
2020-10-15 10:00:27 +02:00
# if IS_ULTIPANEL && DISABLED(NO_LCD_MENUS)
2020-03-08 05:20:41 +01:00
# define HAS_LCD_MENU 1
# endif
2018-11-21 04:39:30 +01:00
2020-09-28 08:13:27 +02:00
# if HAS_MARLINUI_U8GLIB
2020-02-23 04:36:12 +01:00
# ifndef LCD_PIXEL_WIDTH
# define LCD_PIXEL_WIDTH 128
# endif
# ifndef LCD_PIXEL_HEIGHT
# define LCD_PIXEL_HEIGHT 64
# endif
# endif
2020-11-18 08:27:21 +01:00
/**
* Multi - Material - Unit supported models
*/
2021-03-30 04:14:11 +02:00
# define PRUSA_MMU1 1
# define PRUSA_MMU2 2
# define PRUSA_MMU2S 3
# define EXTENDABLE_EMU_MMU2 12
# define EXTENDABLE_EMU_MMU2S 13
2020-11-18 08:27:21 +01:00
# ifdef MMU_MODEL
# define HAS_MMU 1
# if MMU_MODEL == PRUSA_MMU1
# define HAS_PRUSA_MMU1 1
# elif MMU_MODEL % 10 == PRUSA_MMU2
# define HAS_PRUSA_MMU2 1
# elif MMU_MODEL % 10 == PRUSA_MMU2S
# define HAS_PRUSA_MMU2 1
# define HAS_PRUSA_MMU2S 1
# endif
2021-06-05 03:02:37 +02:00
# if MMU_MODEL >= EXTENDABLE_EMU_MMU2
2021-03-30 04:14:11 +02:00
# define HAS_EXTENDABLE_MMU 1
2020-11-18 08:27:21 +01:00
# endif
# endif
# undef PRUSA_MMU1
# undef PRUSA_MMU2
# undef PRUSA_MMU2S
2021-03-30 04:14:11 +02:00
# undef EXTENDABLE_EMU_MMU2
# undef EXTENDABLE_EMU_MMU2S
2020-11-18 08:27:21 +01:00
2017-10-19 07:43:07 +02:00
/**
* Extruders have some combination of stepper motors and hotends
* so we separate these concepts into the defines :
*
* EXTRUDERS - Number of Selectable Tools
* HOTENDS - Number of hotends , whether connected or separate
* E_STEPPERS - Number of actual E stepper motors
* E_MANUAL - Number of E steppers for LCD move options
*/
2021-05-21 15:23:09 +02:00
# if EXTRUDERS
# define HAS_EXTRUDERS 1
# if EXTRUDERS > 1
# define HAS_MULTI_EXTRUDER 1
# endif
2021-05-24 23:38:57 +02:00
# define E_AXIS_N(E) AxisEnum(E_AXIS + E_INDEX_N(E))
2021-05-21 15:23:09 +02:00
# else
2020-04-27 11:41:18 +02:00
# undef EXTRUDERS
# define EXTRUDERS 0
2019-03-01 08:51:24 +01:00
# undef SINGLENOZZLE
# undef SWITCHING_EXTRUDER
# undef SWITCHING_NOZZLE
# undef MIXING_EXTRUDER
2020-05-18 07:50:35 +02:00
# undef HOTEND_IDLE_TIMEOUT
2021-05-24 23:38:57 +02:00
# undef DISABLE_E
2019-03-01 08:51:24 +01:00
# endif
2019-02-01 02:10:52 +01:00
# if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS
2018-02-19 17:59:23 +01:00
# if EXTRUDERS > 4
# define E_STEPPERS 3
# elif EXTRUDERS > 2
# define E_STEPPERS 2
2017-09-06 13:28:32 +02:00
# else
2018-02-19 17:59:23 +01:00
# define E_STEPPERS 1
2017-09-06 13:28:32 +02:00
# endif
2018-05-29 18:05:52 +02:00
# if DISABLED(SWITCHING_NOZZLE)
# define HOTENDS E_STEPPERS
# endif
2018-02-19 17:59:23 +01:00
# elif ENABLED(MIXING_EXTRUDER)
# define E_STEPPERS MIXING_STEPPERS
# define E_MANUAL 1
2020-04-22 23:35:03 +02:00
# if MIXING_STEPPERS == 2
# define HAS_DUAL_MIXING 1
# endif
2018-09-08 08:43:24 +02:00
# elif ENABLED(SWITCHING_TOOLHEAD)
2018-02-19 17:59:23 +01:00
# define E_STEPPERS EXTRUDERS
# define E_MANUAL EXTRUDERS
2020-11-18 08:27:21 +01:00
# elif HAS_PRUSA_MMU2
2019-02-01 02:10:52 +01:00
# define E_STEPPERS 1
2017-10-19 07:43:07 +02:00
# endif
2017-09-06 13:28:32 +02:00
2020-11-18 08:27:21 +01:00
// No inactive extruders with SWITCHING_NOZZLE or Průša MMU1
# if ENABLED(SWITCHING_NOZZLE) || HAS_PRUSA_MMU1
2018-07-02 23:54:52 +02:00
# undef DISABLE_INACTIVE_EXTRUDER
# endif
2021-03-30 04:14:11 +02:00
// Průša MMU1, MMU(S) 2.0 and EXTENDABLE_EMU_MMU2(S) force SINGLENOZZLE
2020-11-18 08:27:21 +01:00
# if HAS_MMU
2018-07-02 23:54:52 +02:00
# define SINGLENOZZLE
# endif
2019-03-17 05:43:06 +01:00
# if EITHER(SINGLENOZZLE, MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset
2018-05-28 00:56:21 +02:00
# undef HOTENDS
# define HOTENDS 1
# undef HOTEND_OFFSET_X
# undef HOTEND_OFFSET_Y
# endif
# ifndef HOTENDS
# define HOTENDS EXTRUDERS
# endif
2018-09-08 08:43:24 +02:00
# ifndef E_STEPPERS
# define E_STEPPERS EXTRUDERS
# endif
# ifndef E_MANUAL
# define E_MANUAL EXTRUDERS
# endif
2021-05-24 23:38:57 +02:00
/**
* Number of Linear Axes ( e . g . , XYZ )
* All the logical axes except for the tool ( E ) axis
*/
# ifndef LINEAR_AXES
# define LINEAR_AXES XYZ
# endif
2021-06-05 09:18:47 +02:00
# if LINEAR_AXES >= XY
# define HAS_Y_AXIS 1
# if LINEAR_AXES >= XYZ
# define HAS_Z_AXIS 1
# endif
# endif
2021-05-24 23:38:57 +02:00
/**
* Number of Logical Axes ( e . g . , XYZE )
* All the logical axes that can be commanded directly by G - code .
* Delta maps stepper - specific values to ABC steppers .
*/
# if HAS_EXTRUDERS
# define LOGICAL_AXES INCREMENT(LINEAR_AXES)
# else
# define LOGICAL_AXES LINEAR_AXES
# endif
/**
* DISTINCT_E_FACTORS is set to give extruders ( some ) individual settings .
*
* DISTINCT_AXES is the number of distinct addressable axes ( not steppers ) .
* Includes all linear axes plus all distinguished extruders .
* The default behavior is to treat all extruders as a single E axis
* with shared motion and temperature settings .
*
* DISTINCT_E is the number of distinguished extruders . By default this
* well be 1 which indicates all extruders share the same settings .
*
* E_INDEX_N ( E ) should be used to get the E index of any item that might be
* distinguished .
*/
# if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
# define DISTINCT_AXES (LINEAR_AXES + E_STEPPERS)
# define DISTINCT_E E_STEPPERS
# define E_INDEX_N(E) (E)
# else
# undef DISTINCT_E_FACTORS
# define DISTINCT_AXES LOGICAL_AXES
# define DISTINCT_E 1
# define E_INDEX_N(E) 0
# endif
2020-04-20 06:56:55 +02:00
# if HOTENDS
# define HAS_HOTEND 1
2020-04-27 11:48:11 +02:00
# ifndef HOTEND_OVERSHOOT
# define HOTEND_OVERSHOOT 15
# endif
2020-04-27 11:49:31 +02:00
# if HOTENDS > 1
2020-04-20 06:56:55 +02:00
# define HAS_MULTI_HOTEND 1
# define HAS_HOTEND_OFFSET 1
# endif
2020-07-01 23:18:20 +02:00
# else
# undef PID_PARAMS_PER_HOTEND
2020-04-20 06:56:55 +02:00
# endif
2020-02-29 11:14:40 +01:00
// Helper macros for extruder and hotend arrays
2018-07-02 23:54:52 +02:00
# define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
2020-02-29 11:14:40 +01:00
# define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V)
2021-05-11 11:01:21 +02:00
# define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1)
2020-02-29 11:14:40 +01:00
# define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
2021-05-11 11:01:21 +02:00
# define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1)
2018-07-02 23:54:52 +02:00
2020-02-29 11:14:40 +01:00
/**
* Default hotend offsets , if not defined
*/
# if HAS_HOTEND_OFFSET
# ifndef HOTEND_OFFSET_X
# define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
# endif
# ifndef HOTEND_OFFSET_Y
# define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
# endif
# ifndef HOTEND_OFFSET_Z
# define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
# endif
# endif
2021-05-01 10:21:18 +02:00
/**
* Disable unused SINGLENOZZLE sub - options
*/
# if DISABLED(SINGLENOZZLE)
# undef SINGLENOZZLE_STANDBY_TEMP
# endif
# if !BOTH(HAS_FAN, SINGLENOZZLE)
# undef SINGLENOZZLE_STANDBY_FAN
# endif
2021-05-24 23:38:57 +02:00
// Switching extruder has its own servo?
# if ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)
# define DO_SWITCH_EXTRUDER 1
2017-10-19 07:43:07 +02:00
# endif
2016-08-02 06:13:13 +02:00
2017-10-19 07:43:07 +02:00
/**
* The BLTouch Probe emulates a servo probe
* and uses " special " angles for its state .
*/
# if ENABLED(BLTOUCH)
2018-04-02 06:54:12 +02:00
# ifndef Z_PROBE_SERVO_NR
# define Z_PROBE_SERVO_NR 0
2016-12-04 05:02:27 +01:00
# endif
2021-06-07 21:09:12 +02:00
# ifdef DEACTIVATE_SERVOS_AFTER_MOVE
# warning "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Undefining DEACTIVATE_SERVOS_AFTER_MOVE. Please update your Configuration.h file."
# undef DEACTIVATE_SERVOS_AFTER_MOVE
# endif
2017-10-19 07:43:07 +02:00
// Always disable probe pin inverting for BLTouch
2021-06-07 21:09:12 +02:00
# if Z_MIN_PROBE_ENDSTOP_INVERTING
# warning "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false. Resetting Z_MIN_PROBE_ENDSTOP_INVERTING to false. Please update your Configuration.h file."
# undef Z_MIN_PROBE_ENDSTOP_INVERTING
# define Z_MIN_PROBE_ENDSTOP_INVERTING false
# endif
2017-10-19 07:43:07 +02:00
# if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
2021-06-07 21:09:12 +02:00
# if Z_MIN_ENDSTOP_INVERTING
# warning "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to false. Resetting Z_MIN_ENDSTOP_INVERTING to false. Please update your Configuration.h file."
# undef Z_MIN_ENDSTOP_INVERTING
# define Z_MIN_ENDSTOP_INVERTING false
# endif
2017-10-19 07:43:07 +02:00
# endif
# endif
2017-05-19 13:50:01 +02:00
2017-10-19 07:43:07 +02:00
/**
2020-02-11 16:05:45 +01:00
* Set a flag for a servo probe ( or BLTouch )
2017-10-19 07:43:07 +02:00
*/
2020-10-07 01:36:01 +02:00
# ifdef Z_PROBE_SERVO_NR
2020-03-08 05:20:41 +01:00
# define HAS_Z_SERVO_PROBE 1
# endif
2020-05-12 06:25:39 +02:00
# if ANY(HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE)
2020-03-08 05:20:41 +01:00
# define HAS_SERVO_ANGLES 1
# endif
2020-02-26 13:26:54 +01:00
# if !HAS_SERVO_ANGLES
# undef EDITABLE_SERVO_ANGLES
# endif
2016-08-22 22:02:19 +02:00
2017-10-19 07:43:07 +02:00
/**
2018-04-27 07:44:47 +02:00
* Set flags for enabled probes
2017-10-19 07:43:07 +02:00
*/
2020-03-08 05:20:41 +01:00
# if ANY(HAS_Z_SERVO_PROBE, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, SOLENOID_PROBE, SENSORLESS_PROBING, RACK_AND_PINION_PROBE)
# define HAS_BED_PROBE 1
# endif
2021-05-24 23:38:57 +02:00
/**
* Fill in undefined Filament Sensor options
*/
2020-11-11 07:39:23 +01:00
# if ENABLED(FILAMENT_RUNOUT_SENSOR)
# if NUM_RUNOUT_SENSORS >= 1
# ifndef FIL_RUNOUT1_STATE
# define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE
# endif
2020-11-22 00:56:56 +01:00
# ifndef FIL_RUNOUT1_PULLUP
# define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP
# endif
# ifndef FIL_RUNOUT1_PULLDOWN
# define FIL_RUNOUT1_PULLDOWN FIL_RUNOUT_PULLDOWN
2020-11-11 07:39:23 +01:00
# endif
# endif
# if NUM_RUNOUT_SENSORS >= 2
# ifndef FIL_RUNOUT2_STATE
# define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE
# endif
2020-11-22 00:56:56 +01:00
# ifndef FIL_RUNOUT2_PULLUP
# define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP
# endif
# ifndef FIL_RUNOUT2_PULLDOWN
# define FIL_RUNOUT2_PULLDOWN FIL_RUNOUT_PULLDOWN
2020-11-11 07:39:23 +01:00
# endif
# endif
# if NUM_RUNOUT_SENSORS >= 3
# ifndef FIL_RUNOUT3_STATE
# define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE
# endif
2020-11-22 00:56:56 +01:00
# ifndef FIL_RUNOUT3_PULLUP
# define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP
# endif
# ifndef FIL_RUNOUT3_PULLDOWN
# define FIL_RUNOUT3_PULLDOWN FIL_RUNOUT_PULLDOWN
2020-11-11 07:39:23 +01:00
# endif
# endif
# if NUM_RUNOUT_SENSORS >= 4
# ifndef FIL_RUNOUT4_STATE
# define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE
# endif
2020-11-22 00:56:56 +01:00
# ifndef FIL_RUNOUT4_PULLUP
# define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP
# endif
# ifndef FIL_RUNOUT4_PULLDOWN
# define FIL_RUNOUT4_PULLDOWN FIL_RUNOUT_PULLDOWN
2020-11-11 07:39:23 +01:00
# endif
# endif
# if NUM_RUNOUT_SENSORS >= 5
# ifndef FIL_RUNOUT5_STATE
# define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE
# endif
2020-11-22 00:56:56 +01:00
# ifndef FIL_RUNOUT5_PULLUP
# define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP
# endif
# ifndef FIL_RUNOUT5_PULLDOWN
# define FIL_RUNOUT5_PULLDOWN FIL_RUNOUT_PULLDOWN
2020-11-11 07:39:23 +01:00
# endif
# endif
# if NUM_RUNOUT_SENSORS >= 6
# ifndef FIL_RUNOUT6_STATE
# define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE
# endif
2020-11-22 00:56:56 +01:00
# ifndef FIL_RUNOUT6_PULLUP
# define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP
# endif
# ifndef FIL_RUNOUT6_PULLDOWN
# define FIL_RUNOUT6_PULLDOWN FIL_RUNOUT_PULLDOWN
2020-11-11 07:39:23 +01:00
# endif
# endif
# if NUM_RUNOUT_SENSORS >= 7
# ifndef FIL_RUNOUT7_STATE
# define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE
# endif
2020-11-22 00:56:56 +01:00
# ifndef FIL_RUNOUT7_PULLUP
# define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP
# endif
# ifndef FIL_RUNOUT7_PULLDOWN
# define FIL_RUNOUT7_PULLDOWN FIL_RUNOUT_PULLDOWN
2020-11-11 07:39:23 +01:00
# endif
# endif
# if NUM_RUNOUT_SENSORS >= 8
# ifndef FIL_RUNOUT8_STATE
# define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE
# endif
2020-11-22 00:56:56 +01:00
# ifndef FIL_RUNOUT8_PULLUP
# define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP
# endif
# ifndef FIL_RUNOUT8_PULLDOWN
# define FIL_RUNOUT8_PULLDOWN FIL_RUNOUT_PULLDOWN
2020-11-11 07:39:23 +01:00
# endif
# endif
# endif // FILAMENT_RUNOUT_SENSOR
2021-05-19 07:21:34 +02:00
// Homing to Min or Max
# if X_HOME_DIR > 0
# define X_HOME_TO_MAX 1
# elif X_HOME_DIR < 0
# define X_HOME_TO_MIN 1
# endif
# if Y_HOME_DIR > 0
# define Y_HOME_TO_MAX 1
# elif Y_HOME_DIR < 0
# define Y_HOME_TO_MIN 1
# endif
# if Z_HOME_DIR > 0
# define Z_HOME_TO_MAX 1
# elif Z_HOME_DIR < 0
# define Z_HOME_TO_MIN 1
# endif
2021-06-05 09:18:47 +02:00
# if I_HOME_DIR > 0
# define I_HOME_TO_MAX 1
# elif I_HOME_DIR < 0
# define I_HOME_TO_MIN 1
# endif
# if J_HOME_DIR > 0
# define J_HOME_TO_MAX 1
# elif J_HOME_DIR < 0
# define J_HOME_TO_MIN 1
# endif
# if K_HOME_DIR > 0
# define K_HOME_TO_MAX 1
# elif K_HOME_DIR < 0
# define K_HOME_TO_MIN 1
# endif
2021-05-19 07:21:34 +02:00
2021-05-24 23:38:57 +02:00
/**
* Conditionals based on the type of Bed Probe
*/
2018-11-05 07:20:13 +01:00
# if HAS_BED_PROBE
2020-03-08 05:20:41 +01:00
# if DISABLED(NOZZLE_AS_PROBE)
# define HAS_PROBE_XY_OFFSET 1
# endif
2021-05-19 06:30:49 +02:00
# if DISABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) && !BOTH(DELTA, SENSORLESS_PROBING)
2020-03-08 05:20:41 +01:00
# define HAS_CUSTOM_PROBE_PIN 1
# endif
2021-05-19 07:21:34 +02:00
# if Z_HOME_TO_MIN && (!HAS_CUSTOM_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING))
2020-03-08 05:20:41 +01:00
# define HOMING_Z_WITH_PROBE 1
# endif
2018-11-05 07:20:13 +01:00
# ifndef Z_PROBE_LOW_POINT
# define Z_PROBE_LOW_POINT -5
# endif
# if ENABLED(Z_PROBE_ALLEN_KEY)
2020-03-08 05:20:41 +01:00
# define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe
2018-11-05 07:20:13 +01:00
# endif
2020-03-08 05:20:41 +01:00
# if MULTIPLE_PROBING > 1
2020-05-10 11:40:19 +02:00
# if EXTRA_PROBING > 0
2019-06-22 02:02:26 +02:00
# define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING)
# else
# define TOTAL_PROBING MULTIPLE_PROBING
# endif
# endif
2018-11-05 07:20:13 +01:00
# else
2018-04-27 07:44:47 +02:00
// Clear probe pin settings when no probe is selected
2017-10-19 07:43:07 +02:00
# undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
2020-12-29 06:10:48 +01:00
# undef USE_PROBE_FOR_Z_HOMING
2017-10-19 07:43:07 +02:00
# endif
2021-05-19 07:21:34 +02:00
# if Z_HOME_TO_MAX
2020-11-11 23:58:34 +01:00
# define HOME_Z_FIRST // If homing away from BED do Z first
# endif
2020-03-14 05:18:16 +01:00
/**
2021-05-24 23:38:57 +02:00
* Conditionals based on the type of Bed Leveling
2020-03-14 05:18:16 +01:00
*/
# if ENABLED(AUTO_BED_LEVELING_UBL)
# undef LCD_BED_LEVELING
# if ENABLED(DELTA)
# define UBL_SEGMENTED 1
# endif
# endif
# if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT)
# define ABL_PLANAR 1
# endif
# if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)
2021-03-31 04:54:34 +02:00
# define ABL_USES_GRID 1
2020-03-14 05:18:16 +01:00
# endif
# if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_3POINT)
# define HAS_ABL_NOT_UBL 1
# endif
# if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
# define HAS_MESH 1
# endif
# if EITHER(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT)
# define NEEDS_THREE_PROBE_POINTS 1
# endif
# if EITHER(HAS_ABL_NOT_UBL, AUTO_BED_LEVELING_UBL)
# define HAS_ABL_OR_UBL 1
# if DISABLED(PROBE_MANUALLY)
# define HAS_AUTOLEVEL 1
# endif
# endif
# if EITHER(HAS_ABL_OR_UBL, MESH_BED_LEVELING)
# define HAS_LEVELING 1
# if DISABLED(AUTO_BED_LEVELING_UBL)
# define PLANNER_LEVELING 1
# endif
# endif
# if !HAS_LEVELING
# undef RESTORE_LEVELING_AFTER_G28
2020-12-22 14:01:24 +01:00
# undef ENABLE_LEVELING_AFTER_G28
2021-05-15 05:29:17 +02:00
# undef G29_RETRY_AND_RECOVER
2020-03-14 05:18:16 +01:00
# endif
2021-04-25 10:48:20 +02:00
# if !HAS_LEVELING || EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
# undef PROBE_MANUALLY
# endif
# if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING)
# define PROBE_SELECTED 1
# endif
2020-03-14 05:18:16 +01:00
2018-11-03 08:13:10 +01:00
# ifdef GRID_MAX_POINTS_X
# define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
2020-03-14 05:18:16 +01:00
# define GRID_LOOP(A,B) LOOP_L_N(A, GRID_MAX_POINTS_X) LOOP_L_N(B, GRID_MAX_POINTS_Y)
2018-11-03 08:13:10 +01:00
# endif
2020-10-19 10:16:02 +02:00
// Slim menu optimizations
2019-04-11 00:14:57 +02:00
# if ENABLED(SLIM_LCD_MENUS)
# define BOOT_MARLIN_LOGO_SMALL
# endif
2019-04-20 03:11:51 +02:00
2020-11-02 03:30:58 +01:00
/**
* CoreXY , CoreXZ , and CoreYZ - and their reverse
*/
# if EITHER(COREXY, COREYX)
# define CORE_IS_XY 1
# endif
# if EITHER(COREXZ, COREZX)
# define CORE_IS_XZ 1
# endif
# if EITHER(COREYZ, COREZY)
# define CORE_IS_YZ 1
# endif
# if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ
# define IS_CORE 1
# endif
# if IS_CORE
# if CORE_IS_XY
# define CORE_AXIS_1 A_AXIS
# define CORE_AXIS_2 B_AXIS
# define NORMAL_AXIS Z_AXIS
# elif CORE_IS_XZ
# define CORE_AXIS_1 A_AXIS
# define NORMAL_AXIS Y_AXIS
# define CORE_AXIS_2 C_AXIS
# elif CORE_IS_YZ
# define NORMAL_AXIS X_AXIS
# define CORE_AXIS_1 B_AXIS
# define CORE_AXIS_2 C_AXIS
# endif
# define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n))
# elif ENABLED(MARKFORGED_XY)
// Markforged kinematics
# define CORE_AXIS_1 A_AXIS
# define CORE_AXIS_2 B_AXIS
# define NORMAL_AXIS Z_AXIS
# endif
2021-04-24 07:11:11 +02:00
# if ANY(MORGAN_SCARA, MP_SCARA, AXEL_TPARA)
2020-11-02 03:30:58 +01:00
# define IS_SCARA 1
# define IS_KINEMATIC 1
# elif ENABLED(DELTA)
# define IS_KINEMATIC 1
# else
# define IS_CARTESIAN 1
# if !IS_CORE
# define IS_FULL_CARTESIAN 1
# endif
# endif
2021-06-10 09:05:04 +02:00
# if DISABLED(DELTA)
# undef DELTA_HOME_TO_SAFE_ZONE
# endif
2020-02-29 11:14:40 +01:00
// This flag indicates some kind of jerk storage is needed
2020-05-12 06:25:39 +02:00
# if EITHER(CLASSIC_JERK, IS_KINEMATIC)
2020-03-08 05:20:41 +01:00
# define HAS_CLASSIC_JERK 1
# endif
2020-02-29 11:14:40 +01:00
2020-04-24 03:49:11 +02:00
# if DISABLED(CLASSIC_JERK)
# define HAS_JUNCTION_DEVIATION 1
# endif
2020-02-29 11:14:40 +01:00
// E jerk exists with JD disabled (of course) but also when Linear Advance is disabled on Delta/SCARA
2020-03-08 05:20:41 +01:00
# if ENABLED(CLASSIC_JERK) || (IS_KINEMATIC && DISABLED(LIN_ADVANCE))
# define HAS_CLASSIC_E_JERK 1
# endif
2019-10-10 02:44:49 +02:00
2021-03-14 18:11:11 +01:00
//
// Serial Port Info
//
# ifdef SERIAL_PORT_2
# define HAS_MULTI_SERIAL 1
2021-05-07 07:31:45 +02:00
# ifdef SERIAL_PORT_3
# define NUM_SERIAL 3
# else
# define NUM_SERIAL 2
# endif
2021-03-14 18:11:11 +01:00
# elif defined(SERIAL_PORT)
# define NUM_SERIAL 1
# else
# define NUM_SERIAL 0
# undef BAUD_RATE_GCODE
# endif
2021-05-07 07:31:45 +02:00
# if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1 || SERIAL_PORT_3 == -1
2020-03-23 23:55:21 +01:00
# define HAS_USB_SERIAL 1
# endif
2020-10-20 21:35:29 +02:00
# if SERIAL_PORT_2 == -2
# define HAS_ETHERNET 1
# endif
2020-03-23 23:55:21 +01:00
2021-03-14 18:11:11 +01:00
# if ENABLED(DWIN_CREALITY_LCD)
# define SERIAL_CATCHALL 0
# ifndef LCD_SERIAL_PORT
# define LCD_SERIAL_PORT 3 // Creality 4.x board
# endif
# endif
2020-10-20 22:01:46 +02:00
// Fallback Stepper Driver types that don't depend on Configuration_adv.h
2020-10-19 10:16:02 +02:00
# ifndef X_DRIVER_TYPE
2020-10-20 22:01:46 +02:00
# define X_DRIVER_TYPE A4988
2020-10-19 10:16:02 +02:00
# endif
2020-10-20 22:01:46 +02:00
# ifndef X2_DRIVER_TYPE
2020-10-19 10:16:02 +02:00
# define X2_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# ifndef Y_DRIVER_TYPE
# define Y_DRIVER_TYPE A4988
# endif
# ifndef Y2_DRIVER_TYPE
2020-10-19 10:16:02 +02:00
# define Y2_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# ifndef Z_DRIVER_TYPE
# define Z_DRIVER_TYPE A4988
# endif
# ifndef Z2_DRIVER_TYPE
2020-10-19 10:16:02 +02:00
# define Z2_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# ifndef Z3_DRIVER_TYPE
2020-10-19 10:16:02 +02:00
# define Z3_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# ifndef Z4_DRIVER_TYPE
2020-10-19 10:16:02 +02:00
# define Z4_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# if E_STEPPERS <= 0
2020-10-19 10:16:02 +02:00
# undef E0_DRIVER_TYPE
# elif !defined(E0_DRIVER_TYPE)
# define E0_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# if E_STEPPERS <= 1
2020-10-19 10:16:02 +02:00
# undef E1_DRIVER_TYPE
# elif !defined(E1_DRIVER_TYPE)
# define E1_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# if E_STEPPERS <= 2
2020-10-19 10:16:02 +02:00
# undef E2_DRIVER_TYPE
# elif !defined(E2_DRIVER_TYPE)
# define E2_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# if E_STEPPERS <= 3
2020-10-19 10:16:02 +02:00
# undef E3_DRIVER_TYPE
# elif !defined(E3_DRIVER_TYPE)
# define E3_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# if E_STEPPERS <= 4
2020-10-19 10:16:02 +02:00
# undef E4_DRIVER_TYPE
# elif !defined(E4_DRIVER_TYPE)
# define E4_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# if E_STEPPERS <= 5
2020-10-19 10:16:02 +02:00
# undef E5_DRIVER_TYPE
# elif !defined(E5_DRIVER_TYPE)
# define E5_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# if E_STEPPERS <= 6
2020-10-19 10:16:02 +02:00
# undef E6_DRIVER_TYPE
# elif !defined(E6_DRIVER_TYPE)
# define E6_DRIVER_TYPE A4988
# endif
2020-10-20 22:01:46 +02:00
# if E_STEPPERS <= 7
2020-10-19 10:16:02 +02:00
# undef E7_DRIVER_TYPE
# elif !defined(E7_DRIVER_TYPE)
# define E7_DRIVER_TYPE A4988
# endif
// Fallback axis inverting
# ifndef INVERT_X_DIR
# define INVERT_X_DIR false
# endif
2021-06-05 09:18:47 +02:00
# if HAS_Y_AXIS && !defined(INVERT_Y_DIR)
2020-10-19 10:16:02 +02:00
# define INVERT_Y_DIR false
# endif
2021-06-05 09:18:47 +02:00
# if HAS_Z_AXIS && !defined(INVERT_Z_DIR)
2020-10-19 10:16:02 +02:00
# define INVERT_Z_DIR false
# endif
2021-06-05 09:18:47 +02:00
# if LINEAR_AXES >= 4 && !defined(INVERT_I_DIR)
# define INVERT_I_DIR false
# endif
# if LINEAR_AXES >= 5 && !defined(INVERT_J_DIR)
# define INVERT_J_DIR false
# endif
# if LINEAR_AXES >= 6 && !defined(INVERT_K_DIR)
# define INVERT_K_DIR false
# endif
# if HAS_EXTRUDERS && !defined(INVERT_E_DIR)
2020-10-19 10:16:02 +02:00
# define INVERT_E_DIR false
# endif
2020-02-29 11:14:40 +01:00
/**
* This setting is also used by M109 when trying to calculate
* a ballpark safe margin to prevent wait - forever situation .
*/
# ifndef EXTRUDE_MINTEMP
# define EXTRUDE_MINTEMP 170
# endif
2020-10-12 23:38:07 +02:00
/**
* TFT Displays
*
* Configure parameters for TFT displays :
* - TFT_DEFAULT_ORIENTATION
* - TFT_DRIVER
* - TFT_WIDTH
* - TFT_HEIGHT
* - TFT_INTERFACE_ ( SPI | FSMC )
* - TFT_COLOR
* - GRAPHICAL_TFT_UPSCALE
*/
2021-06-06 11:21:14 +02:00
# if ENABLED(MKS_TS35_V2_0) // ST7796
# define TFT_DEFAULT_DRIVER ST7796
2020-10-12 23:38:07 +02:00
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY)
2020-10-15 10:00:27 +02:00
# define TFT_RES_480x320
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_SPI
2021-06-06 11:21:14 +02:00
# elif ENABLED(ANET_ET5_TFT35) // ST7796
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY)
# define TFT_RES_480x320
# define TFT_INTERFACE_FSMC
# elif ENABLED(ANET_ET4_TFT28) // ST7789
2020-10-12 23:38:07 +02:00
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
2020-10-15 10:00:27 +02:00
# define TFT_RES_320x240
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
2021-06-06 11:21:14 +02:00
# elif ENABLED(MKS_ROBIN_TFT24) // ST7789
2020-10-12 23:38:07 +02:00
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
2020-10-15 10:00:27 +02:00
# define TFT_RES_320x240
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
2021-06-06 11:21:14 +02:00
# elif ENABLED(MKS_ROBIN_TFT28) // ST7789
2020-10-12 23:38:07 +02:00
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
2020-10-15 10:00:27 +02:00
# define TFT_RES_320x240
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
2021-06-06 11:21:14 +02:00
# elif ENABLED(MKS_ROBIN_TFT32) // ST7789
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
# define TFT_RES_320x240
# define TFT_INTERFACE_FSMC
# elif ENABLED(MKS_ROBIN_TFT35) // ILI9488
2020-10-12 23:38:07 +02:00
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
2020-10-15 10:00:27 +02:00
# define TFT_RES_480x320
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
# elif ENABLED(MKS_ROBIN_TFT43)
# define TFT_DRIVER SSD1963
2021-06-06 11:21:14 +02:00
# define TFT_DEFAULT_ORIENTATION 0
2020-10-15 10:00:27 +02:00
# define TFT_RES_480x272
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
2020-12-22 13:51:29 +01:00
# elif ENABLED(MKS_ROBIN_TFT_V1_1R) // ILI9328 or R61505
2020-10-15 10:00:27 +02:00
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
# define TFT_RES_320x240
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
2020-12-22 13:51:29 +01:00
# elif EITHER(TFT_TRONXY_X5SA, ANYCUBIC_TFT35) // ILI9488
2020-10-12 23:38:07 +02:00
# define TFT_DRIVER ILI9488
2021-06-06 11:21:14 +02:00
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
2020-10-15 10:00:27 +02:00
# define TFT_RES_480x320
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
# elif ENABLED(LONGER_LK_TFT28)
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
2020-10-15 10:00:27 +02:00
# define TFT_RES_320x240
2020-10-12 23:38:07 +02:00
# define TFT_INTERFACE_FSMC
2021-04-06 04:40:50 +02:00
# elif ENABLED(BIQU_BX_TFT70) // RGB
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY)
# define TFT_RES_1024x600
# define TFT_INTERFACE_LTDC
2021-05-09 04:02:16 +02:00
# if ENABLED(TOUCH_SCREEN)
# define TFT_TOUCH_DEVICE_GT911
# endif
2020-10-12 23:38:07 +02:00
# elif ENABLED(TFT_GENERIC)
# define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
2020-10-15 10:00:27 +02:00
# if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320)
# define TFT_RES_320x240
# endif
# if NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
# define TFT_INTERFACE_SPI
# endif
# endif
# if ENABLED(TFT_RES_320x240)
# define TFT_WIDTH 320
# define TFT_HEIGHT 240
# define GRAPHICAL_TFT_UPSCALE 2
# elif ENABLED(TFT_RES_480x272)
# define TFT_WIDTH 480
# define TFT_HEIGHT 272
# define GRAPHICAL_TFT_UPSCALE 2
# elif ENABLED(TFT_RES_480x320)
# define TFT_WIDTH 480
# define TFT_HEIGHT 320
# define GRAPHICAL_TFT_UPSCALE 3
2021-04-06 04:40:50 +02:00
# elif ENABLED(TFT_RES_1024x600)
# define TFT_WIDTH 1024
# define TFT_HEIGHT 600
# define GRAPHICAL_TFT_UPSCALE 4
2020-10-12 23:38:07 +02:00
# endif
2021-04-06 04:40:50 +02:00
// FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi|ltdc).h
2020-10-12 23:38:07 +02:00
# if ENABLED(TFT_INTERFACE_FSMC)
# define HAS_FSMC_TFT 1
2020-10-21 19:45:27 +02:00
# if TFT_SCALED_DOGLCD
2020-10-15 10:00:27 +02:00
# define HAS_FSMC_GRAPHICAL_TFT 1
2020-10-21 19:45:27 +02:00
# elif HAS_TFT_LVGL_UI
2020-10-15 10:00:27 +02:00
# define HAS_TFT_LVGL_UI_FSMC 1
2020-10-12 23:38:07 +02:00
# endif
# elif ENABLED(TFT_INTERFACE_SPI)
# define HAS_SPI_TFT 1
2020-10-21 19:45:27 +02:00
# if TFT_SCALED_DOGLCD
2020-10-15 10:00:27 +02:00
# define HAS_SPI_GRAPHICAL_TFT 1
2020-10-21 19:45:27 +02:00
# elif HAS_TFT_LVGL_UI
2020-10-15 10:00:27 +02:00
# define HAS_TFT_LVGL_UI_SPI 1
2020-10-12 23:38:07 +02:00
# endif
2021-04-06 04:40:50 +02:00
# elif ENABLED(TFT_INTERFACE_LTDC)
# define HAS_LTDC_TFT 1
# if TFT_SCALED_DOGLCD
# define HAS_LTDC_GRAPHICAL_TFT 1
# elif HAS_TFT_LVGL_UI
# define HAS_TFT_LVGL_UI_LTDC 1
# endif
2020-10-12 23:38:07 +02:00
# endif
2021-01-25 08:44:39 +01:00
# if ENABLED(TFT_COLOR_UI)
# if TFT_HEIGHT == 240
# if ENABLED(TFT_INTERFACE_SPI)
# define TFT_320x240_SPI
# elif ENABLED(TFT_INTERFACE_FSMC)
# define TFT_320x240
# endif
# elif TFT_HEIGHT == 320
# if ENABLED(TFT_INTERFACE_SPI)
# define TFT_480x320_SPI
# elif ENABLED(TFT_INTERFACE_FSMC)
# define TFT_480x320
# endif
# elif TFT_HEIGHT == 272
# if ENABLED(TFT_INTERFACE_SPI)
# define TFT_480x272_SPI
# elif ENABLED(TFT_INTERFACE_FSMC)
# define TFT_480x272
# endif
2021-04-06 04:40:50 +02:00
# elif TFT_HEIGHT == 600
# if ENABLED(TFT_INTERFACE_LTDC)
# define TFT_1024x600_LTDC
# endif
2020-12-29 06:26:35 +01:00
# endif
2020-10-12 23:38:07 +02:00
# endif
# if EITHER(TFT_320x240, TFT_320x240_SPI)
# define HAS_UI_320x240 1
# elif EITHER(TFT_480x320, TFT_480x320_SPI)
# define HAS_UI_480x320 1
2020-12-29 06:26:35 +01:00
# elif EITHER(TFT_480x272, TFT_480x272_SPI)
# define HAS_UI_480x272 1
2021-04-06 04:40:50 +02:00
# elif defined(TFT_1024x600_LTDC)
# define HAS_UI_1024x600 1
2021-01-25 08:44:39 +01:00
# endif
# if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272)
2021-05-09 04:02:16 +02:00
# define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen
2021-04-06 04:40:50 +02:00
# elif HAS_UI_1024x600
# define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen
2020-10-12 23:38:07 +02:00
# endif
// This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046'
2021-05-09 04:02:16 +02:00
# if ENABLED(TOUCH_SCREEN)
# if NONE(TFT_TOUCH_DEVICE_GT911, TFT_TOUCH_DEVICE_XPT2046)
# define TFT_TOUCH_DEVICE_XPT2046 // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
# endif
# if ENABLED(TFT_TOUCH_DEVICE_GT911) // GT911 Capacitive touch screen such as BIQU_BX_TFT70
# undef TOUCH_SCREEN_CALIBRATION
# undef TOUCH_CALIBRATION_AUTO_SAVE
# endif
# if !HAS_GRAPHICAL_TFT
# undef TOUCH_SCREEN
# if ENABLED(TFT_CLASSIC_UI)
# define HAS_TOUCH_BUTTONS 1
# if ENABLED(TFT_TOUCH_DEVICE_GT911)
# define HAS_CAP_TOUCH_BUTTONS 1
# else
# define HAS_RES_TOUCH_BUTTONS 1
# endif
# endif
2020-11-15 23:39:58 +01:00
# endif
# endif
// XPT2046_** Compatibility
# if !(defined(TOUCH_CALIBRATION_X) || defined(TOUCH_CALIBRATION_Y) || defined(TOUCH_OFFSET_X) || defined(TOUCH_OFFSET_Y) || defined(TOUCH_ORIENTATION))
# if defined(XPT2046_X_CALIBRATION) && defined(XPT2046_Y_CALIBRATION) && defined(XPT2046_X_OFFSET) && defined(XPT2046_Y_OFFSET)
# define TOUCH_CALIBRATION_X XPT2046_X_CALIBRATION
# define TOUCH_CALIBRATION_Y XPT2046_Y_CALIBRATION
# define TOUCH_OFFSET_X XPT2046_X_OFFSET
# define TOUCH_OFFSET_Y XPT2046_Y_OFFSET
# define TOUCH_ORIENTATION TOUCH_LANDSCAPE
2020-10-16 01:38:27 +02:00
# endif
2020-10-12 23:38:07 +02:00
# endif
2021-02-25 11:49:34 +01:00
# if ANY(USE_XMIN_PLUG, USE_YMIN_PLUG, USE_ZMIN_PLUG, USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG)
# define HAS_ENDSTOPS 1
# define COORDINATE_OKAY(N,L,H) WITHIN(N,L,H)
# else
# define COORDINATE_OKAY(N,L,H) true
# endif
2021-05-26 01:38:23 +02:00
/**
* LED Backlight INDEX END
*/
# if defined(NEOPIXEL_BKGD_INDEX_FIRST) && !defined(NEOPIXEL_BKGD_INDEX_LAST)
# define NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_INDEX_FIRST
# endif