My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

Conditionals_LCD.h 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  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. #ifndef ENCODER_PULSES_PER_STEP
  61. #define ENCODER_PULSES_PER_STEP 4
  62. #endif
  63. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  64. #define ENCODER_STEPS_PER_MENU_ITEM 1
  65. #endif
  66. #endif
  67. // Generic support for SSD1306 / SH1106 OLED based LCDs.
  68. #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
  69. #define ULTRA_LCD //general LCD support, also 16x2
  70. #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
  71. #endif
  72. #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
  73. #define ULTIMAKERCONTROLLER
  74. #endif
  75. #if ENABLED(BQ_LCD_SMART_CONTROLLER)
  76. #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
  77. #ifndef ENCODER_PULSES_PER_STEP
  78. #define ENCODER_PULSES_PER_STEP 4
  79. #endif
  80. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  81. #define ENCODER_STEPS_PER_MENU_ITEM 1
  82. #endif
  83. #ifndef LONG_FILENAME_HOST_SUPPORT
  84. #define LONG_FILENAME_HOST_SUPPORT
  85. #endif
  86. #endif
  87. #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
  88. #define DOGLCD
  89. #define U8GLIB_ST7920
  90. #define REPRAP_DISCOUNT_SMART_CONTROLLER
  91. #endif
  92. #if ENABLED(ULTIMAKERCONTROLLER) \
  93. || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
  94. || ENABLED(G3D_PANEL) \
  95. || ENABLED(RIGIDBOT_PANEL) \
  96. || ENABLED(REPRAPWORLD_KEYPAD)
  97. #define ULTIPANEL
  98. #define NEWPANEL
  99. #endif
  100. #if ENABLED(RA_CONTROL_PANEL)
  101. #define LCD_I2C_TYPE_PCA8574
  102. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  103. #define ULTIPANEL
  104. #define NEWPANEL
  105. #endif
  106. #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
  107. #define DOGLCD
  108. #define U8GLIB_ST7920
  109. #define ULTIPANEL
  110. #define NEWPANEL
  111. #endif
  112. /**
  113. * I2C PANELS
  114. */
  115. #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
  116. // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
  117. // Make sure it is placed in the Arduino libraries directory.
  118. #define LCD_I2C_TYPE_PCF8575
  119. #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
  120. #define ULTIPANEL
  121. #define NEWPANEL
  122. #endif
  123. // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
  124. #if ENABLED(LCD_I2C_PANELOLU2)
  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
  128. #ifndef ENCODER_PULSES_PER_STEP
  129. #define ENCODER_PULSES_PER_STEP 4
  130. #endif
  131. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  132. #define ENCODER_STEPS_PER_MENU_ITEM 1
  133. #endif
  134. #define ULTIPANEL
  135. #define NEWPANEL
  136. #endif
  137. // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
  138. #if ENABLED(LCD_I2C_VIKI)
  139. // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
  140. // Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
  141. // Note: The pause/stop/resume LCD button pin should be connected to the Arduino
  142. // BTN_ENC pin (or set BTN_ENC to -1 if not used)
  143. #define LCD_I2C_TYPE_MCP23017
  144. #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
  145. #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
  146. #define ULTIPANEL
  147. #define NEWPANEL
  148. #define ENCODER_FEEDRATE_DEADZONE 4
  149. #ifndef ENCODER_PULSES_PER_STEP
  150. #define ENCODER_PULSES_PER_STEP 1
  151. #endif
  152. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  153. #define ENCODER_STEPS_PER_MENU_ITEM 2
  154. #endif
  155. #endif
  156. // Shift register panels
  157. // ---------------------
  158. // 2 wire Non-latching LCD SR from:
  159. // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
  160. #if ENABLED(SAV_3DLCD)
  161. #define SR_LCD_2W_NL // Non latching 2 wire shift register
  162. #define ULTIPANEL
  163. #define NEWPANEL
  164. #endif
  165. #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
  166. #ifndef LCD_WIDTH
  167. #define LCD_WIDTH 22
  168. #endif
  169. #ifndef LCD_HEIGHT
  170. #define LCD_HEIGHT 5
  171. #endif
  172. #endif
  173. #if ENABLED(ULTIPANEL)
  174. #define NEWPANEL //enable this if you have a click-encoder panel
  175. #define ULTRA_LCD
  176. #ifndef LCD_WIDTH
  177. #define LCD_WIDTH 20
  178. #endif
  179. #ifndef LCD_HEIGHT
  180. #define LCD_HEIGHT 4
  181. #endif
  182. #else //no panel but just LCD
  183. #if ENABLED(ULTRA_LCD)
  184. #ifndef LCD_WIDTH
  185. #define LCD_WIDTH 16
  186. #endif
  187. #ifndef LCD_HEIGHT
  188. #define LCD_HEIGHT 2
  189. #endif
  190. #endif
  191. #endif
  192. #if ENABLED(DOGLCD)
  193. /* Custom characters defined in font dogm_font_data_Marlin_symbols.h / Marlin_symbols.fon */
  194. // \x00 intentionally skipped to avoid problems in strings
  195. #define LCD_STR_REFRESH "\x01"
  196. #define LCD_STR_FOLDER "\x02"
  197. #define LCD_STR_ARROW_RIGHT "\x03"
  198. #define LCD_STR_UPLEVEL "\x04"
  199. #define LCD_STR_CLOCK "\x05"
  200. #define LCD_STR_FEEDRATE "\x06"
  201. #define LCD_STR_BEDTEMP "\x07"
  202. #define LCD_STR_THERMOMETER "\x08"
  203. #define LCD_STR_DEGREE "\x09"
  204. #define LCD_STR_SPECIAL_MAX '\x09'
  205. // Maximum here is 0x1f because 0x20 is ' ' (space) and the normal charsets begin.
  206. // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here.
  207. #else
  208. /* Custom characters defined in the first 8 characters of the LCD */
  209. #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
  210. #define LCD_STR_DEGREE "\x01"
  211. #define LCD_STR_THERMOMETER "\x02"
  212. #define LCD_STR_UPLEVEL "\x03"
  213. #define LCD_STR_REFRESH "\x04"
  214. #define LCD_STR_FOLDER "\x05"
  215. #define LCD_STR_FEEDRATE "\x06"
  216. #define LCD_STR_CLOCK "\x07"
  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) // One hotend, multi-extruder
  257. #define HOTENDS 1
  258. #define E_STEPPERS EXTRUDERS
  259. #define E_MANUAL EXTRUDERS
  260. #define TOOL_E_INDEX current_block->active_extruder
  261. #undef TEMP_SENSOR_1_AS_REDUNDANT
  262. #undef HOTEND_OFFSET_X
  263. #undef HOTEND_OFFSET_Y
  264. #elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends
  265. #define HOTENDS EXTRUDERS
  266. #define E_STEPPERS 1
  267. #define E_MANUAL 1
  268. #define TOOL_E_INDEX 0
  269. #ifndef HOTEND_OFFSET_Z
  270. #define HOTEND_OFFSET_Z { 0 }
  271. #endif
  272. #elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend
  273. #define HOTENDS 1
  274. #define E_STEPPERS MIXING_STEPPERS
  275. #define E_MANUAL 1
  276. #define TOOL_E_INDEX 0
  277. #else // One stepper, E axis, and hotend per tool
  278. #define HOTENDS EXTRUDERS
  279. #define E_STEPPERS EXTRUDERS
  280. #define E_MANUAL EXTRUDERS
  281. #define TOOL_E_INDEX current_block->active_extruder
  282. #endif
  283. /**
  284. * Distinct E Factors – Disable by commenting out DISTINCT_E_FACTORS
  285. */
  286. #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
  287. #define XYZE_N (XYZ + E_STEPPERS)
  288. #define E_AXIS_N (E_AXIS + extruder)
  289. #else
  290. #undef DISTINCT_E_FACTORS
  291. #define XYZE_N XYZE
  292. #define E_AXIS_N E_AXIS
  293. #endif
  294. /**
  295. * The BLTouch Probe emulates a servo probe
  296. * and uses "special" angles for its state.
  297. */
  298. #if ENABLED(BLTOUCH)
  299. #ifndef Z_ENDSTOP_SERVO_NR
  300. #define Z_ENDSTOP_SERVO_NR 0
  301. #endif
  302. #ifndef NUM_SERVOS
  303. #define NUM_SERVOS (Z_ENDSTOP_SERVO_NR + 1)
  304. #endif
  305. #undef DEACTIVATE_SERVOS_AFTER_MOVE
  306. #undef SERVO_DELAY
  307. #define SERVO_DELAY 50
  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. #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  316. #undef Z_MIN_ENDSTOP_INVERTING
  317. #define Z_MIN_ENDSTOP_INVERTING false
  318. #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN)
  319. #else
  320. #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE)
  321. #endif
  322. #endif
  323. /**
  324. * Set a flag for a servo probe
  325. */
  326. #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
  327. /**
  328. * Set a flag for any enabled probe
  329. */
  330. #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))
  331. /**
  332. * Clear probe pin settings when no probe is selected
  333. */
  334. #if !PROBE_SELECTED
  335. #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  336. #undef Z_MIN_PROBE_ENDSTOP
  337. #endif
  338. #endif //CONDITIONALS_LCD_H