variant.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. // This must be a literal with the same value as PEND
  104. #define NUM_DIGITAL_PINS 87
  105. // This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
  106. #define NUM_ANALOG_INPUTS 7
  107. #define NUM_ANALOG_FIRST 80
  108. //#define ADC_RESOLUTION 12
  109. // PWM resolution
  110. //#define PWM_RESOLUTION 12
  111. #define PWM_FREQUENCY 20000 // >= 20 Khz => inaudible noise for fans
  112. #define PWM_MAX_DUTY_CYCLE 255
  113. // SPI Definitions
  114. #define PIN_SPI_SS PA4
  115. #define PIN_SPI_MOSI PA7
  116. #define PIN_SPI_MISO PA6
  117. #define PIN_SPI_SCK PA5
  118. // I2C Definitions
  119. #define PIN_WIRE_SDA PB9
  120. #define PIN_WIRE_SCL PB8
  121. // Timer Definitions
  122. // Do not use timer used by PWM pin. See PinMap_PWM.
  123. #define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file
  124. #define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file
  125. #define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file
  126. // UART Definitions
  127. //#define SERIAL_UART_INSTANCE 1 // Connected to EXP3 header
  128. /* Enable Serial 3 */
  129. #define HAVE_HWSERIAL1
  130. #define HAVE_HWSERIAL3
  131. // Default pin used for 'Serial' instance (ex: ST-Link)
  132. // Mandatory for Firmata
  133. #define PIN_SERIAL_RX PA10
  134. #define PIN_SERIAL_TX PA9
  135. /* HAL configuration */
  136. #define HSE_VALUE 12000000U
  137. #define FLASH_PAGE_SIZE (4U * 1024U)
  138. #ifdef __cplusplus
  139. } // extern "C"
  140. #endif
  141. /*----------------------------------------------------------------------------
  142. * Arduino objects - C++ only
  143. *----------------------------------------------------------------------------*/
  144. #ifdef __cplusplus
  145. // These serial port names are intended to allow libraries and architecture-neutral
  146. // sketches to automatically default to the correct port name for a particular type
  147. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  148. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  149. //
  150. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  151. //
  152. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  153. //
  154. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  155. //
  156. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  157. //
  158. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  159. // pins are NOT connected to anything by default.
  160. #define SERIAL_PORT_MONITOR Serial
  161. #define SERIAL_PORT_HARDWARE_OPEN Serial
  162. #endif
  163. #endif /* _VARIANT_ARDUINO_STM32_ */