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

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

101
 #endif
101
 #endif
102
 
102
 
103
 // Override default Arduino configuration
103
 // Override default Arduino configuration
104
+
104
 // SPI Definitions
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
 // I2C Definitions
123
 // I2C Definitions
111
 #define PIN_WIRE_SDA            PB7
124
 #define PIN_WIRE_SDA            PB7
118
 #ifndef TIMER_SERVO
131
 #ifndef TIMER_SERVO
119
   #define TIMER_SERVO           TIM2
132
   #define TIMER_SERVO           TIM2
120
 #endif
133
 #endif
134
+
121
 // UART Definitions
135
 // UART Definitions
122
 // Define here Serial instance number to map on Serial generic name
136
 // Define here Serial instance number to map on Serial generic name
123
 #define SERIAL_UART_INSTANCE    1
137
 #define SERIAL_UART_INSTANCE    1
126
 #define PIN_SERIAL_RX           PA10
140
 #define PIN_SERIAL_RX           PA10
127
 #define PIN_SERIAL_TX           PA9
141
 #define PIN_SERIAL_TX           PA9
128
 
142
 
129
-/* Extra HAL modules */
143
+// Extra HAL modules
130
 #if defined(STM32F103xE) || defined(STM32F103xG)
144
 #if defined(STM32F103xE) || defined(STM32F103xG)
131
 #define HAL_DAC_MODULE_ENABLED
145
 #define HAL_DAC_MODULE_ENABLED
132
 #endif
146
 #endif

+ 1
- 2
ini/stm32f1.ini View File

125
 [env:mks_robin_e3]
125
 [env:mks_robin_e3]
126
 platform                    = ${common_stm32.platform}
126
 platform                    = ${common_stm32.platform}
127
 extends                     = common_STM32F103RC
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
 build_unflags               = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
129
 build_unflags               = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
131
 monitor_speed               = 115200
130
 monitor_speed               = 115200
132
 board_build.offset          = 0x5000
131
 board_build.offset          = 0x5000

Loading…
Cancel
Save