My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Conditionals_LCD.h 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * Conditionals_LCD.h
  24. * Conditionals that need to be set before Configuration_adv.h or pins.h
  25. */
  26. #ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first
  27. #define CONDITIONALS_LCD_H
  28. #define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
  29. #if ENABLED(CARTESIO_UI)
  30. #define DOGLCD
  31. #define ULTIPANEL
  32. #define NEWPANEL
  33. #define DEFAULT_LCD_CONTRAST 90
  34. #define LCD_CONTRAST_MIN 60
  35. #define LCD_CONTRAST_MAX 140
  36. #elif ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
  37. #define DOGLCD
  38. #define ULTIPANEL
  39. #define NEWPANEL
  40. #define DEFAULT_LCD_CONTRAST 17
  41. #elif ENABLED(BQ_LCD_SMART_CONTROLLER)
  42. #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  43. #define LONG_FILENAME_HOST_SUPPORT
  44. #elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  45. #define ULTRA_LCD //general LCD support, also 16x2
  46. #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
  47. #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
  48. #if ENABLED(miniVIKI)
  49. #define LCD_CONTRAST_MIN 75
  50. #define LCD_CONTRAST_MAX 115
  51. #define DEFAULT_LCD_CONTRAST 95
  52. #elif ENABLED(VIKI2)
  53. #define DEFAULT_LCD_CONTRAST 40
  54. #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  55. #define LCD_CONTRAST_MIN 90
  56. #define LCD_CONTRAST_MAX 130
  57. #define DEFAULT_LCD_CONTRAST 110
  58. #define U8GLIB_LM6059_AF
  59. #define SD_DETECT_INVERTED
  60. #endif
  61. #elif ENABLED(OLED_PANEL_TINYBOY2)
  62. #define U8GLIB_SSD1306
  63. #define ULTIPANEL
  64. #define NEWPANEL
  65. #define REVERSE_ENCODER_DIRECTION
  66. #define REVERSE_MENU_DIRECTION
  67. #elif ENABLED(RA_CONTROL_PANEL)
  68. #define LCD_I2C_TYPE_PCA8574
  69. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  70. #define ULTIPANEL
  71. #define NEWPANEL
  72. #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  73. #define DOGLCD
  74. #define U8GLIB_ST7920
  75. #define ULTIPANEL
  76. #define NEWPANEL
  77. #endif
  78. // Generic support for SSD1306 / SH1106 OLED based LCDs.
  79. #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
  80. #define ULTRA_LCD //general LCD support, also 16x2
  81. #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
  82. #endif
  83. #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
  84. #define ULTIMAKERCONTROLLER
  85. #endif
  86. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  87. #define DOGLCD
  88. #define U8GLIB_ST7920
  89. #define REPRAP_DISCOUNT_SMART_CONTROLLER
  90. #endif
  91. #if ENABLED(ULTIMAKERCONTROLLER) \
  92. || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  93. || ENABLED(G3D_PANEL) \
  94. || ENABLED(RIGIDBOT_PANEL)
  95. #define ULTIPANEL
  96. #define NEWPANEL
  97. #endif
  98. #if ENABLED(REPRAPWORLD_KEYPAD)
  99. #define NEWPANEL
  100. #if ENABLED(ULTIPANEL) && !defined(REPRAPWORLD_KEYPAD_MOVE_STEP)
  101. #define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
  102. #endif
  103. #endif
  104. /**
  105. * I2C PANELS
  106. */
  107. #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
  108. // Note: This controller requires F.Malpartida's LiquidCrystal_I2C library
  109. // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
  110. #define LCD_I2C_TYPE_PCF8575
  111. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  112. #define ULTIPANEL
  113. #define NEWPANEL
  114. #elif ENABLED(LCD_I2C_PANELOLU2)
  115. // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
  116. #define LCD_I2C_TYPE_MCP23017
  117. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  118. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
  119. #define ULTIPANEL
  120. #define NEWPANEL
  121. #elif ENABLED(LCD_I2C_VIKI)
  122. /**
  123. * Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
  124. *
  125. * This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
  126. * Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
  127. * Note: The pause/stop/resume LCD button pin should be connected to the Arduino
  128. * BTN_ENC pin (or set BTN_ENC to -1 if not used)
  129. */
  130. #define LCD_I2C_TYPE_MCP23017
  131. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  132. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
  133. #define ULTIPANEL
  134. #define NEWPANEL
  135. #define ENCODER_FEEDRATE_DEADZONE 4
  136. #ifndef ENCODER_PULSES_PER_STEP
  137. #define ENCODER_PULSES_PER_STEP 1
  138. #endif
  139. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  140. #define ENCODER_STEPS_PER_MENU_ITEM 2
  141. #endif
  142. #endif
  143. // Set encoder detents for well-known controllers
  144. #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) || ENABLED(OLED_PANEL_TINYBOY2) \
  145. || ENABLED(BQ_LCD_SMART_CONTROLLER) || ENABLED(LCD_I2C_PANELOLU2) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
  146. #ifndef ENCODER_PULSES_PER_STEP
  147. #define ENCODER_PULSES_PER_STEP 4
  148. #endif
  149. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  150. #define ENCODER_STEPS_PER_MENU_ITEM 1
  151. #endif
  152. #endif
  153. // Shift register panels
  154. // ---------------------
  155. // 2 wire Non-latching LCD SR from:
  156. // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
  157. #if ENABLED(SAV_3DLCD)
  158. #define SR_LCD_2W_NL // Non latching 2 wire shift register
  159. #define ULTIPANEL
  160. #define NEWPANEL
  161. #endif
  162. #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
  163. #ifndef LCD_WIDTH
  164. #define LCD_WIDTH 22
  165. #endif
  166. #ifndef LCD_HEIGHT
  167. #define LCD_HEIGHT 5
  168. #endif
  169. #endif
  170. #if ENABLED(ULTIPANEL)
  171. #define NEWPANEL //enable this if you have a click-encoder panel
  172. #define ULTRA_LCD
  173. #ifndef LCD_WIDTH
  174. #define LCD_WIDTH 20
  175. #endif
  176. #ifndef LCD_HEIGHT
  177. #define LCD_HEIGHT 4
  178. #endif
  179. #else // no panel but just LCD
  180. #if ENABLED(ULTRA_LCD)
  181. #ifndef LCD_WIDTH
  182. #define LCD_WIDTH 16
  183. #endif
  184. #ifndef LCD_HEIGHT
  185. #define LCD_HEIGHT 2
  186. #endif
  187. #endif
  188. #endif
  189. #if ENABLED(DOGLCD)
  190. /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
  191. // \x00 intentionally skipped to avoid problems in strings
  192. #define LCD_STR_REFRESH "\x01"
  193. #define LCD_STR_FOLDER "\x02"
  194. #define LCD_STR_ARROW_RIGHT "\x03"
  195. #define LCD_STR_UPLEVEL "\x04"
  196. #define LCD_STR_CLOCK "\x05"
  197. #define LCD_STR_FEEDRATE "\x06"
  198. #define LCD_STR_BEDTEMP "\x07"
  199. #define LCD_STR_THERMOMETER "\x08"
  200. #define LCD_STR_DEGREE "\x09"
  201. #define LCD_STR_SPECIAL_MAX '\x09'
  202. // Maximum here is 0x1F because 0x20 is ' ' (space) and the normal charsets begin.
  203. // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
  204. // Symbol characters
  205. #define LCD_STR_FILAM_DIA "\xf8"
  206. #define LCD_STR_FILAM_MUL "\xa4"
  207. #else
  208. /* Custom characters defined in the first 8 characters of the LCD */
  209. #define LCD_BEDTEMP_CHAR 0x00 // Print only as a char. This will have 'unexpected' results when used in a string!
  210. #define LCD_DEGREE_CHAR 0x01
  211. #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation
  212. #define LCD_UPLEVEL_CHAR 0x03
  213. #define LCD_STR_REFRESH "\x04"
  214. #define LCD_STR_FOLDER "\x05"
  215. #define LCD_FEEDRATE_CHAR 0x06
  216. #define LCD_CLOCK_CHAR 0x07
  217. #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
  218. #endif
  219. /**
  220. * Default LCD contrast for dogm-like LCD displays
  221. */
  222. #if ENABLED(DOGLCD)
  223. #define HAS_LCD_CONTRAST ( \
  224. ENABLED(MAKRPANEL) \
  225. || ENABLED(CARTESIO_UI) \
  226. || ENABLED(VIKI2) \
  227. || ENABLED(miniVIKI) \
  228. || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  229. )
  230. #if HAS_LCD_CONTRAST
  231. #ifndef LCD_CONTRAST_MIN
  232. #define LCD_CONTRAST_MIN 0
  233. #endif
  234. #ifndef LCD_CONTRAST_MAX
  235. #define LCD_CONTRAST_MAX 63
  236. #endif
  237. #ifndef DEFAULT_LCD_CONTRAST
  238. #define DEFAULT_LCD_CONTRAST 32
  239. #endif
  240. #endif
  241. #endif
  242. #ifndef BOOTSCREEN_TIMEOUT
  243. #define BOOTSCREEN_TIMEOUT 2500
  244. #endif
  245. #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
  246. /**
  247. * Extruders have some combination of stepper motors and hotends
  248. * so we separate these concepts into the defines:
  249. *
  250. * EXTRUDERS - Number of Selectable Tools
  251. * HOTENDS - Number of hotends, whether connected or separate
  252. * E_STEPPERS - Number of actual E stepper motors
  253. * TOOL_E_INDEX - Index to use when getting/setting the tool state
  254. *
  255. */
  256. #if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset
  257. #define HOTENDS 1
  258. #undef TEMP_SENSOR_1_AS_REDUNDANT
  259. #undef HOTEND_OFFSET_X
  260. #undef HOTEND_OFFSET_Y
  261. #else // Two hotends
  262. #define HOTENDS EXTRUDERS
  263. #if ENABLED(SWITCHING_NOZZLE) && !defined(HOTEND_OFFSET_Z)
  264. #define HOTEND_OFFSET_Z { 0 }
  265. #endif
  266. #endif
  267. #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(MIXING_EXTRUDER) // Unified E axis
  268. #if ENABLED(MIXING_EXTRUDER)
  269. #define E_STEPPERS MIXING_STEPPERS
  270. #else
  271. #define E_STEPPERS 1 // One E stepper
  272. #endif
  273. #define E_MANUAL 1
  274. #define TOOL_E_INDEX 0
  275. #else
  276. #define E_STEPPERS EXTRUDERS
  277. #define E_MANUAL EXTRUDERS
  278. #define TOOL_E_INDEX current_block->active_extruder
  279. #endif
  280. /**
  281. * DISTINCT_E_FACTORS affects how some E factors are accessed
  282. */
  283. #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
  284. #define XYZE_N (XYZ + E_STEPPERS)
  285. #define E_AXIS_N (E_AXIS + extruder)
  286. #else
  287. #undef DISTINCT_E_FACTORS
  288. #define XYZE_N XYZE
  289. #define E_AXIS_N E_AXIS
  290. #endif
  291. /**
  292. * The BLTouch Probe emulates a servo probe
  293. * and uses "special" angles for its state.
  294. */
  295. #if ENABLED(BLTOUCH)
  296. #ifndef Z_ENDSTOP_SERVO_NR
  297. #define Z_ENDSTOP_SERVO_NR 0
  298. #endif
  299. #ifndef NUM_SERVOS
  300. #define NUM_SERVOS (Z_ENDSTOP_SERVO_NR + 1)
  301. #endif
  302. #undef DEACTIVATE_SERVOS_AFTER_MOVE
  303. #undef SERVO_DELAY
  304. #define SERVO_DELAY 50
  305. #ifndef BLTOUCH_DELAY
  306. #define BLTOUCH_DELAY 375
  307. #endif
  308. #undef Z_SERVO_ANGLES
  309. #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW }
  310. #define BLTOUCH_DEPLOY 10
  311. #define BLTOUCH_STOW 90
  312. #define BLTOUCH_SELFTEST 120
  313. #define BLTOUCH_RESET 160
  314. #define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING)
  315. // Always disable probe pin inverting for BLTouch
  316. #undef Z_MIN_PROBE_ENDSTOP_INVERTING
  317. #define Z_MIN_PROBE_ENDSTOP_INVERTING false
  318. #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  319. #undef Z_MIN_ENDSTOP_INVERTING
  320. #define Z_MIN_ENDSTOP_INVERTING false
  321. #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN)
  322. #else
  323. #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE)
  324. #endif
  325. #endif
  326. /**
  327. * Set a flag for a servo probe
  328. */
  329. #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
  330. /**
  331. * UBL has its own manual probing, so this just causes trouble.
  332. */
  333. #if ENABLED(AUTO_BED_LEVELING_UBL)
  334. #undef PROBE_MANUALLY
  335. #endif
  336. /**
  337. * Set a flag for any enabled probe
  338. */
  339. #define PROBE_SELECTED (ENABLED(PROBE_MANUALLY) || ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE))
  340. /**
  341. * Clear probe pin settings when no probe is selected
  342. */
  343. #if !PROBE_SELECTED || ENABLED(PROBE_MANUALLY)
  344. #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  345. #undef Z_MIN_PROBE_ENDSTOP
  346. #endif
  347. #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
  348. #define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER))
  349. #define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632))
  350. #endif // CONDITIONALS_LCD_H