variant_MARLIN_STM32G0B1RE.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 PD8 55
  73. #define PD9 56
  74. #define PF0 57
  75. #define PF1 58
  76. #define PF2 59
  77. #define PA9_R 60
  78. #define PA10_R 61
  79. // Alternate pins number
  80. #define PA1_ALT1 (PA1 | ALT1)
  81. #define PA2_ALT1 (PA2 | ALT1)
  82. #define PA3_ALT1 (PA3 | ALT1)
  83. #define PA4_ALT1 (PA4 | ALT1)
  84. #define PA6_ALT1 (PA6 | ALT1)
  85. #define PA6_ALT2 (PA6 | ALT2)
  86. #define PA7_ALT1 (PA7 | ALT1)
  87. #define PA7_ALT2 (PA7 | ALT2)
  88. #define PA7_ALT3 (PA7 | ALT3)
  89. #define PA9_ALT1 (PA9 | ALT1)
  90. #define PA9_R_ALT1 (PA9_R | ALT1)
  91. #define PA10_ALT1 (PA10 | ALT1)
  92. #define PA10_R_ALT1 (PA10_R | ALT1)
  93. #define PA14_ALT1 (PA14 | ALT1)
  94. #define PA15_ALT1 (PA15 | ALT1)
  95. #define PB0_ALT1 (PB0 | ALT1)
  96. #define PB1_ALT1 (PB1 | ALT1)
  97. #define PB1_ALT2 (PB1 | ALT2)
  98. #define PB3_ALT1 (PB3 | ALT1)
  99. #define PB4_ALT1 (PB4 | ALT1)
  100. #define PB5_ALT1 (PB5 | ALT1)
  101. #define PB6_ALT1 (PB6 | ALT1)
  102. #define PB6_ALT2 (PB6 | ALT2)
  103. #define PB7_ALT1 (PB7 | ALT1)
  104. #define PB8_ALT1 (PB8 | ALT1)
  105. #define PB9_ALT1 (PB9 | ALT1)
  106. #define PB13_ALT1 (PB13 | ALT1)
  107. #define PB14_ALT1 (PB14 | ALT1)
  108. #define PB15_ALT1 (PB15 | ALT1)
  109. #define PB15_ALT2 (PB15 | ALT2)
  110. #define PC0_ALT1 (PC0 | ALT1)
  111. #define PC1_ALT1 (PC1 | ALT1)
  112. #define PC4_ALT1 (PC4 | ALT1)
  113. #define PC5_ALT1 (PC5 | ALT1)
  114. #define PC6_ALT1 (PC6 | ALT1)
  115. #define PC7_ALT1 (PC7 | ALT1)
  116. #define PC8_ALT1 (PC8 | ALT1)
  117. #define PC9_ALT1 (PC9 | ALT1)
  118. #define PC10_ALT1 (PC10 | ALT1)
  119. #define PC11_ALT1 (PC11 | ALT1)
  120. #define PD4_ALT1 (PD4 | ALT1)
  121. #define NUM_DIGITAL_PINS 62
  122. #define NUM_REMAP_PINS 2
  123. #define NUM_ANALOG_INPUTS 16
  124. #define NUM_ANALOG_FIRST PA0
  125. // SPI definitions
  126. #ifndef PIN_SPI_SS
  127. #define PIN_SPI_SS PA4
  128. #endif
  129. #ifndef PIN_SPI_MOSI
  130. #define PIN_SPI_MOSI PA7
  131. #endif
  132. #ifndef PIN_SPI_MISO
  133. #define PIN_SPI_MISO PA6
  134. #endif
  135. #ifndef PIN_SPI_SCK
  136. #define PIN_SPI_SCK PA5
  137. #endif
  138. // I2C definitions
  139. #ifndef PIN_WIRE_SDA
  140. #define PIN_WIRE_SDA PB6
  141. #endif
  142. #ifndef PIN_WIRE_SCL
  143. #define PIN_WIRE_SCL PB7
  144. #endif
  145. // Timer Definitions
  146. // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
  147. #ifndef TIMER_TONE
  148. #define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file
  149. #endif
  150. #ifndef TIMER_SERVO
  151. #define TIMER_SERVO TIM7 // TIMER_SERVO must be defined in this file
  152. #endif
  153. // UART Definitions
  154. #ifndef SERIAL_UART_INSTANCE
  155. #define SERIAL_UART_INSTANCE 2
  156. #endif
  157. // Default pin used for generic 'Serial' instance
  158. // Mandatory for Firmata
  159. #ifndef PIN_SERIAL_RX
  160. #define PIN_SERIAL_RX PA3
  161. #endif
  162. #ifndef PIN_SERIAL_TX
  163. #define PIN_SERIAL_TX PA2
  164. #endif
  165. /*----------------------------------------------------------------------------
  166. * Arduino objects - C++ only
  167. *----------------------------------------------------------------------------*/
  168. #ifdef __cplusplus
  169. // These serial port names are intended to allow libraries and architecture-neutral
  170. // sketches to automatically default to the correct port name for a particular type
  171. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  172. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  173. //
  174. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  175. //
  176. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  177. //
  178. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  179. //
  180. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  181. //
  182. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  183. // pins are NOT connected to anything by default.
  184. #ifndef SERIAL_PORT_MONITOR
  185. #define SERIAL_PORT_MONITOR Serial
  186. #endif
  187. #ifndef SERIAL_PORT_HARDWARE
  188. #define SERIAL_PORT_HARDWARE Serial2
  189. #endif
  190. #endif