variant_MARLIN_STM32G0B1VE.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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 PIN_A10
  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 PIN_A11
  44. #define PB11 PIN_A12
  45. #define PB12 PIN_A13
  46. #define PB13 29
  47. #define PB14 30
  48. #define PB15 31
  49. #define PC0 32
  50. #define PC1 33
  51. #define PC2 34
  52. #define PC3 35
  53. #define PC4 PIN_A14
  54. #define PC5 PIN_A15
  55. #define PC6 38
  56. #define PC7 39
  57. #define PC8 40
  58. #define PC9 41
  59. #define PC10 42
  60. #define PC11 43
  61. #define PC12 44
  62. #define PC13 45
  63. #define PC14 46
  64. #define PC15 47
  65. #define PD0 48
  66. #define PD1 49
  67. #define PD2 50
  68. #define PD3 51
  69. #define PD4 52
  70. #define PD5 53
  71. #define PD6 54
  72. #define PD7 55
  73. #define PD8 56
  74. #define PD9 57
  75. #define PD10 58
  76. #define PD11 59
  77. #define PD12 60
  78. #define PD13 61
  79. #define PD14 62
  80. #define PD15 63
  81. #define PE0 64
  82. #define PE1 65
  83. #define PE2 66
  84. #define PE3 67
  85. #define PE4 68
  86. #define PE5 69
  87. #define PE6 70
  88. #define PE7 71
  89. #define PE8 72
  90. #define PE9 73
  91. #define PE10 74
  92. #define PE11 75
  93. #define PE12 76
  94. #define PE13 77
  95. #define PE14 78
  96. #define PE15 79
  97. #define PF0 80
  98. #define PF1 81
  99. #define PF2 82
  100. #define PF3 83
  101. #define PF4 84
  102. #define PF5 85
  103. #define PF6 86
  104. #define PF7 87
  105. #define PF8 88
  106. #define PF9 89
  107. #define PF10 90
  108. #define PF11 91
  109. #define PF12 92
  110. #define PF13 93
  111. #define PA9_R 94
  112. #define PA10_R 95
  113. // Alternate pins number
  114. #define PA1_ALT1 (PA1 | ALT1)
  115. #define PA2_ALT1 (PA2 | ALT1)
  116. #define PA3_ALT1 (PA3 | ALT1)
  117. #define PA4_ALT1 (PA4 | ALT1)
  118. #define PA6_ALT1 (PA6 | ALT1)
  119. #define PA6_ALT2 (PA6 | ALT2)
  120. #define PA7_ALT1 (PA7 | ALT1)
  121. #define PA7_ALT2 (PA7 | ALT2)
  122. #define PA7_ALT3 (PA7 | ALT3)
  123. #define PA9_ALT1 (PA9 | ALT1)
  124. #define PA9_R_ALT1 (PA9_R | ALT1)
  125. #define PA10_ALT1 (PA10 | ALT1)
  126. #define PA10_R_ALT1 (PA10_R | ALT1)
  127. #define PA14_ALT1 (PA14 | ALT1)
  128. #define PA15_ALT1 (PA15 | ALT1)
  129. #define PB0_ALT1 (PB0 | ALT1)
  130. #define PB1_ALT1 (PB1 | ALT1)
  131. #define PB1_ALT2 (PB1 | ALT2)
  132. #define PB3_ALT1 (PB3 | ALT1)
  133. #define PB4_ALT1 (PB4 | ALT1)
  134. #define PB5_ALT1 (PB5 | ALT1)
  135. #define PB6_ALT1 (PB6 | ALT1)
  136. #define PB6_ALT2 (PB6 | ALT2)
  137. #define PB7_ALT1 (PB7 | ALT1)
  138. #define PB8_ALT1 (PB8 | ALT1)
  139. #define PB9_ALT1 (PB9 | ALT1)
  140. #define PB13_ALT1 (PB13 | ALT1)
  141. #define PB14_ALT1 (PB14 | ALT1)
  142. #define PB15_ALT1 (PB15 | ALT1)
  143. #define PB15_ALT2 (PB15 | ALT2)
  144. #define PC0_ALT1 (PC0 | ALT1)
  145. #define PC1_ALT1 (PC1 | ALT1)
  146. #define PC4_ALT1 (PC4 | ALT1)
  147. #define PC5_ALT1 (PC5 | ALT1)
  148. #define PC6_ALT1 (PC6 | ALT1)
  149. #define PC7_ALT1 (PC7 | ALT1)
  150. #define PC8_ALT1 (PC8 | ALT1)
  151. #define PC9_ALT1 (PC9 | ALT1)
  152. #define PC10_ALT1 (PC10 | ALT1)
  153. #define PC11_ALT1 (PC11 | ALT1)
  154. #define PD4_ALT1 (PD4 | ALT1)
  155. #define PF7_ALT1 (PF7 | ALT1)
  156. #define NUM_DIGITAL_PINS 96
  157. #define NUM_REMAP_PINS 2
  158. #define NUM_ANALOG_INPUTS 16
  159. // On-board LED pin number
  160. #ifndef LED_BUILTIN
  161. #define LED_BUILTIN PNUM_NOT_DEFINED
  162. #endif
  163. // On-board user button
  164. #ifndef USER_BTN
  165. #define USER_BTN PNUM_NOT_DEFINED
  166. #endif
  167. // SPI definitions
  168. #ifndef PIN_SPI_SS
  169. #define PIN_SPI_SS PA4
  170. #endif
  171. #ifndef PIN_SPI_SS1
  172. #define PIN_SPI_SS1 PA15
  173. #endif
  174. #ifndef PIN_SPI_SS2
  175. #define PIN_SPI_SS2 PB0
  176. #endif
  177. #ifndef PIN_SPI_SS3
  178. #define PIN_SPI_SS3 PD9
  179. #endif
  180. #ifndef PIN_SPI_MOSI
  181. #define PIN_SPI_MOSI PA2
  182. #endif
  183. #ifndef PIN_SPI_MISO
  184. #define PIN_SPI_MISO PA6
  185. #endif
  186. #ifndef PIN_SPI_SCK
  187. #define PIN_SPI_SCK PA1
  188. #endif
  189. // I2C definitions
  190. #ifndef PIN_WIRE_SDA
  191. #define PIN_WIRE_SDA PA6
  192. #endif
  193. #ifndef PIN_WIRE_SCL
  194. #define PIN_WIRE_SCL PA7
  195. #endif
  196. // Timer Definitions
  197. // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
  198. #ifndef TIMER_TONE
  199. #define TIMER_TONE TIM6
  200. #endif
  201. #ifndef TIMER_SERVO
  202. #define TIMER_SERVO TIM7
  203. #endif
  204. // UART Definitions
  205. #ifndef SERIAL_UART_INSTANCE
  206. #define SERIAL_UART_INSTANCE 4
  207. #endif
  208. // Default pin used for generic 'Serial' instance
  209. // Mandatory for Firmata
  210. #ifndef PIN_SERIAL_RX
  211. #define PIN_SERIAL_RX PA1
  212. #endif
  213. #ifndef PIN_SERIAL_TX
  214. #define PIN_SERIAL_TX PA0
  215. #endif
  216. // Extra HAL modules
  217. #ifndef HAL_DAC_MODULE_DISABLED
  218. #define HAL_DAC_MODULE_ENABLED
  219. #endif
  220. /*----------------------------------------------------------------------------
  221. * Arduino objects - C++ only
  222. *----------------------------------------------------------------------------*/
  223. #ifdef __cplusplus
  224. // These serial port names are intended to allow libraries and architecture-neutral
  225. // sketches to automatically default to the correct port name for a particular type
  226. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  227. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  228. //
  229. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  230. //
  231. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  232. //
  233. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  234. //
  235. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  236. //
  237. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  238. // pins are NOT connected to anything by default.
  239. #ifndef SERIAL_PORT_MONITOR
  240. #define SERIAL_PORT_MONITOR Serial
  241. #endif
  242. #ifndef SERIAL_PORT_HARDWARE
  243. #define SERIAL_PORT_HARDWARE Serial
  244. #endif
  245. #endif