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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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. * LCD Defines that depend on configuration but are not editable.
  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. #define ENCODER_PULSES_PER_STEP 4
  61. #define ENCODER_STEPS_PER_MENU_ITEM 1
  62. #endif
  63. // Generic support for SSD1306 / SH1106 OLED based LCDs.
  64. #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
  65. #define ULTRA_LCD //general LCD support, also 16x2
  66. #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
  67. #endif
  68. #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
  69. #define ULTIMAKERCONTROLLER
  70. #endif
  71. #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  72. #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  73. #ifndef ENCODER_PULSES_PER_STEP
  74. #define ENCODER_PULSES_PER_STEP 4
  75. #endif
  76. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  77. #define ENCODER_STEPS_PER_MENU_ITEM 1
  78. #endif
  79. #ifndef LONG_FILENAME_HOST_SUPPORT
  80. #define LONG_FILENAME_HOST_SUPPORT
  81. #endif
  82. #endif
  83. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  84. #define DOGLCD
  85. #define U8GLIB_ST7920
  86. #define REPRAP_DISCOUNT_SMART_CONTROLLER
  87. #endif
  88. #if ENABLED(ULTIMAKERCONTROLLER) \
  89. || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  90. || ENABLED(G3D_PANEL) \
  91. || ENABLED(RIGIDBOT_PANEL) \
  92. || ENABLED(REPRAPWORLD_KEYPAD)
  93. #define ULTIPANEL
  94. #define NEWPANEL
  95. #endif
  96. #if ENABLED(RA_CONTROL_PANEL)
  97. #define LCD_I2C_TYPE_PCA8574
  98. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  99. #define ULTIPANEL
  100. #define NEWPANEL
  101. #endif
  102. #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  103. #define DOGLCD
  104. #define U8GLIB_ST7920
  105. #define ULTIPANEL
  106. #define NEWPANEL
  107. #endif
  108. /**
  109. * I2C PANELS
  110. */
  111. #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
  112. // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
  113. // Make sure it is placed in the Arduino libraries directory.
  114. #define LCD_I2C_TYPE_PCF8575
  115. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  116. #define ULTIPANEL
  117. #define NEWPANEL
  118. #endif
  119. // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
  120. #if ENABLED(LCD_I2C_PANELOLU2)
  121. #define LCD_I2C_TYPE_MCP23017
  122. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  123. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
  124. #ifndef ENCODER_PULSES_PER_STEP
  125. #define ENCODER_PULSES_PER_STEP 4
  126. #endif
  127. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  128. #define ENCODER_STEPS_PER_MENU_ITEM 1
  129. #endif
  130. #define ULTIPANEL
  131. #define NEWPANEL
  132. #endif
  133. // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
  134. #if ENABLED(LCD_I2C_VIKI)
  135. // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
  136. // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
  137. // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
  138. // BTN_ENC pin (or set BTN_ENC to -1 if not used)
  139. #define LCD_I2C_TYPE_MCP23017
  140. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  141. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
  142. #define ULTIPANEL
  143. #define NEWPANEL
  144. #endif
  145. // Shift register panels
  146. // ---------------------
  147. // 2 wire Non-latching LCD SR from:
  148. // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
  149. #if ENABLED(SAV_3DLCD)
  150. #define SR_LCD_2W_NL // Non latching 2 wire shift register
  151. #define ULTIPANEL
  152. #define NEWPANEL
  153. #endif
  154. #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
  155. #ifndef LCD_WIDTH
  156. #define LCD_WIDTH 22
  157. #endif
  158. #ifndef LCD_HEIGHT
  159. #define LCD_HEIGHT 5
  160. #endif
  161. #endif
  162. #if ENABLED(ULTIPANEL)
  163. #define NEWPANEL //enable this if you have a click-encoder panel
  164. #define ULTRA_LCD
  165. #ifndef LCD_WIDTH
  166. #define LCD_WIDTH 20
  167. #endif
  168. #ifndef LCD_HEIGHT
  169. #define LCD_HEIGHT 4
  170. #endif
  171. #else //no panel but just LCD
  172. #if ENABLED(ULTRA_LCD)
  173. #ifndef LCD_WIDTH
  174. #define LCD_WIDTH 16
  175. #endif
  176. #ifndef LCD_HEIGHT
  177. #define LCD_HEIGHT 2
  178. #endif
  179. #endif
  180. #endif
  181. #if ENABLED(DOGLCD)
  182. /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
  183. // \x00 intentionally skipped to avoid problems in strings
  184. #define LCD_STR_REFRESH "\x01"
  185. #define LCD_STR_FOLDER "\x02"
  186. #define LCD_STR_ARROW_RIGHT "\x03"
  187. #define LCD_STR_UPLEVEL "\x04"
  188. #define LCD_STR_CLOCK "\x05"
  189. #define LCD_STR_FEEDRATE "\x06"
  190. #define LCD_STR_BEDTEMP "\x07"
  191. #define LCD_STR_THERMOMETER "\x08"
  192. #define LCD_STR_DEGREE "\x09"
  193. #define LCD_STR_SPECIAL_MAX '\x09'
  194. // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
  195. // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
  196. #else
  197. /* Custom characters defined in the first 8 characters of the LCD */
  198. #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
  199. #define LCD_STR_DEGREE "\x01"
  200. #define LCD_STR_THERMOMETER "\x02"
  201. #define LCD_STR_UPLEVEL "\x03"
  202. #define LCD_STR_REFRESH "\x04"
  203. #define LCD_STR_FOLDER "\x05"
  204. #define LCD_STR_FEEDRATE "\x06"
  205. #define LCD_STR_CLOCK "\x07"
  206. #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
  207. #endif
  208. /**
  209. * Default LCD contrast for dogm-like LCD displays
  210. */
  211. #if ENABLED(DOGLCD)
  212. #define HAS_LCD_CONTRAST ( \
  213. ENABLED(MAKRPANEL) \
  214. || ENABLED(CARTESIO_UI) \
  215. || ENABLED(VIKI2) \
  216. || ENABLED(miniVIKI) \
  217. || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  218. )
  219. #if HAS_LCD_CONTRAST
  220. #ifndef LCD_CONTRAST_MIN
  221. #define LCD_CONTRAST_MIN 0
  222. #endif
  223. #ifndef LCD_CONTRAST_MAX
  224. #define LCD_CONTRAST_MAX 63
  225. #endif
  226. #ifndef DEFAULT_LCD_CONTRAST
  227. #define DEFAULT_LCD_CONTRAST 32
  228. #endif
  229. #endif
  230. #endif
  231. #ifndef BOOTSCREEN_TIMEOUT
  232. #define BOOTSCREEN_TIMEOUT 2500
  233. #endif
  234. #endif //CONDITIONALS_LCD_H