My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

variant.h 7.0KB

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