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.

variant.h 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. /*
  2. *******************************************************************************
  3. * Copyright (c) 2017, STMicroelectronics
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice,
  10. * this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  15. * may be used to endorse or promote products derived from this software
  16. * without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  19. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  22. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  24. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  25. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  27. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *******************************************************************************
  29. */
  30. #ifndef _VARIANT_ARDUINO_STM32_
  31. #define _VARIANT_ARDUINO_STM32_
  32. /*----------------------------------------------------------------------------
  33. * Headers
  34. *----------------------------------------------------------------------------*/
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif // __cplusplus
  38. /*----------------------------------------------------------------------------
  39. * Pins
  40. *----------------------------------------------------------------------------*/
  41. #if defined(ARDUINO_STEVAL)
  42. /*----------------------------------------------------------------------------
  43. * Pins
  44. *----------------------------------------------------------------------------*/
  45. // USART1_MAIN
  46. #define PA9 0 //TX
  47. #define PA10 1 //RX
  48. // WIFI (USART2)
  49. #define PD3 2 // CTS
  50. #define PD4 3 // RTS
  51. #define PD5 4 // TX
  52. #define PD6 5 // RX
  53. #define PB5 6 // WIFI_WAKEUP
  54. #define PE11 7 // WIFI_RESET
  55. #define PE12 8 // WIFI_BOOT
  56. // STATUS_LED
  57. #define PE1 9 // STATUS_LED
  58. // SPI USER
  59. #define PB12 10 // SPI_CS
  60. #define PB15 11 // SPI_MOSI
  61. #define PB14 12 // SPI_MISO
  62. #define PB13 13 // SPI_SCK
  63. // I2C USER
  64. #define PB7 14 // SDA
  65. #define PB6 15 // SCL
  66. // SPI
  67. #define PA4 16 // SPI_CS
  68. #define PA5 17 // SPI_SCK
  69. #define PA6 18 // SPI_MISO
  70. #define PA7 19 // SPI_MOSI
  71. // JTAG
  72. #define PA13 20 // JTAG_TMS/SWDIO
  73. #define PA14 21 // JTAG_TCK/SWCLK
  74. #define PB3 22 // JTAG_TDO/SWO
  75. // SDCARD
  76. #define PC8 23 // SDIO_D0
  77. #define PC9 24 // SDIO_D1
  78. #define PA15 25 // SD_CARD_DETECT
  79. #define PC10 26 // SDIO_D2
  80. #define PC11 27 // SDIO_D3
  81. #define PC12 28 // SDIO_CK
  82. #define PD2 29 // SDIO_CMD
  83. // OTG
  84. #define PA11 30 //OTG_DM
  85. #define PA12 31 //OTG_DP
  86. // IR/PROBE
  87. #define PD1 32 //IR_OUT
  88. #define PC1 33 //IR_ON
  89. // USER_PINS
  90. #define PD7 34 // USER3
  91. #define PB9 35 // USER1
  92. #define PE0 36 // USER2
  93. #define PB4 37 // USER4
  94. // USERKET
  95. #define PE7 38 // USER_BUTTON
  96. // ENDSTOPS
  97. #define PD8 39 // X_STOP
  98. #define PD9 40 // Y_STOP
  99. #define PD10 41 // Z_STOP
  100. #define PD11 42 // U_STOP
  101. #define PA8 43 // V_STOP
  102. #define PD0 44 // W_STOP
  103. // HEATERS
  104. #define PD13 45 // BED_HEAT_2
  105. #define PD14 46 // BED_HEAT_1
  106. #define PD15 47 // BED_HEAT_3
  107. #define PC7 48 // E1_HEAT_PWM
  108. #define PB0 49 // E2_HEAT_PWM
  109. #define PB1 50 // E3_HEAT_PWM
  110. // THERMISTOR
  111. #define PC2 51 // BED_THERMISTOR_1
  112. #define PC3 52 // BED_THERMISTOR_2
  113. #define PA3 53 // BED_THERMISTOR_3
  114. #define PA0 54 // E1_THERMISTOR
  115. #define PA1 55 // E2_THERMISTOR
  116. #define PA2 56 // E3_THERMISTOR
  117. // FANS
  118. #define PC4 57 // E1_FAN
  119. #define PC5 58 // E2_FAN
  120. #define PE8 59 // E3_FAN
  121. // X_MOTOR
  122. #define PE13 60 // X_RESET
  123. #define PE14 61 // X_PWM
  124. #define PE15 62 // X_DIR
  125. // Y_MOTOR
  126. #define PE10 63 // Y_RESET
  127. #define PB10 64 // Y_PWM
  128. #define PE9 65 // Y_DIR
  129. // Z_MOTOR
  130. #define PC15 66 // Z_RESET
  131. #define PC6 67 // Z_PWM
  132. #define PC0 68 // Z_DIR
  133. // E1_MOTOR
  134. #define PC14 69 // E1_RESET
  135. #define PC13 70 // E1_DIR
  136. #define PD12 71 // E1_PWM
  137. // E2_MOTOR
  138. #define PE4 72 // E2_RESET
  139. #define PE5 73 // E2_PWM
  140. #define PE6 74 // E2_DIR
  141. // E3_MOTOR
  142. #define PE3 75 // E3_RESET
  143. #define PE2 76 // E3_DIR
  144. #define PB8 77 // E3_PWM
  145. // This must be a literal
  146. #define NUM_DIGITAL_PINS 78
  147. // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
  148. #define NUM_ANALOG_INPUTS 6
  149. #define NUM_ANALOG_FIRST 51
  150. // On-board LED pin number
  151. #define LED_BUILTIN PE1
  152. #define LED_GREEN LED_BUILTIN
  153. // On-board user button
  154. #define USER_BTN PE7
  155. // UART Definitions
  156. #define SERIAL_UART_INSTANCE 1 // Connected to ST-Link
  157. //#define SERIAL_UART_INSTANCE 2 // Connected to WIFI
  158. // Default pin used for 'Serial' instance (ex: ST-Link)
  159. // Mandatory for Firmata
  160. #if SERIAL_UART_INSTANCE == 1 // ST-Link & J23
  161. #define PIN_SERIAL_RX PA10
  162. #define PIN_SERIAL_TX PA9
  163. #elif SERIAL_UART_INSTANCE == 2 // WIFI interface
  164. #define PIN_SERIAL2_RX PD6
  165. #define PIN_SERIAL2_TX PD5
  166. #else
  167. #error'Invalid setting for SERIAL_UART_INSTANCE'
  168. #endif
  169. // Timer Definitions
  170. #define TIMER_SERVO TIM4 // TIMER_SERVO must be defined in this file
  171. #define TIMER_TONE TIM5 // TIMER_TONE must be defined in this file
  172. /* SD detect signal */
  173. /*
  174. * By default, R67 is not provided, so SD card detect is not used.
  175. * Note: SD CD (pin 16 of expansion connector J23) can be connected
  176. * to GND in order to be able to use SD_DETECT_PIN
  177. */
  178. /*#define SD_DETECT_PIN PA15*/
  179. /* HAL configuration */
  180. #define HSE_VALUE 25000000U
  181. /* Extra HAL modules */
  182. #define HAL_SD_MODULE_ENABLED
  183. #endif
  184. #ifdef __cplusplus
  185. } // extern "C"
  186. #endif
  187. /*----------------------------------------------------------------------------
  188. * Arduino objects - C++ only
  189. *----------------------------------------------------------------------------*/
  190. #ifdef __cplusplus
  191. // These serial port names are intended to allow libraries and architecture-neutral
  192. // sketches to automatically default to the correct port name for a particular type
  193. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  194. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  195. //
  196. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  197. //
  198. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  199. //
  200. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  201. //
  202. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  203. //
  204. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  205. // pins are NOT connected to anything by default.
  206. #define SERIAL_PORT_MONITOR Serial
  207. #define SERIAL_PORT_HARDWARE Serial1
  208. #endif
  209. #endif // _VARIANT_ARDUINO_STM32_
  210. // PA0 54 // E1_THERMISTOR
  211. // PA1 55 // E2_THERMISTOR
  212. // PA2 56 // E3_THERMISTOR
  213. // PA3 53 // BED_THERMISTOR_3
  214. // PA4 16 // SPI_CS
  215. // PA5 17 // SPI_SCK
  216. // PA6 18 // SPI_MISO
  217. // PA7 19 // SPI_MOSI
  218. // PA8 43 // V_STOP
  219. // PA9 0 //TX
  220. // PA10 1 //RX
  221. // PA11 30 //OTG_DM
  222. // PA12 31 //OTG_DP
  223. // PA13 20 // JTAG_TMS/SWDIO
  224. // PA14 21 // JTAG_TCK/SWCLK
  225. // PA15 25 // SD_CARD_DETECT
  226. // PB0 49 // E2_HEAT_PWM
  227. // PB1 50 // E3_HEAT_PWM
  228. // PB3 22 // JTAG_TDO/SWO
  229. // PB4 37 // USER4
  230. // PB5 6 // WIFI_WAKEUP
  231. // PB6 15 // SCL
  232. // PB7 14 // SDA
  233. // PB8 77 // E3_PWM
  234. // PB9 35 // USER1
  235. // PB10 64 // Y_PWM
  236. // PB12 10 // SPI_CS
  237. // PB13 13 // SPI_SCK
  238. // PB14 12 // SPI_MISO
  239. // PB15 11 // SPI_MOSI
  240. // PC0 68 // Z_DIR
  241. // PC1 33 //IR_ON
  242. // PC2 51 // BED_THERMISTOR_1
  243. // PC3 52 // BED_THERMISTOR_2
  244. // PC4 57 // E1_FAN
  245. // PC5 58 // E2_FAN
  246. // PC6 67 // Z_PWM
  247. // PC7 48 // E1_HEAT_PWM
  248. // PC8 23 // SDIO_D0
  249. // PC9 24 // SDIO_D1
  250. // PC10 26 // SDIO_D2
  251. // PC11 27 // SDIO_D3
  252. // PC12 28 // SDIO_CK
  253. // PC13 70 // E1_DIR
  254. // PC14 69 // E1_RESET
  255. // PC15 66 // Z_RESET
  256. // PD0 44 // W_STOP
  257. // PD1 32 //IR_OUT
  258. // PD2 29 // SDIO_CMD
  259. // PD3 2 // CTS
  260. // PD4 3 // RTS
  261. // PD5 4 // TX
  262. // PD6 5 // RX
  263. // PD7 34 // USER3
  264. // PD8 39 // X_STOP
  265. // PD9 40 // Y_STOP
  266. // PD10 41 // Z_STOP
  267. // PD11 42 // U_STOP
  268. // PD12 71 // E1_PWM
  269. // PD13 45 // BED_HEAT_2
  270. // PD14 46 // BED_HEAT_1
  271. // PD15 47 // BED_HEAT_3
  272. // PE0 36 // USER2
  273. // PE1 9 // STATUS_LED
  274. // PE2 76 // E3_DIR
  275. // PE3 75 // E3_RESET
  276. // PE4 72 // E2_RESET
  277. // PE5 73 // E2_PWM
  278. // PE6 74 // E2_DIR
  279. // PE7 38 // USER_BUTTON
  280. // PE8 59 // E3_FAN
  281. // PE9 65 // Y_DIR
  282. // PE10 63 // Y_RESET
  283. // PE11 7 // WIFI_RESET
  284. // PE12 8 // WIFI_BOOT
  285. // PE13 60 // X_RESET
  286. // PE14 61 // X_PWM
  287. // PE15 62 // X_DIR