variant.h 5.5 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
  24. #define PA1 1
  25. #define PA2 2
  26. #define PA3 3
  27. #define PA4 4
  28. #define PA5 5
  29. #define PA6 6
  30. #define PA7 7
  31. #define PA8 8
  32. #define PA9 9
  33. #define PA10 10
  34. #define PA11 11
  35. #define PA12 12
  36. #define PA13 13
  37. #define PA14 14
  38. #define PA15 15
  39. #define PB0 16
  40. #define PB1 17
  41. #define PB2 18
  42. #define PB3 19
  43. #define PB4 20
  44. #define PB5 21
  45. #define PB6 22
  46. #define PB7 23
  47. #define PB8 24
  48. #define PB9 25
  49. #define PB10 26
  50. #define PB11 27
  51. #define PB12 28
  52. #define PB13 29
  53. #define PB14 30
  54. #define PB15 31
  55. #define PC0 32
  56. #define PC1 33
  57. #define PC2 34
  58. #define PC3 35
  59. #define PC4 36
  60. #define PC5 37
  61. #define PC6 38
  62. #define PC7 39
  63. #define PC8 40
  64. #define PC9 41
  65. #define PC10 42
  66. #define PC11 43
  67. #define PC12 44
  68. #define PC13 45
  69. #define PC14 46
  70. #define PC15 47
  71. #define PD0 48
  72. #define PD1 49
  73. #define PD2 50
  74. #define PD3 51
  75. #define PD4 52
  76. #define PD5 53
  77. #define PD6 54
  78. #define PD7 55
  79. #define PD8 56
  80. #define PD9 57
  81. #define PD10 58
  82. #define PD11 59
  83. #define PD12 60
  84. #define PD13 61
  85. #define PD14 62
  86. #define PD15 63
  87. #define PE0 64
  88. #define PE1 65
  89. #define PE2 66
  90. #define PE3 67
  91. #define PE4 68
  92. #define PE5 69
  93. #define PE6 70
  94. #define PE7 71
  95. #define PE8 72
  96. #define PE9 73
  97. #define PE10 74
  98. #define PE11 75
  99. #define PE12 76
  100. #define PE13 77
  101. #define PE14 78
  102. #define PE15 79
  103. #define PF0 80
  104. #define PF1 81
  105. #define PF2 82
  106. #define PF3 83
  107. #define PF4 84
  108. #define PF5 85
  109. #define PF6 86
  110. #define PF7 87
  111. #define PF8 88
  112. #define PF9 89
  113. #define PF10 90
  114. #define PF11 91
  115. #define PF12 92
  116. #define PF13 93
  117. #define PF14 94
  118. #define PF15 95
  119. #define PG0 96
  120. #define PG1 97
  121. #define PG2 98
  122. #define PG3 99
  123. #define PG4 100
  124. #define PG5 101
  125. #define PG6 102
  126. #define PG7 103
  127. #define PG8 104
  128. #define PG9 105
  129. #define PG10 106
  130. #define PG11 107
  131. #define PG12 108
  132. #define PG13 109
  133. #define PG14 110
  134. #define PG15 111
  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_ */