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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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
  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. // Default pin used for 'Serial' instance (ex: ST-Link)
  158. // Mandatory for Firmata
  159. #define PIN_SERIAL_RX PA10
  160. #define PIN_SERIAL_TX PA9
  161. // Timer Definitions
  162. #define TIMER_SERVO TIM4 // TIMER_SERVO must be defined in this file
  163. /* SD detect signal */
  164. /*
  165. * By default, R67 is not provided, so SD card detect is not used.
  166. * Note: SD CD (pin 16 of expansion connector J23) can be connected
  167. * to GND in order to be able to use SD_DETECT_PIN
  168. */
  169. /*#define SD_DETECT_PIN PA15*/
  170. /* HAL configuration */
  171. #define HSE_VALUE 25000000U
  172. /* Extra HAL modules */
  173. #define HAL_SD_MODULE_ENABLED
  174. #endif
  175. #ifdef __cplusplus
  176. } // extern "C"
  177. #endif
  178. /*----------------------------------------------------------------------------
  179. * Arduino objects - C++ only
  180. *----------------------------------------------------------------------------*/
  181. #ifdef __cplusplus
  182. // These serial port names are intended to allow libraries and architecture-neutral
  183. // sketches to automatically default to the correct port name for a particular type
  184. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  185. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  186. //
  187. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  188. //
  189. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  190. //
  191. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  192. //
  193. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  194. //
  195. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  196. // pins are NOT connected to anything by default.
  197. #define SERIAL_PORT_MONITOR Serial
  198. #define SERIAL_PORT_HARDWARE Serial1
  199. #endif
  200. #endif // _VARIANT_ARDUINO_STM32_
  201. // PA0 54 // E1_THERMISTOR
  202. // PA1 55 // E2_THERMISTOR
  203. // PA2 56 // E3_THERMISTOR
  204. // PA3 53 // BED_THERMISTOR_3
  205. // PA4 16 // SPI_CS
  206. // PA5 17 // SPI_SCK
  207. // PA6 18 // SPI_MISO
  208. // PA7 19 // SPI_MOSI
  209. // PA8 43 // V_STOP
  210. // PA9 0 //TX
  211. // PA10 1 //RX
  212. // PA11 30 //OTG_DM
  213. // PA12 31 //OTG_DP
  214. // PA13 20 // JTAG_TMS/SWDIO
  215. // PA14 21 // JTAG_TCK/SWCLK
  216. // PA15 25 // SD_CARD_DETECT
  217. // PB0 49 // E2_HEAT_PWM
  218. // PB1 50 // E3_HEAT_PWM
  219. // PB3 22 // JTAG_TDO/SWO
  220. // PB4 37 // USER4
  221. // PB5 6 // WIFI_WAKEUP
  222. // PB6 15 // SCL
  223. // PB7 14 // SDA
  224. // PB8 77 // E3_PWM
  225. // PB9 35 // USER1
  226. // PB10 64 // Y_PWM
  227. // PB12 10 // SPI_CS
  228. // PB13 13 // SPI_SCK
  229. // PB14 12 // SPI_MISO
  230. // PB15 11 // SPI_MOSI
  231. // PC0 68 // Z_DIR
  232. // PC1 33 //IR_ON
  233. // PC2 51 // BED_THERMISTOR_1
  234. // PC3 52 // BED_THERMISTOR_2
  235. // PC4 57 // E1_FAN
  236. // PC5 58 // E2_FAN
  237. // PC6 67 // Z_PWM
  238. // PC7 48 // E1_HEAT_PWM
  239. // PC8 23 // SDIO_D0
  240. // PC9 24 // SDIO_D1
  241. // PC10 26 // SDIO_D2
  242. // PC11 27 // SDIO_D3
  243. // PC12 28 // SDIO_CK
  244. // PC13 70 // E1_DIR
  245. // PC14 69 // E1_RESET
  246. // PC15 66 // Z_RESET
  247. // PD0 44 // W_STOP
  248. // PD1 32 //IR_OUT
  249. // PD2 29 // SDIO_CMD
  250. // PD3 2 // CTS
  251. // PD4 3 // RTS
  252. // PD5 4 // TX
  253. // PD6 5 // RX
  254. // PD7 34 // USER3
  255. // PD8 39 // X_STOP
  256. // PD9 40 // Y_STOP
  257. // PD10 41 // Z_STOP
  258. // PD11 42 // U_STOP
  259. // PD12 71 // E1_PWM
  260. // PD13 45 // BED_HEAT_2
  261. // PD14 46 // BED_HEAT_1
  262. // PD15 47 // BED_HEAT_3
  263. // PE0 36 // USER2
  264. // PE1 9 // STATUS_LED
  265. // PE2 76 // E3_DIR
  266. // PE3 75 // E3_RESET
  267. // PE4 72 // E2_RESET
  268. // PE5 73 // E2_PWM
  269. // PE6 74 // E2_DIR
  270. // PE7 38 // USER_BUTTON
  271. // PE8 59 // E3_FAN
  272. // PE9 65 // Y_DIR
  273. // PE10 63 // Y_RESET
  274. // PE11 7 // WIFI_RESET
  275. // PE12 8 // WIFI_BOOT
  276. // PE13 60 // X_RESET
  277. // PE14 61 // X_PWM
  278. // PE15 62 // X_DIR