My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

variant.h 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. #ifndef _VARIANT_ARDUINO_STM32_
  31. #define _VARIANT_ARDUINO_STM32_
  32. /*----------------------------------------------------------------------------
  33. * Headers
  34. *----------------------------------------------------------------------------*/
  35. #include "PeripheralPins.h"
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif // __cplusplus
  39. /*----------------------------------------------------------------------------
  40. * Pins
  41. *----------------------------------------------------------------------------*/
  42. extern const PinName digitalPin[];
  43. // Right Side
  44. #define PE1 0
  45. #define PE0 1
  46. #define PB9 2
  47. #define PB8 3
  48. #define PB7 4
  49. #define PB6 5
  50. #define PB5 6
  51. #define PB3 7
  52. #define PD7 8
  53. #define PD6 9
  54. #define PD5 10
  55. #define PD4 11
  56. #define PD3 12
  57. #define PD2 13
  58. #define PD1 14
  59. #define PD0 15
  60. #define PC12 16
  61. #define PC11 17
  62. #define PC10 18
  63. #define PA15 19
  64. #define PA12 20 // USB_DP
  65. #define PA11 21 // USB_DM
  66. #define PA10 22
  67. #define PA9 23
  68. #define PA8 24
  69. #define PC9 25
  70. #define PC8 26
  71. #define PC7 27
  72. #define PC6 28
  73. #define PD15 29
  74. #define PD14 30
  75. #define PD13 31
  76. #define PD12 32
  77. #define PD11 33
  78. #define PD10 34
  79. #define PD9 35
  80. #define PD8 36
  81. #define PB15 37
  82. // Left Side
  83. #define PE2 38
  84. #define PE3 39
  85. #define PE4 40 // BUT K0
  86. #define PE5 41 // BUT K1
  87. #define PE6 42
  88. #define PC13 43
  89. #define PC0 44 // A0
  90. #define PC1 45 // A1
  91. #define PC2 46 // A2
  92. #define PC3 47 // A3
  93. #define PA0 48 // A4/WK_UP: BUT K_UP
  94. #define PA1 49 // A5
  95. #define PA2 50 // A6
  96. #define PA3 51 // A7
  97. #define PA4 52 // A8
  98. #define PA5 53 // A9
  99. #define PC4 54 // A10
  100. #define PC5 55 // A11
  101. #define PB0 56 // A12
  102. #define PB1 57 // A13
  103. #define PA6 58 // LED D2
  104. #define PA7 59 // LED D3 (active LOW)
  105. #define PE7 60
  106. #define PE8 61
  107. #define PE9 62
  108. #define PE10 63
  109. #define PE11 64
  110. #define PE12 65
  111. #define PE13 66
  112. #define PE14 67
  113. #define PE15 68
  114. #define PB10 69
  115. #define PB11 70
  116. #define PB12 71
  117. #define PB13 72
  118. #define PB14 73
  119. #define PB4 74
  120. // This must be a literal
  121. #define NUM_DIGITAL_PINS 75
  122. // This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
  123. #define NUM_ANALOG_INPUTS 14
  124. #define NUM_ANALOG_FIRST 44
  125. // Below ADC, DAC and PWM definitions already done in the core
  126. // Could be redefined here if needed
  127. // ADC resolution is 12bits
  128. //#define ADC_RESOLUTION 12
  129. //#define DACC_RESOLUTION 12
  130. // PWM resolution
  131. #define PWM_RESOLUTION 8
  132. #define PWM_FREQUENCY 20000
  133. #define PWM_MAX_DUTY_CYCLE 255
  134. // On-board LED pin number
  135. #define LED_D2 PA6
  136. #define LED_D3 PA7
  137. // Board specific button
  138. #define BTN_K_UP PA0
  139. #define LED_BUILTIN LED_D2
  140. #define LED_GREEN LED_D2
  141. // On-board user button
  142. #define BTN_K0 PE4
  143. #define BTN_K1 PE3
  144. #define USER_BTN BTN_K0
  145. // Below SPI and I2C definitions already done in the core
  146. // Could be redefined here if differs from the default one
  147. // SPI Definitions
  148. #define PIN_SPI_MOSI PB15
  149. #define PIN_SPI_MISO PB14
  150. #define PIN_SPI_SCK PB13
  151. #define PIN_SPI_SS PB12
  152. //#define PIN_SPI_SS1 PB0 // W25Q16 (on board flash)
  153. // I2C Definitions
  154. #define PIN_WIRE_SDA PB7
  155. #define PIN_WIRE_SCL PB6
  156. // Timer Definitions
  157. //Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c
  158. #define TIMER_TONE TIM6
  159. // Do not use basic timer: OC is required
  160. #define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work
  161. // UART Definitions
  162. // Define here Serial instance number to map on Serial generic name
  163. #define SERIAL_UART_INSTANCE 1 //ex: 2 for Serial2 (USART2)
  164. // DEBUG_UART could be redefined to print on another instance than 'Serial'
  165. //#define DEBUG_UART ((USART_TypeDef *) U(S)ARTX) // ex: USART3
  166. // DEBUG_UART baudrate, default: 9600 if not defined
  167. //#define DEBUG_UART_BAUDRATE x
  168. // DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART
  169. //#define DEBUG_PINNAME_TX PX_n // PinName used for TX
  170. // Default pin used for 'Serial' instance (ex: ST-Link)
  171. // Mandatory for Firmata
  172. #define PIN_SERIAL_RX PA10
  173. #define PIN_SERIAL_TX PA9
  174. #ifdef __cplusplus
  175. } // extern "C"
  176. #endif
  177. /*----------------------------------------------------------------------------
  178. * Arduino objects - C++ only
  179. *----------------------------------------------------------------------------*/
  180. #ifdef __cplusplus
  181. // These serial port names are intended to allow libraries and architecture-neutral
  182. // sketches to automatically default to the correct port name for a particular type
  183. // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  184. // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  185. //
  186. // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
  187. //
  188. // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
  189. //
  190. // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
  191. //
  192. // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
  193. //
  194. // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
  195. // pins are NOT connected to anything by default.
  196. #define SERIAL_PORT_MONITOR Serial
  197. #define SERIAL_PORT_HARDWARE Serial1
  198. #endif
  199. #endif /* _VARIANT_ARDUINO_STM32_ */