Browse Source

✨ MKS Mini12864 v3 for Robin E3/E3D (#22368)

mks-viva 4 years ago
parent
commit
5d63173297
No account linked to committer's email address

+ 3
- 2
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h View File

@@ -156,7 +156,6 @@
156 156
     #define DOGLCD_MOSI                     PB15
157 157
 
158 158
   #elif ENABLED(MKS_MINI_12864_V3)
159
-    #define ENABLE_SPI3
160 159
     #define DOGLCD_CS                       PA4
161 160
     #define DOGLCD_A0                       PA5
162 161
     #define LCD_PINS_DC                     DOGLCD_A0
@@ -165,7 +164,9 @@
165 164
     #define NEOPIXEL_PIN                    PA7
166 165
     #define DOGLCD_MOSI                     PB15
167 166
     #define DOGLCD_SCK                      PB13
168
-
167
+    #define FORCE_SOFT_SPI
168
+    #define SOFTWARE_SPI
169
+    
169 170
   #else
170 171
 
171 172
     #define LCD_PINS_D4                     PA6

+ 19
- 5
buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h View File

@@ -101,11 +101,24 @@ extern "C" {
101 101
 #endif
102 102
 
103 103
 // Override default Arduino configuration
104
+
104 105
 // SPI Definitions
105
-#define PIN_SPI_SS              PA4
106
-#define PIN_SPI_MOSI            PA7
107
-#define PIN_SPI_MISO            PA6
108
-#define PIN_SPI_SCK             PA5
106
+#if DEFAULT_SPI == 3
107
+  #define PIN_SPI_SS            PA15
108
+  #define PIN_SPI_MOSI          PB3
109
+  #define PIN_SPI_MISO          PB4
110
+  #define PIN_SPI_SCK           PB5
111
+#elif DEFAULT_SPI == 2
112
+  #define PIN_SPI_SS            PB12
113
+  #define PIN_SPI_MOSI          PB13
114
+  #define PIN_SPI_MISO          PB14
115
+  #define PIN_SPI_SCK           PB15
116
+#else
117
+  #define PIN_SPI_SS            PA4
118
+  #define PIN_SPI_MOSI          PA7
119
+  #define PIN_SPI_MISO          PA6
120
+  #define PIN_SPI_SCK           PA5
121
+#endif
109 122
 
110 123
 // I2C Definitions
111 124
 #define PIN_WIRE_SDA            PB7
@@ -118,6 +131,7 @@ extern "C" {
118 131
 #ifndef TIMER_SERVO
119 132
   #define TIMER_SERVO           TIM2
120 133
 #endif
134
+
121 135
 // UART Definitions
122 136
 // Define here Serial instance number to map on Serial generic name
123 137
 #define SERIAL_UART_INSTANCE    1
@@ -126,7 +140,7 @@ extern "C" {
126 140
 #define PIN_SERIAL_RX           PA10
127 141
 #define PIN_SERIAL_TX           PA9
128 142
 
129
-/* Extra HAL modules */
143
+// Extra HAL modules
130 144
 #if defined(STM32F103xE) || defined(STM32F103xG)
131 145
 #define HAL_DAC_MODULE_ENABLED
132 146
 #endif

+ 1
- 2
ini/stm32f1.ini View File

@@ -125,8 +125,7 @@ lib_deps             =
125 125
 [env:mks_robin_e3]
126 126
 platform                    = ${common_stm32.platform}
127 127
 extends                     = common_STM32F103RC
128
-build_flags                 = ${common_stm32.build_flags}
129
-  -DDEBUG_LEVEL=0 -DTIMER_SERVO=TIM5
128
+build_flags                 = ${common_stm32.build_flags} -DDEBUG_LEVEL=0 -DTIMER_SERVO=TIM5 -DDEFAULT_SPI=3
130 129
 build_unflags               = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
131 130
 monitor_speed               = 115200
132 131
 board_build.offset          = 0x5000

Loading…
Cancel
Save