variant.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /*
  2. Copyright (c) 2011 Arduino. All right reserved.
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with this library; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  14. */
  15. #ifndef _VARIANT_ARDUINO_STM32_
  16. #define _VARIANT_ARDUINO_STM32_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif // __cplusplus
  20. /*----------------------------------------------------------------------------
  21. * Pins
  22. *----------------------------------------------------------------------------*/
  23. #define PA0 0 //D0
  24. #define PA1 1 //D1
  25. #define PA2 2 //D2
  26. #define PA3 3 //D3
  27. #define PA4 4 //D4
  28. #define PA5 5 //D5
  29. #define PA6 6 //D6
  30. #define PA7 7 //D7
  31. #define PA8 8 //D8
  32. #define PA9 9 //D9
  33. #define PA10 10 //D10
  34. #define PA11 11 //D11
  35. #define PA12 12 //D12
  36. #define PA13 13 //D13
  37. #define PA14 14 //D14
  38. #define PA15 15 //D15
  39. #define PB0 16 //D16
  40. #define PB1 17 //D17
  41. #define PB2 18 //D18
  42. #define PB3 19 //D19
  43. #define PB4 20 //D20
  44. #define PB5 21 //D21
  45. #define PB6 22 //D22
  46. #define PB7 23 //D23
  47. #define PB8 24 //D24
  48. #define PB9 25 //D25
  49. #define PB10 26 //D26
  50. #define PB11 27 //D27
  51. #define PB12 28 //D28
  52. #define PB13 29 //D29
  53. #define PB14 30 //D30
  54. #define PB15 31 //D31
  55. #define PC0 32 //D32
  56. #define PC1 33 //D33
  57. #define PC2 34 //D34
  58. #define PC3 35 //D35
  59. #define PC4 36 //D36
  60. #define PC5 37 //D37
  61. #define PC6 38 //D38
  62. #define PC7 39 //D39
  63. #define PC8 40 //D40
  64. #define PC9 41 //D41
  65. #define PC10 42 //D42
  66. #define PC11 43 //D43
  67. #define PC12 44 //D44
  68. #define PC13 45 //D45
  69. #define PC14 46 //D46
  70. #define PC15 47 //D47
  71. #define PD0 48 //D48
  72. #define PD1 49 //D49
  73. #define PD2 50 //D50
  74. #define PD3 51 //D51
  75. #define PD4 52 //D52
  76. #define PD5 53 //D53
  77. #define PD6 54 //D54
  78. #define PD7 55 //D55
  79. #define PD8 56 //D56
  80. #define PD9 57 //D57
  81. #define PD10 58 //D58
  82. #define PD11 59 //D59
  83. #define PD12 60 //D60
  84. #define PD13 61 //D61
  85. #define PD14 62 //D62
  86. #define PD15 63 //D63
  87. #define PE0 64 //D64
  88. #define PE1 65 //D65
  89. #define PE2 66 //D66
  90. #define PE3 67 //D67
  91. #define PE4 68 //D68
  92. #define PE5 69 //D69
  93. #define PE6 70 //D70
  94. #define PE7 71 //D71
  95. #define PE8 72 //D72
  96. #define PE9 73 //D73
  97. #define PE10 74 //D74
  98. #define PE11 75 //D75
  99. #define PE12 76 //D76
  100. #define PE13 77 //D77
  101. #define PE14 78 //D78
  102. #define PE15 79 //D79
  103. #define PF0 80 //D64
  104. #define PF1 81 //D65
  105. #define PF2 82 //D66
  106. #define PF3 83 //D67
  107. #define PF4 84 //D68
  108. #define PF5 85 //D69
  109. #define PF6 86 //D70
  110. #define PF7 87 //D71
  111. #define PF8 88 //D72
  112. #define PF9 89 //D73
  113. #define PF10 90 //D74
  114. #define PF11 91 //D75
  115. #define PF12 92 //D76
  116. #define PF13 93 //D77
  117. #define PF14 94 //D78
  118. #define PF15 95 //D79
  119. #define PG0 96 //D64
  120. #define PG1 97 //D65
  121. #define PG2 98 //D66
  122. #define PG3 99 //D67
  123. #define PG4 100 //D68
  124. #define PG5 101 //D69
  125. #define PG6 102 //D70
  126. #define PG7 103 //D71
  127. #define PG8 104 //D72
  128. #define PG9 105 //D73
  129. #define PG10 106 //D74
  130. #define PG11 107 //D75
  131. #define PG12 108 //D76
  132. #define PG13 109 //D77
  133. #define PG14 110 //D78
  134. #define PG15 111 //D79
  135. // This must be a literal with the same value as PEND
  136. #define NUM_DIGITAL_PINS 112
  137. // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
  138. #define NUM_ANALOG_INPUTS 13
  139. #define NUM_ANALOG_FIRST NUM_DIGITAL_PINS
  140. //#define ADC_RESOLUTION 12
  141. // PWM resolution
  142. //#define PWM_RESOLUTION 12
  143. #define PWM_FREQUENCY 1000 // >= 20 Khz => inaudible noise for fans
  144. #define PWM_MAX_DUTY_CYCLE 255
  145. // SPI Definitions
  146. #define PIN_SPI_SS PA4
  147. #define PIN_SPI_MOSI PA7
  148. #define PIN_SPI_MISO PA6
  149. #define PIN_SPI_SCK PA5
  150. // I2C Definitions
  151. #define PIN_WIRE_SDA PB9
  152. #define PIN_WIRE_SCL PB8
  153. // Timer Definitions
  154. // Do not use timer used by PWM pin. See PinMap_PWM.
  155. #define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file
  156. #define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file
  157. #define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file
  158. // UART Definitions
  159. //#define SERIAL_UART_INSTANCE 1 // Connected to EXP3 header
  160. /* Enable Serial 3 */
  161. #define HAVE_HWSERIAL1
  162. #define HAVE_HWSERIAL3
  163. // Default pin used for 'Serial' instance (ex: ST-Link)
  164. // Mandatory for Firmata
  165. #define PIN_SERIAL_RX PA10
  166. #define PIN_SERIAL_TX PA9
  167. /* HAL configuration */
  168. #define HSE_VALUE 12000000U
  169. #define FLASH_PAGE_SIZE (4U * 1024U)
  170. #ifdef __cplusplus
  171. } // extern "C"
  172. #endif
  173. /*----------------------------------------------------------------------------
  174. * Arduino objects - C++ only
  175. *----------------------------------------------------------------------------*/
  176. #ifdef __cplusplus
  177. // These serial port names are intended to allow libraries and architecture-neutral
  178. // sketches to automatically default to the correct port name for a particular type
  179. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  180. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  181. //
  182. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  183. //
  184. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  185. //
  186. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  187. //
  188. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  189. //
  190. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  191. // pins are NOT connected to anything by default.
  192. #define SERIAL_PORT_MONITOR Serial
  193. #define SERIAL_PORT_HARDWARE_OPEN Serial
  194. #endif
  195. #endif /* _VARIANT_ARDUINO_STM32_ */