variant.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /*
  2. *******************************************************************************
  3. * Copyright (c) 2017, STMicroelectronics
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice,
  10. * this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  15. * may be used to endorse or promote products derived from this software
  16. * without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  19. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  22. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  24. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  25. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  27. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *******************************************************************************
  29. */
  30. #pragma once
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif // __cplusplus
  34. /*----------------------------------------------------------------------------
  35. * Pins
  36. *----------------------------------------------------------------------------*/
  37. #define PA1 0
  38. #define PA2 1
  39. #define PA3 2
  40. #define PA4 3
  41. #define PA5 4
  42. #define PA6 5
  43. #define PA7 6
  44. #define PA8 7
  45. #define PA9 8
  46. #define PA10 9
  47. #define PA11 10
  48. #define PA12 11
  49. #define PA13 12
  50. #define PA14 13
  51. #define PA15 14
  52. #define PB0 15
  53. #define PB1 16
  54. #define PB2 17
  55. #define PB3 18
  56. #define PB4 19
  57. #define PB5 20
  58. #define PB6 21
  59. #define PB7 22
  60. #define PB8 23
  61. #define PB9 24
  62. #define PB10 25
  63. #define PB11 26
  64. #define PB12 27
  65. #define PB13 28
  66. #define PB14 29
  67. #define PB15 30
  68. #define PC2 31
  69. #define PC3 32
  70. #define PC4 33
  71. #define PC5 34
  72. #define PC6 35
  73. #define PC7 36
  74. #define PC8 37
  75. #define PC9 38
  76. #define PC10 39
  77. #define PC11 40
  78. #define PC12 41
  79. #define PC13 42
  80. #define PC14 43
  81. #define PC15 44
  82. #define PD0 45
  83. #define PD1 46
  84. #define PD2 47
  85. #define PD3 48
  86. #define PD4 49
  87. #define PD5 50
  88. #define PD6 51
  89. #define PD7 52
  90. #define PD8 53
  91. #define PD9 54
  92. #define PD10 55
  93. #define PD11 56
  94. #define PD12 57
  95. #define PD13 58
  96. #define PD14 59
  97. #define PD15 60
  98. #define PE0 61
  99. #define PE1 62
  100. #define PE11 63
  101. #define PE3 64
  102. #define PE4 65
  103. #define PE5 66
  104. #define PE6 67
  105. #define PE7 68
  106. #define PE8 69
  107. #define PE9 70
  108. #define PE10 71
  109. #define PE2 72
  110. #define PE12 73
  111. #define PE13 74
  112. #define PE14 75
  113. #define PE15 76
  114. #define PF0 77
  115. #define PF1 78
  116. #define PF2 79
  117. #define PF6 80
  118. #define PF7 81
  119. #define PF8 82
  120. #define PF9 83
  121. #define PF11 84
  122. #define PF12 85
  123. #define PF13 86
  124. #define PF14 87
  125. #define PF15 88
  126. #define PG0 89
  127. #define PG1 90
  128. #define PG2 91
  129. #define PG3 92
  130. #define PG4 93
  131. #define PG5 94
  132. #define PG6 95
  133. #define PG7 96
  134. #define PG8 97
  135. #define PG9 98
  136. #define PG10 99
  137. #define PG11 100
  138. #define PG12 101
  139. #define PG13 102
  140. #define PG14 103
  141. #define PG15 104
  142. #define PH0 105
  143. #define PH1 106
  144. #define PA0 107
  145. #define PC1 108
  146. #define PC0 109
  147. #define PF10 110
  148. #define PF5 111
  149. #define PF4 112
  150. #define PF3 113
  151. // This must be a literal
  152. #define NUM_DIGITAL_PINS 114
  153. // This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
  154. #define NUM_ANALOG_INPUTS 7
  155. #define NUM_ANALOG_FIRST 107
  156. // Below SPI and I2C definitions already done in the core
  157. // Could be redefined here if differs from the default one
  158. // SPI Definitions
  159. #define PIN_SPI_SS PF11
  160. #define PIN_SPI_MOSI PB15
  161. #define PIN_SPI_MISO PB14
  162. #define PIN_SPI_SCK PB13
  163. //max6675
  164. //#define PIN_SPI_SS PA4
  165. //#define PIN_SPI_SCK PA5
  166. //#define PIN_SPI_MISO PA6
  167. //#define PIN_SPI_MOSI PA7
  168. // I2C Definitions
  169. #define PIN_WIRE_SDA PB7
  170. #define PIN_WIRE_SCL PB6
  171. // Timer Definitions
  172. // Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c
  173. #define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file
  174. // Do not use basic timer: OC is required
  175. #define TIMER_SERVO TIM1 // TODO: advanced-control timers don't work
  176. // UART Definitions
  177. // Define here Serial instance number to map on Serial generic name
  178. #define SERIAL_UART_INSTANCE 1 //ex: 2 for Serial2 (USART2)
  179. // DEBUG_UART could be redefined to print on another instance than 'Serial'
  180. //#define DEBUG_UART ((USART_TypeDef *) U(S)ARTX) // ex: USART3
  181. // DEBUG_UART baudrate, default: 9600 if not defined
  182. //#define DEBUG_UART_BAUDRATE x
  183. // DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART
  184. //#define DEBUG_PINNAME_TX PX_n // PinName used for TX
  185. // Default pin used for 'Serial' instance (ex: ST-Link)
  186. // Mandatory for Firmata
  187. #define PIN_SERIAL_RX PA10
  188. #define PIN_SERIAL_TX PA9
  189. /* Extra HAL modules */
  190. //#define HAL_DAC_MODULE_ENABLED
  191. #define HAL_SD_MODULE_ENABLED
  192. #ifdef __cplusplus
  193. } // extern "C"
  194. #endif
  195. /*----------------------------------------------------------------------------
  196. * Arduino objects - C++ only
  197. *----------------------------------------------------------------------------*/
  198. #ifdef __cplusplus
  199. // These serial port names are intended to allow libraries and architecture-neutral
  200. // sketches to automatically default to the correct port name for a particular type
  201. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  202. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  203. //
  204. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  205. //
  206. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  207. //
  208. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  209. //
  210. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  211. //
  212. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  213. // pins are NOT connected to anything by default.
  214. #define SERIAL_PORT_MONITOR Serial
  215. #define SERIAL_PORT_HARDWARE Serial1
  216. #endif