/variants/REMRAM_V1/variant.h

https://github.com/stm32duino/Arduino_Core_STM32 · C Header · 192 lines · 100 code · 29 blank · 63 comment · 0 complexity · 35b7956ad312056c9c1b5d97f211f863 MD5 · raw file

  1. /*
  2. *******************************************************************************
  3. * Copyright (c) 2018, 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. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif // __cplusplus
  36. /*----------------------------------------------------------------------------
  37. * Pins
  38. *----------------------------------------------------------------------------*/
  39. // USART
  40. #define PA10 0 // RX
  41. #define PA9 1 // TX
  42. // SWD
  43. #define PA14 2 // SWCLK
  44. #define PA13 3 // SWDIO
  45. // EXT3
  46. #define PE5 4 // EXT_D1
  47. #define PE4 5 // EXT_D2
  48. #define PE3 6 // EXT_D3
  49. #define PE2 7 // EXT_D4
  50. #define PE1 8 // EXT_D5
  51. // SPI
  52. #define PB2 9 // SS_SDLCD
  53. #define PC4 10 // SS_E
  54. #define PA7 11 // MOSI
  55. #define PA6 12 // MISO
  56. #define PA5 13 // SCK
  57. #define PB1 14 // SS_X
  58. #define PB0 15 // SS_Y
  59. #define PC5 16 // SS_Z
  60. // I2C
  61. #define PB6 17 // SCL
  62. #define PB7 18 // SDA
  63. // USB
  64. #define PA12 19 // DD+
  65. #define PA11 20 // DD//
  66. // LED
  67. #define PD0 21 // STATUS_LED
  68. // PWM
  69. // TIM2
  70. #define PA15 22 // X_STEP
  71. #define PB3 23 // Y_STEP
  72. #define PB10 24 // Z_STEP
  73. #define PB11 25 // E_STEP
  74. // TIM3
  75. #define PB5 26 // PWM_EXT1
  76. #define PB4 27 // PWM_EXT2
  77. #define PC8 28 // PWM_EXT3
  78. #define PC9 29 // PWM_EXT4
  79. // TIM5
  80. #define PA0 30 // PWM_FAN1
  81. #define PA1 31 // PWM_BED
  82. #define PA2 32 // PWM_FAN2
  83. #define PA3 33 // PWM_HEAT
  84. // Stepper
  85. #define PC12 34 // X_EN
  86. #define PC10 35 // X_DIR
  87. #define PC11 36 // X_DIAG
  88. #define PD4 37 // Y_EN
  89. #define PD6 38 // Y_DIR
  90. #define PD5 39 // Y_DIAG
  91. #define PE15 40 // Z_EN
  92. #define PE13 41 // Z_DIR
  93. #define PE14 42 // Z_DIAG
  94. #define PE11 43 // E_EN
  95. #define PE10 44 // E_DIR
  96. #define PE12 45 // E_DIAG
  97. // EXT3
  98. #define PC6 46 // LCD_BEEPER
  99. #define PC7 47 // BTN_ENC
  100. #define PD14 48 // LCD_EN
  101. #define PD15 49 // LCD_RS
  102. #define PD13 50 // LCD_D4
  103. #define PD12 51 // LCD_D5
  104. #define PD11 52 // LCD_D6
  105. #define PD10 53 // LCD_D7
  106. // EXT2
  107. #define PC14 54 // BTN_EN1
  108. #define PC15 55 // BTN_EN2
  109. #define PC13 56 // SD_CARD_DET
  110. // SD Card Reader
  111. #define PE7 57 // SS_SD
  112. // Endstops
  113. #define PB12 58 // X_MIN
  114. #define PB13 59 // X_MAX
  115. #define PB14 60 // Y_MIN
  116. #define PB15 61 // Y_MAX
  117. #define PD8 62 // Z_MIN
  118. #define PD9 63 // Z_MAX
  119. // ADC
  120. #define PC0 64 // THERM_1
  121. #define PC1 65 // THERM_2
  122. #define PC2 66 // THERM_3
  123. #define PA4 67 // FAN_SPEED1
  124. #define PC3 68 // FAN_SPEED2
  125. // PIN definition
  126. #define NUM_DIGITAL_PINS 69
  127. #define NUM_ANALOG_INPUTS 5
  128. #define NUM_ANALOG_FIRST 64
  129. // PWM resolution
  130. #define PWM_FREQUENCY 20000 // >= 20 Khz => inaudible noise for fans
  131. #define PWM_MAX_DUTY_CYCLE 255
  132. // On-board LED pin number
  133. #define LED_YELLOW PD0
  134. #define LED_BUILTIN LED_YELLOW
  135. // Timer Definitions
  136. // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
  137. #define TIMER_TONE TIM6
  138. #define TIMER_SERVO TIM7
  139. // UART Definitions
  140. #define SERIAL_UART_INSTANCE 1
  141. // I2C Definitions
  142. #define PIN_WIRE_SDA PB7
  143. #define PIN_WIRE_SCL PB6
  144. // Default pin used for 'Serial' instance
  145. #define PIN_SERIAL_RX 0
  146. #define PIN_SERIAL_TX 1
  147. /* HAL configuration */
  148. #define HSE_VALUE 24000000U
  149. // Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
  150. // By default 2MB single bank
  151. #define FLASH_BASE_ADDRESS 0x081C0000
  152. #define FLASH_DATA_SECTOR 11
  153. #ifdef __cplusplus
  154. } // extern "C"
  155. #endif
  156. /*----------------------------------------------------------------------------
  157. * Arduino objects - C++ only
  158. *----------------------------------------------------------------------------*/
  159. #ifdef __cplusplus
  160. #define SERIAL_PORT_MONITOR Serial
  161. #define SERIAL_PORT_HARDWARE Serial
  162. #endif
  163. #endif /* _VARIANT_ARDUINO_STM32_ */