My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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. /**
  246. * Extruders have some combination of stepper motors and hotends
  247. * so we separate these concepts into the defines:
  248. *
  249. * EXTRUDERS - Number of Selectable Tools
  250. * HOTENDS - Number of hotends, whether connected or separate
  251. * E_STEPPERS - Number of actual E stepper motors
  252. * TOOL_E_INDEX - Index to use when getting/setting the tool state
  253. *
  254. */
  255. #if ENABLED(SINGLENOZZLE) // One hotend, multi-extruder
  256. #define HOTENDS 1
  257. #define E_STEPPERS EXTRUDERS
  258. #define E_MANUAL EXTRUDERS
  259. #define TOOL_E_INDEX current_block->active_extruder
  260. #undef TEMP_SENSOR_1_AS_REDUNDANT
  261. #undef HOTEND_OFFSET_X
  262. #undef HOTEND_OFFSET_Y
  263. #elif ENABLED(SWITCHING_EXTRUDER) // One E stepper, unified E axis, two hotends
  264. #define HOTENDS EXTRUDERS
  265. #define E_STEPPERS 1
  266. #define E_MANUAL 1
  267. #define TOOL_E_INDEX 0
  268. #ifndef HOTEND_OFFSET_Z
  269. #define HOTEND_OFFSET_Z { 0 }
  270. #endif
  271. #elif ENABLED(MIXING_EXTRUDER) // Multi-stepper, unified E axis, one hotend
  272. #define HOTENDS 1
  273. #define E_STEPPERS MIXING_STEPPERS
  274. #define E_MANUAL 1
  275. #define TOOL_E_INDEX 0
  276. #else // One stepper, E axis, and hotend per tool
  277. #define HOTENDS EXTRUDERS
  278. #define E_STEPPERS EXTRUDERS
  279. #define E_MANUAL EXTRUDERS
  280. #define TOOL_E_INDEX current_block->active_extruder
  281. #endif
  282. /**
  283. * The BLTouch Probe emulates a servo probe
  284. * and uses "special" angles for its state.
  285. */
  286. #if ENABLED(BLTOUCH)
  287. #ifndef Z_ENDSTOP_SERVO_NR
  288. #define Z_ENDSTOP_SERVO_NR 0
  289. #endif
  290. #ifndef NUM_SERVOS
  291. #define NUM_SERVOS (Z_ENDSTOP_SERVO_NR + 1)
  292. #endif
  293. #undef DEACTIVATE_SERVOS_AFTER_MOVE
  294. #undef SERVO_DELAY
  295. #define SERVO_DELAY 50
  296. #undef Z_SERVO_ANGLES
  297. #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW }
  298. #define BLTOUCH_DEPLOY 10
  299. #define BLTOUCH_STOW 90
  300. #define BLTOUCH_SELFTEST 120
  301. #define BLTOUCH_RESET 160
  302. #define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING)
  303. #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
  304. #undef Z_MIN_ENDSTOP_INVERTING
  305. #define Z_MIN_ENDSTOP_INVERTING false
  306. #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN)
  307. #else
  308. #define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE)
  309. #endif
  310. #endif
  311. /**
  312. * Set a flag for a servo probe
  313. */
  314. #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0)
  315. /**
  316. * Set a flag for any enabled probe
  317. */
  318. #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))
  319. /**
  320. * Clear probe pin settings when no probe is selected
  321. */
  322. #if !PROBE_SELECTED
  323. #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
  324. #undef Z_MIN_PROBE_ENDSTOP
  325. #endif
  326. #endif //CONDITIONALS_LCD_H