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.

pins_LERDGE_K.h 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #define ALLOW_STM32DUINO
  24. #include "env_validate.h"
  25. #if HOTENDS > 2 || E_STEPPERS > 2
  26. #error "LERDGE K supports up to 2 hotends / E steppers."
  27. #endif
  28. #define BOARD_INFO_NAME "Lerdge K"
  29. #define DEFAULT_MACHINE_NAME "LERDGE"
  30. // EEPROM
  31. #if NO_EEPROM_SELECTED
  32. #define I2C_EEPROM
  33. #define SOFT_I2C_EEPROM // Force the use of Software I2C
  34. #define I2C_SCL_PIN PG14
  35. #define I2C_SDA_PIN PG13
  36. #define MARLIN_EEPROM_SIZE 0x10000
  37. #endif
  38. #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support
  39. //
  40. // Servos
  41. //
  42. #define SERVO0_PIN PB11
  43. //
  44. // Limit Switches
  45. //
  46. #define X_STOP_PIN PG3
  47. #define Y_STOP_PIN PG4
  48. #define Z_STOP_PIN PG5
  49. //
  50. // Z Probe (when not Z_MIN_PIN)
  51. //
  52. //#ifndef Z_MIN_PROBE_PIN
  53. // #define Z_MIN_PROBE_PIN PG6
  54. //#endif
  55. //
  56. // Filament runout
  57. //
  58. #define FIL_RUNOUT_PIN PE5
  59. #define FIL_RUNOUT2_PIN PE6
  60. //
  61. // Steppers
  62. //
  63. #define X_STEP_PIN PG1
  64. #define X_DIR_PIN PB10
  65. #define X_ENABLE_PIN PG0
  66. //#ifndef X_CS_PIN
  67. // #define X_CS_PIN PB2
  68. //#endif
  69. #define Y_STEP_PIN PF14
  70. #define Y_DIR_PIN PF15
  71. #define Y_ENABLE_PIN PF13
  72. //#ifndef Y_CS_PIN
  73. // #define Y_CS_PIN PE2
  74. //#endif
  75. #define Z_STEP_PIN PF11
  76. #define Z_DIR_PIN PF12
  77. #define Z_ENABLE_PIN PC5
  78. //#ifndef Z_CS_PIN
  79. // #define Z_CS_PIN PE3
  80. //#endif
  81. #define E0_STEP_PIN PC14
  82. #define E0_DIR_PIN PC13
  83. #define E0_ENABLE_PIN PC15
  84. //#ifndef E0_CS_PIN
  85. // #define E0_CS_PIN PE4
  86. //#endif
  87. #define E1_STEP_PIN PF1
  88. #define E1_DIR_PIN PF0
  89. #define E1_ENABLE_PIN PF2
  90. //#ifndef E1_CS_PIN
  91. // #define E1_CS_PIN PE1
  92. //#endif
  93. //#define Z2_STEP_PIN PF4
  94. //#define Z2_DIR_PIN PF3
  95. //#define Z2_ENABLE_PIN PF5
  96. //#define Z2_STOP_PIN PG2
  97. //#ifndef Z2_CS_PIN
  98. // #define Z2_CS_PIN PE0
  99. //#endif
  100. #if HAS_TMC_UART
  101. /**
  102. * TMC2208/TMC2209 stepper drivers
  103. */
  104. #ifndef X_SERIAL_TX_PIN
  105. #define X_SERIAL_TX_PIN PB2
  106. #endif
  107. #ifndef X_SERIAL_RX_PIN
  108. #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
  109. #endif
  110. #ifndef Y_SERIAL_TX_PIN
  111. #define Y_SERIAL_TX_PIN PE2
  112. #endif
  113. #ifndef Y_SERIAL_RX_PIN
  114. #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
  115. #endif
  116. #ifndef Z_SERIAL_TX_PIN
  117. #define Z_SERIAL_TX_PIN PE3
  118. #endif
  119. #ifndef Z_SERIAL_RX_PIN
  120. #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
  121. #endif
  122. #ifndef E0_SERIAL_TX_PIN
  123. #define E0_SERIAL_TX_PIN PE4
  124. #endif
  125. #ifndef E0_SERIAL_RX_PIN
  126. #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
  127. #endif
  128. #ifndef E1_SERIAL_TX_PIN
  129. #define E1_SERIAL_TX_PIN PE1
  130. #endif
  131. #ifndef E1_SERIAL_RX_PIN
  132. #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
  133. #endif
  134. // Ex-motor can be any... X2/Y2/Z2 or E2
  135. #ifndef EX_SERIAL_TX_PIN
  136. #define EX_SERIAL_TX_PIN PE0
  137. #endif
  138. #ifndef EX_SERIAL_RX_PIN
  139. #define EX_SERIAL_RX_PIN EX_SERIAL_TX_PIN
  140. #endif
  141. //#define Z2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
  142. //#define Z2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
  143. //#define E2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
  144. //#define E2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
  145. // Reduce baud rate to improve software serial reliability
  146. #define TMC_BAUD_RATE 19200
  147. #endif
  148. //
  149. // Temperature Sensors
  150. //
  151. #define TEMP_0_PIN PC1 // Analog Input
  152. #define TEMP_1_PIN PC2 // Analog Input
  153. #define TEMP_BED_PIN PC0 // Analog Input
  154. // Lergde-K can choose thermocouple/thermistor mode in software.
  155. // For use with thermistors, these pins must be OUT/LOW.
  156. // This is done automatically.
  157. #define TEMP_0_TR_ENABLE_PIN PF10
  158. #define TEMP_1_TR_ENABLE_PIN PF9
  159. //
  160. // Heaters / Fans
  161. //
  162. #define HEATER_0_PIN PA1
  163. #define HEATER_1_PIN PA0
  164. #define HEATER_BED_PIN PA2
  165. #ifndef FAN_PIN
  166. #define FAN_PIN PF7
  167. #endif
  168. #define FAN1_PIN PF6
  169. #ifndef E0_AUTO_FAN_PIN
  170. #define E0_AUTO_FAN_PIN PB1
  171. #endif
  172. #ifndef E1_AUTO_FAN_PIN
  173. #define E1_AUTO_FAN_PIN PB0
  174. #endif
  175. #define CONTROLLER_FAN_PIN PF8
  176. //
  177. // LED / Lighting
  178. //
  179. #define LED_PIN PA15 // Status LED
  180. //#define CASE_LIGHT_PIN PB6 // LED Ribbon Connector (PWM TIM4_CH1)
  181. //#define NEOPIXEL_PIN -1
  182. #ifndef RGB_LED_R_PIN
  183. #define RGB_LED_R_PIN PB8 // swap R and G pin for compatibility with real wires
  184. #endif
  185. #ifndef RGB_LED_G_PIN
  186. #define RGB_LED_G_PIN PB7
  187. #endif
  188. #ifndef RGB_LED_B_PIN
  189. #define RGB_LED_B_PIN PB9
  190. #endif
  191. //
  192. // SD support
  193. //
  194. #define SDIO_SUPPORT
  195. #define SDIO_CLOCK 4800000
  196. #define SD_DETECT_PIN PA8
  197. #if DISABLED(SDIO_SUPPORT)
  198. #define SOFTWARE_SPI
  199. #define SD_SCK_PIN PC12
  200. #define SD_MISO_PIN PC8
  201. #define SD_MOSI_PIN PD2
  202. #define SD_SS_PIN PC11
  203. #define SDSS PC11
  204. #endif
  205. //
  206. // Misc. Functions
  207. //
  208. #define PS_ON_PIN PA4
  209. #define KILL_PIN -1
  210. #define POWER_LOSS_PIN PA4 // Power-loss / nAC_FAULT
  211. //
  212. // TFT with FSMC interface
  213. //
  214. #if HAS_FSMC_TFT
  215. #ifndef TFT_DRIVER
  216. #define TFT_DRIVER ST7796
  217. #endif
  218. #define ST7796S_INVERTED
  219. #define TFT_RESET_PIN PD6
  220. #define TFT_BACKLIGHT_PIN PD3
  221. #define FSMC_CS_PIN PD7
  222. #define FSMC_RS_PIN PD11
  223. #define TFT_CS_PIN FSMC_CS_PIN
  224. #define TFT_RS_PIN FSMC_RS_PIN
  225. #define TOUCH_CS_PIN PG15
  226. #define TOUCH_SCK_PIN PB3
  227. #define TOUCH_MOSI_PIN PB5
  228. #define TOUCH_MISO_PIN PB4
  229. #define TOUCH_INT_PIN PG12
  230. #endif
  231. #if IS_NEWPANEL
  232. #define BEEPER_PIN PC7
  233. #define BTN_EN1 PG11
  234. #define BTN_EN2 PG10
  235. #define BTN_ENC PG9
  236. #ifndef ENCODER_STEPS_PER_MENU_ITEM
  237. #define ENCODER_STEPS_PER_MENU_ITEM 2
  238. #endif
  239. #endif