variant_MARLIN_STM32H723ZE.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. /*
  2. *******************************************************************************
  3. * Copyright (c) 2020-2021, STMicroelectronics
  4. * All rights reserved.
  5. *
  6. * This software component is licensed by ST under BSD 3-Clause license,
  7. * the "License"; You may not use this file except in compliance with the
  8. * License. You may obtain a copy of the License at:
  9. * opensource.org/licenses/BSD-3-Clause
  10. *
  11. *******************************************************************************
  12. */
  13. #pragma once
  14. /*----------------------------------------------------------------------------
  15. * STM32 pins number
  16. *----------------------------------------------------------------------------*/
  17. #define PA0 PIN_A0
  18. #define PA1 PIN_A1
  19. #define PA2 PIN_A2
  20. #define PA3 PIN_A3
  21. #define PA4 PIN_A4
  22. #define PA5 PIN_A5
  23. #define PA6 PIN_A6
  24. #define PA7 PIN_A7
  25. #define PA8 8
  26. #define PA9 9
  27. #define PA10 10
  28. #define PA11 11
  29. #define PA12 12
  30. #define PA13 13
  31. #define PA14 14
  32. #define PA15 15
  33. #define PB0 PIN_A8
  34. #define PB1 PIN_A9
  35. #define PB2 18
  36. #define PB3 19
  37. #define PB4 20
  38. #define PB5 21
  39. #define PB6 22
  40. #define PB7 23
  41. #define PB8 24
  42. #define PB9 25
  43. #define PB10 26
  44. #define PB11 27
  45. #define PB12 28
  46. #define PB13 29
  47. #define PB14 30
  48. #define PB15 31
  49. #define PC0 PIN_A10
  50. #define PC1 PIN_A11
  51. #define PC4 PIN_A12
  52. #define PC5 PIN_A13
  53. #define PC6 36
  54. #define PC7 37
  55. #define PC8 38
  56. #define PC9 39
  57. #define PC10 40
  58. #define PC11 41
  59. #define PC12 42
  60. #define PC13 43
  61. #define PC14 44
  62. #define PC15 45
  63. #define PD0 46
  64. #define PD1 47
  65. #define PD2 48
  66. #define PD3 49
  67. #define PD4 50
  68. #define PD5 51
  69. #define PD6 52
  70. #define PD7 53
  71. #define PD8 54
  72. #define PD9 55
  73. #define PD10 56
  74. #define PD11 57
  75. #define PD12 58
  76. #define PD13 59
  77. #define PD14 60
  78. #define PD15 61
  79. #define PE0 62
  80. #define PE1 63
  81. #define PE2 64
  82. #define PE3 65
  83. #define PE4 66
  84. #define PE5 67
  85. #define PE6 68
  86. #define PE7 69
  87. #define PE8 70
  88. #define PE9 71
  89. #define PE10 72
  90. #define PE11 73
  91. #define PE12 74
  92. #define PE13 75
  93. #define PE14 76
  94. #define PE15 77
  95. #define PF0 78
  96. #define PF1 79
  97. #define PF2 80
  98. #define PF3 PIN_A14
  99. #define PF4 PIN_A15
  100. #define PF5 PIN_A16
  101. #define PF6 PIN_A17
  102. #define PF7 PIN_A18
  103. #define PF8 PIN_A19
  104. #define PF9 PIN_A20
  105. #define PF10 PIN_A21
  106. #define PF11 PIN_A22
  107. #define PF12 PIN_A23
  108. #define PF13 PIN_A24
  109. #define PF14 PIN_A25
  110. #define PF15 93
  111. #define PG0 94
  112. #define PG1 95
  113. #define PG2 96
  114. #define PG3 97
  115. #define PG4 98
  116. #define PG5 99
  117. #define PG6 100
  118. #define PG7 101
  119. #define PG8 102
  120. #define PG9 103
  121. #define PG10 104
  122. #define PG11 105
  123. #define PG12 106
  124. #define PG13 107
  125. #define PG14 108
  126. #define PG15 109
  127. #define PH0 110
  128. #define PH1 111
  129. #define PC2_C PIN_A26
  130. #define PC3_C PIN_A27
  131. #define PC2 PC2_C
  132. #define PC3 PC3_C
  133. // Alternate pins number
  134. #define PA0_ALT1 (PA0 | ALT1)
  135. #define PA1_ALT1 (PA1 | ALT1)
  136. #define PA1_ALT2 (PA1 | ALT2)
  137. #define PA2_ALT1 (PA2 | ALT1)
  138. #define PA2_ALT2 (PA2 | ALT2)
  139. #define PA3_ALT1 (PA3 | ALT1)
  140. #define PA3_ALT2 (PA3 | ALT2)
  141. #define PA4_ALT1 (PA4 | ALT1)
  142. #define PA4_ALT2 (PA4 | ALT2)
  143. #define PA5_ALT1 (PA5 | ALT1)
  144. #define PA6_ALT1 (PA6 | ALT1)
  145. #define PA7_ALT1 (PA7 | ALT1)
  146. #define PA7_ALT2 (PA7 | ALT2)
  147. #define PA7_ALT3 (PA7 | ALT3)
  148. #define PA8_ALT1 (PA8 | ALT1)
  149. #define PA9_ALT1 (PA9 | ALT1)
  150. #define PA10_ALT1 (PA10 | ALT1)
  151. #define PA11_ALT1 (PA11 | ALT1)
  152. #define PA12_ALT1 (PA12 | ALT1)
  153. #define PA15_ALT1 (PA15 | ALT1)
  154. #define PA15_ALT2 (PA15 | ALT2)
  155. #define PB0_ALT1 (PB0 | ALT1)
  156. #define PB0_ALT2 (PB0 | ALT2)
  157. #define PB1_ALT1 (PB1 | ALT1)
  158. #define PB1_ALT2 (PB1 | ALT2)
  159. #define PB3_ALT1 (PB3 | ALT1)
  160. #define PB3_ALT2 (PB3 | ALT2)
  161. #define PB4_ALT1 (PB4 | ALT1)
  162. #define PB4_ALT2 (PB4 | ALT2)
  163. #define PB5_ALT1 (PB5 | ALT1)
  164. #define PB5_ALT2 (PB5 | ALT2)
  165. #define PB6_ALT1 (PB6 | ALT1)
  166. #define PB6_ALT2 (PB6 | ALT2)
  167. #define PB7_ALT1 (PB7 | ALT1)
  168. #define PB8_ALT1 (PB8 | ALT1)
  169. #define PB8_ALT2 (PB8 | ALT2)
  170. #define PB9_ALT1 (PB9 | ALT1)
  171. #define PB9_ALT2 (PB9 | ALT2)
  172. #define PB14_ALT1 (PB14 | ALT1)
  173. #define PB14_ALT2 (PB14 | ALT2)
  174. #define PB15_ALT1 (PB15 | ALT1)
  175. #define PB15_ALT2 (PB15 | ALT2)
  176. #define PC0_ALT1 (PC0 | ALT1)
  177. #define PC0_ALT2 (PC0 | ALT2)
  178. #define PC1_ALT1 (PC1 | ALT1)
  179. #define PC1_ALT2 (PC1 | ALT2)
  180. #define PC4_ALT1 (PC4 | ALT1)
  181. #define PC5_ALT1 (PC5 | ALT1)
  182. #define PC6_ALT1 (PC6 | ALT1)
  183. #define PC6_ALT2 (PC6 | ALT2)
  184. #define PC7_ALT1 (PC7 | ALT1)
  185. #define PC7_ALT2 (PC7 | ALT2)
  186. #define PC8_ALT1 (PC8 | ALT1)
  187. #define PC9_ALT1 (PC9 | ALT1)
  188. #define PC10_ALT1 (PC10 | ALT1)
  189. #define PC11_ALT1 (PC11 | ALT1)
  190. #define PF0_ALT1 (PF0 | ALT1)
  191. #define PF1_ALT1 (PF1 | ALT1)
  192. #define PF6_ALT1 (PF6 | ALT1)
  193. #define PF7_ALT1 (PF7 | ALT1)
  194. #define PF8_ALT1 (PF8 | ALT1)
  195. #define PF8_ALT2 (PF8 | ALT2)
  196. #define PF9_ALT1 (PF9 | ALT1)
  197. #define PF9_ALT2 (PF9 | ALT2)
  198. #define PG13_ALT1 (PG13 | ALT1)
  199. #define NUM_DIGITAL_PINS 116
  200. #define NUM_DUALPAD_PINS 2
  201. #define NUM_ANALOG_INPUTS 30
  202. #define NUM_ANALOG_FIRST PA0
  203. // On-board LED pin number
  204. #ifndef LED_BUILTIN
  205. #define LED_BUILTIN PNUM_NOT_DEFINED
  206. #endif
  207. // On-board user button
  208. #ifndef USER_BTN
  209. #define USER_BTN PNUM_NOT_DEFINED
  210. #endif
  211. // SPI definitions
  212. #ifndef PIN_SPI_SS
  213. #define PIN_SPI_SS PA4
  214. #endif
  215. #ifndef PIN_SPI_SS1
  216. #define PIN_SPI_SS1 PA15
  217. #endif
  218. #ifndef PIN_SPI_SS2
  219. #define PIN_SPI_SS2 PG10
  220. #endif
  221. #ifndef PIN_SPI_SS3
  222. #define PIN_SPI_SS3 PNUM_NOT_DEFINED
  223. #endif
  224. #ifndef PIN_SPI_MOSI
  225. #define PIN_SPI_MOSI PA7
  226. #endif
  227. #ifndef PIN_SPI_MISO
  228. #define PIN_SPI_MISO PA6
  229. #endif
  230. #ifndef PIN_SPI_SCK
  231. #define PIN_SPI_SCK PA5
  232. #endif
  233. // I2C definitions
  234. #ifndef PIN_WIRE_SDA
  235. #define PIN_WIRE_SDA PB7
  236. #endif
  237. #ifndef PIN_WIRE_SCL
  238. #define PIN_WIRE_SCL PB6
  239. #endif
  240. // Timer Definitions
  241. // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
  242. #ifndef TIMER_TONE
  243. #define TIMER_TONE TIM6
  244. #endif
  245. #ifndef TIMER_SERVO
  246. #define TIMER_SERVO TIM7
  247. #endif
  248. // UART Definitions
  249. #ifndef SERIAL_UART_INSTANCE
  250. #define SERIAL_UART_INSTANCE 4
  251. #endif
  252. // Default pin used for generic 'Serial' instance
  253. // Mandatory for Firmata
  254. #ifndef PIN_SERIAL_RX
  255. #define PIN_SERIAL_RX PA1
  256. #endif
  257. #ifndef PIN_SERIAL_TX
  258. #define PIN_SERIAL_TX PA0
  259. #endif
  260. // Extra HAL modules
  261. #ifndef HAL_DAC_MODULE_DISABLED
  262. #define HAL_DAC_MODULE_ENABLED
  263. #endif
  264. #ifndef HAL_ETH_MODULE_DISABLED
  265. #define HAL_ETH_MODULE_ENABLED
  266. #endif
  267. #ifndef HAL_OSPI_MODULE_DISABLED
  268. #define HAL_OSPI_MODULE_ENABLED
  269. #endif
  270. #ifndef HAL_SD_MODULE_DISABLED
  271. #define HAL_SD_MODULE_ENABLED
  272. #endif
  273. /*----------------------------------------------------------------------------
  274. * Arduino objects - C++ only
  275. *----------------------------------------------------------------------------*/
  276. #ifdef __cplusplus
  277. // These serial port names are intended to allow libraries and architecture-neutral
  278. // sketches to automatically default to the correct port name for a particular type
  279. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  280. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  281. //
  282. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  283. //
  284. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  285. //
  286. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  287. //
  288. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  289. //
  290. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  291. // pins are NOT connected to anything by default.
  292. #ifndef SERIAL_PORT_MONITOR
  293. #define SERIAL_PORT_MONITOR Serial
  294. #endif
  295. #ifndef SERIAL_PORT_HARDWARE
  296. #define SERIAL_PORT_HARDWARE Serial
  297. #endif
  298. #endif