Skip to content

Commit 5d63173

Browse files
authored
✨ MKS Mini12864 v3 for Robin E3/E3D (#22368)
1 parent 5b43795 commit 5d63173

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@
156156
#define DOGLCD_MOSI PB15
157157

158158
#elif ENABLED(MKS_MINI_12864_V3)
159-
#define ENABLE_SPI3
160159
#define DOGLCD_CS PA4
161160
#define DOGLCD_A0 PA5
162161
#define LCD_PINS_DC DOGLCD_A0
@@ -165,7 +164,9 @@
165164
#define NEOPIXEL_PIN PA7
166165
#define DOGLCD_MOSI PB15
167166
#define DOGLCD_SCK PB13
168-
167+
#define FORCE_SOFT_SPI
168+
#define SOFTWARE_SPI
169+
169170
#else
170171

171172
#define LCD_PINS_D4 PA6

buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,24 @@ extern "C" {
101101
#endif
102102

103103
// Override default Arduino configuration
104+
104105
// 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
109122

110123
// I2C Definitions
111124
#define PIN_WIRE_SDA PB7
@@ -118,6 +131,7 @@ extern "C" {
118131
#ifndef TIMER_SERVO
119132
#define TIMER_SERVO TIM2
120133
#endif
134+
121135
// UART Definitions
122136
// Define here Serial instance number to map on Serial generic name
123137
#define SERIAL_UART_INSTANCE 1
@@ -126,7 +140,7 @@ extern "C" {
126140
#define PIN_SERIAL_RX PA10
127141
#define PIN_SERIAL_TX PA9
128142

129-
/* Extra HAL modules */
143+
// Extra HAL modules
130144
#if defined(STM32F103xE) || defined(STM32F103xG)
131145
#define HAL_DAC_MODULE_ENABLED
132146
#endif

ini/stm32f1.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ lib_deps =
125125
[env:mks_robin_e3]
126126
platform = ${common_stm32.platform}
127127
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
130129
build_unflags = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
131130
monitor_speed = 115200
132131
board_build.offset = 0x5000

0 commit comments

Comments
 (0)