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 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  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. #endif
  37. #if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
  38. #define DOGLCD
  39. #define ULTIPANEL
  40. #define NEWPANEL
  41. #define DEFAULT_LCD_CONTRAST 17
  42. #endif
  43. #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  44. #define ULTRA_LCD //general LCD support, also 16x2
  45. #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
  46. #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
  47. #if ENABLED(miniVIKI)
  48. #define LCD_CONTRAST_MIN 75
  49. #define LCD_CONTRAST_MAX 115
  50. #define DEFAULT_LCD_CONTRAST 95
  51. #elif ENABLED(VIKI2)
  52. #define DEFAULT_LCD_CONTRAST 40
  53. #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
  54. #define LCD_CONTRAST_MIN 90
  55. #define LCD_CONTRAST_MAX 130
  56. #define DEFAULT_LCD_CONTRAST 110
  57. #define U8GLIB_LM6059_AF
  58. #define SD_DETECT_INVERTED
  59. #endif
  60. #endif
  61. // Generic support for SSD1306 / SH1106 OLED based LCDs.
  62. #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
  63. #define ULTRA_LCD //general LCD support, also 16x2
  64. #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
  65. #endif
  66. #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
  67. #define ULTIMAKERCONTROLLER
  68. #endif
  69. #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  70. #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  71. #ifndef LONG_FILENAME_HOST_SUPPORT
  72. #define LONG_FILENAME_HOST_SUPPORT
  73. #endif
  74. #endif
  75. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  76. #define DOGLCD
  77. #define U8GLIB_ST7920
  78. #define REPRAP_DISCOUNT_SMART_CONTROLLER
  79. #endif
  80. #if ENABLED(ULTIMAKERCONTROLLER) \
  81. || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  82. || ENABLED(G3D_PANEL) \
  83. || ENABLED(RIGIDBOT_PANEL) \
  84. || ENABLED(REPRAPWORLD_KEYPAD)
  85. #define ULTIPANEL
  86. #define NEWPANEL
  87. #endif
  88. #if ENABLED(RA_CONTROL_PANEL)
  89. #define LCD_I2C_TYPE_PCA8574
  90. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  91. #define ULTIPANEL
  92. #define NEWPANEL
  93. #endif
  94. #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  95. #define DOGLCD
  96. #define U8GLIB_ST7920
  97. #define ULTIPANEL
  98. #define NEWPANEL
  99. #endif
  100. /**
  101. * I2C PANELS
  102. */
  103. #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
  104. // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
  105. // Make sure it is placed in the Arduino libraries directory.
  106. #define LCD_I2C_TYPE_PCF8575
  107. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  108. #define ULTIPANEL
  109. #define NEWPANEL
  110. #endif
  111. // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
  112. #if ENABLED(LCD_I2C_PANELOLU2)
  113. #define LCD_I2C_TYPE_MCP23017
  114. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  115. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
  116. #define ULTIPANEL
  117. #define NEWPANEL
  118. #endif
  119. // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
  120. #if ENABLED(LCD_I2C_VIKI)
  121. // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
  122. // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
  123. // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
  124. // BTN_ENC pin (or set BTN_ENC to -1 if not used)
  125. #define LCD_I2C_TYPE_MCP23017
  126. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  127. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
  128. #define ULTIPANEL
  129. #define NEWPANEL
  130. #define ENCODER_FEEDRATE_DEADZONE 4
  131. #ifndef ENCODER_PULSES_PER_STEP
  132. #define ENCODER_PULSES_PER_STEP 1
  133. #endif
  134. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  135. #define ENCODER_STEPS_PER_MENU_ITEM 2
  136. #endif
  137. #endif
  138. // Set encoder detents for well-known controllers
  139. #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  140. || ENABLED(BQ_LCD_SMART_CONTROLLER) || ENABLED(LCD_I2C_PANELOLU2) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
  141. #ifndef ENCODER_PULSES_PER_STEP
  142. #define ENCODER_PULSES_PER_STEP 4
  143. #endif
  144. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  145. #define ENCODER_STEPS_PER_MENU_ITEM 1
  146. #endif
  147. #endif
  148. // Shift register panels
  149. // ---------------------
  150. // 2 wire Non-latching LCD SR from:
  151. // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
  152. #if ENABLED(SAV_3DLCD)
  153. #define SR_LCD_2W_NL // Non latching 2 wire shift register
  154. #define ULTIPANEL
  155. #define NEWPANEL
  156. #endif
  157. #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
  158. #ifndef LCD_WIDTH
  159. #define LCD_WIDTH 22
  160. #endif
  161. #ifndef LCD_HEIGHT
  162. #define LCD_HEIGHT 5
  163. #endif
  164. #endif
  165. #if ENABLED(ULTIPANEL)
  166. #define NEWPANEL //enable this if you have a click-encoder panel
  167. #define ULTRA_LCD
  168. #ifndef LCD_WIDTH
  169. #define LCD_WIDTH 20
  170. #endif
  171. #ifndef LCD_HEIGHT
  172. #define LCD_HEIGHT 4
  173. #endif
  174. #else //no panel but just LCD
  175. #if ENABLED(ULTRA_LCD)
  176. #ifndef LCD_WIDTH
  177. #define LCD_WIDTH 16
  178. #endif
  179. #ifndef LCD_HEIGHT
  180. #define LCD_HEIGHT 2
  181. #endif
  182. #endif
  183. #endif
  184. #if ENABLED(DOGLCD)
  185. /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
  186. // \x00 intentionally skipped to avoid problems in strings
  187. #define LCD_STR_REFRESH "\x01"
  188. #define LCD_STR_FOLDER "\x02"
  189. #define LCD_STR_ARROW_RIGHT "\x03"
  190. #define LCD_STR_UPLEVEL "\x04"
  191. #define LCD_STR_CLOCK "\x05"
  192. #define LCD_STR_FEEDRATE "\x06"
  193. #define LCD_STR_BEDTEMP "\x07"
  194. #define LCD_STR_THERMOMETER "\x08"
  195. #define LCD_STR_DEGREE "\x09"
  196. #define LCD_STR_SPECIAL_MAX '\x09'
  197. // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
  198. // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
  199. #else
  200. /* Custom characters defined in the first 8 characters of the LCD */
  201. #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
  202. #define LCD_STR_DEGREE "\x01"
  203. #define LCD_STR_THERMOMETER "\x02"
  204. #define LCD_STR_UPLEVEL "\x03"
  205. #define LCD_STR_REFRESH "\x04"
  206. #define LCD_STR_FOLDER "\x05"
  207. #define LCD_STR_FEEDRATE "\x06"
  208. #define LCD_STR_CLOCK "\x07"
  209. #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
  210. #endif
  211. /**
  212. * Default LCD contrast for dogm-like LCD displays
  213. */
  214. #if ENABLED(DOGLCD)
  215. #define HAS_LCD_CONTRAST ( \
  216. ENABLED(MAKRPANEL) \
  217. || ENABLED(CARTESIO_UI) \
  218. || ENABLED(VIKI2) \
  219. || ENABLED(miniVIKI) \
  220. || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  221. )
  222. #if HAS_LCD_CONTRAST
  223. #ifndef LCD_CONTRAST_MIN
  224. #define LCD_CONTRAST_MIN 0
  225. #endif
  226. #ifndef LCD_CONTRAST_MAX
  227. #define LCD_CONTRAST_MAX 63
  228. #endif
  229. #ifndef DEFAULT_LCD_CONTRAST
  230. #define DEFAULT_LCD_CONTRAST 32
  231. #endif
  232. #endif
  233. #endif
  234. #ifndef BOOTSCREEN_TIMEOUT
  235. #define BOOTSCREEN_TIMEOUT 2500
  236. #endif
  237. #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
  238. /**
  239. * Extruders have some combination of stepper motors and hotends
  240. * so we separate these concepts into the defines:
  241. *
  242. * EXTRUDERS - Number of Selectable Tools
  243. * HOTENDS - Number of hotends, whether connected or separate
  244. * E_STEPPERS - Number of actual E stepper motors
  245. * TOOL_E_INDEX - Index to use when getting/setting the tool state
  246. *
  247. */
  248. #if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder
  249. #define HOTENDS 1
  250. #define E_STEPPERS EXTRUDERS
  251. #define E_MANUAL EXTRUDERS
  252. #define TOOL_E_INDEX current_block->active_extruder
  253. #undef TEMP_SENSOR_1_AS_REDUNDANT
  254. #undef HOTEND_OFFSET_X
  255. #undef HOTEND_OFFSET_Y
  256. #elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends
  257. #define HOTENDS EXTRUDERS
  258. #define E_STEPPERS 1
  259. #define E_MANUAL 1
  260. #define TOOL_E_INDEX 0
  261. #ifndef HOTEND_OFFSET_Z
  262. #define HOTEND_OFFSET_Z { 0 }
  263. #endif
  264. #elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend
  265. #define HOTENDS 1
  266. #define E_STEPPERS MIXING_STEPPERS
  267. #define E_MANUAL 1
  268. #define TOOL_E_INDEX 0
  269. #else // One stepper, E axis, and hotend per tool
  270. #define HOTENDS EXTRUDERS
  271. #define E_STEPPERS EXTRUDERS
  272. #define E_MANUAL EXTRUDERS
  273. #define TOOL_E_INDEX current_block->active_extruder
  274. #endif
  275. /**
  276. * Distinct E Factors – Disable by commenting out DISTINCT_E_FACTORS
  277. */
  278. #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
  279. #define XYZE_N (XYZ + E_STEPPERS)
  280. #define E_AXIS_N (E_AXIS + extruder)
  281. #else
  282. #undef DISTINCT_E_FACTORS
  283. #define XYZE_N XYZE
  284. #define E_AXIS_N E_AXIS
  285. #endif
  286. /**
  287. * The BLTouch Probe emulates a servo probe
  288. * and uses "special" angles for its state.
  289. */
  290. #if ENABLED(BLTOUCH)
  291. #ifndef Z_ENDSTOP_SERVO_NR
  292. #define Z_ENDSTOP_SERVO_NR 0
  293. #endif
  294. #ifndef NUM_SERVOS
  295. #define NUM_SERVOS (Z_ENDSTOP_SERVO_NR + 1)
  296. #endif
  297. #undef DEACTIVATE_SERVOS_AFTER_MOVE
  298. #undef SERVO_DELAY
  299. #define SERVO_DELAY 50
  300. #undef Z_SERVO_ANGLES
  301. #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW }
  302. #define BLTOUCH_DEPLOY 10
  303. #define BLTOUCH_STOW 90
  304. #define BLTOUCH_SELFTEST 120
  305. #define BLTOUCH_RESET 160
  306. #define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING)
  307. #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  308. #undef Z_MIN_ENDSTOP_INVERTING
  309. #define Z_MIN_ENDSTOP_INVERTING false
  310. #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN)
  311. #else
  312. #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE)
  313. #endif
  314. #endif
  315. /**
  316. * Set a flag for a servo probe
  317. */
  318. #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
  319. /**
  320. * Set a flag for any enabled probe
  321. */
  322. #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))
  323. /**
  324. * Clear probe pin settings when no probe is selected
  325. */
  326. #if !PROBE_SELECTED
  327. #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  328. #undef Z_MIN_PROBE_ENDSTOP
  329. #endif
  330. #endif //CONDITIONALS_LCD_H