Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MKS MINI12864 V3 for Robin E3P, etc. #22453

Merged
merged 8 commits into from
Jul 29, 2021
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#define BOARD_NO_NATIVE_USB

// Avoid conflict with TIMER_SERVO when using the STM32 HAL
#define TEMP_TIMER 5
#define TEMP_TIMER 5

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
Expand All @@ -65,7 +65,7 @@
#define SD_SCK_PIN PB13 // SPI2
#define SD_MISO_PIN PB14 // SPI2
#define SD_MOSI_PIN PB15 // SPI2
#define SPI_DEVICE 2
#define SPI_DEVICE 2

// SPI Flash
#define HAS_SPI_FLASH 1
Expand Down
78 changes: 55 additions & 23 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
#define BOARD_NO_NATIVE_USB
#define MKS_HARDWARE_TEST_ONLY_E0

// Avoid conflict with TIMER_SERVO when using the STM32 HAL
#define TEMP_TIMER 5

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
//
Expand Down Expand Up @@ -214,17 +217,23 @@
#define SDCARD_CONNECTION ONBOARD
#endif

#define SDIO_SUPPORT
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SD_CS_PIN PC11
#if SD_CONNECTION_IS(ONBOARD)
#define SDIO_SUPPORT
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SD_CS_PIN PC11
#elif SD_CONNECTION_IS(LCD)
#define ENABLE_SPI1
#define SDSS PE10
#define SD_SCK_PIN PA5
#define SD_MISO_PIN PA6
#define SD_MOSI_PIN PA7
#define SD_DETECT_PIN PE12
#endif

//
// LCD / Controller
//
#ifndef BEEPER_PIN
#define BEEPER_PIN PC5
#endif

/**
* Note: MKS Robin TFT screens use various TFT controllers.
Expand Down Expand Up @@ -261,33 +270,29 @@
#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1

#ifndef TFT_WIDTH
#define TFT_WIDTH 480
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif

#define LCD_READ_ID 0xD3
#define LCD_USE_DMA_SPI

#endif

#if HAS_SPI_GRAPHICAL_TFT
#if ENABLED(TFT_CLASSIC_UI)
// Emulated DOGM SPI
#define LCD_PINS_ENABLE PD13
#define LCD_PINS_RS PC6
#define BTN_ENC PE13
#define BTN_EN1 PE8
#define BTN_EN2 PE11
#elif ENABLED(TFT_480x320_SPI)
#define TFT_DRIVER ST7796
#elif ENABLED(TFT_COLOR_UI)
#define TFT_BUFFER_SIZE 14400
#endif

#if HAS_WIRED_LCD && !HAS_SPI_TFT

// NON TFT Displays
#define BEEPER_PIN PC5
#define BTN_ENC PE13
#define LCD_PINS_ENABLE PD13
#define LCD_PINS_RS PC6
#define BTN_EN1 PE8
#define BTN_EN2 PE11
#define LCD_BACKLIGHT_PIN -1

#if ENABLED(MKS_MINI_12864)

Expand All @@ -301,9 +306,32 @@
#define DOGLCD_SCK PA5
#define DOGLCD_MOSI PA7

// Required for MKS_MINI_12864 with this board
#define MKS_LCD12864B
#undef SHOW_BOOTSCREEN
#elif IS_TFTGLCD_PANEL

#if ENABLED(TFTGLCD_PANEL_SPI)
#define PIN_SPI_SCK PA5
#define PIN_TFT_MISO PA6
#define PIN_TFT_MOSI PA7
#define TFTGLCD_CS PE8
#endif

#ifndef BEEPER_PIN
#define BEEPER_PIN -1
#endif

#elif ENABLED(MKS_MINI_12864_V3)
#define DOGLCD_CS PD13
#define DOGLCD_A0 PC6
#define LCD_PINS_DC DOGLCD_A0
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN PE14
#define NEOPIXEL_PIN PE15
#define DOGLCD_MOSI PA7
#define DOGLCD_SCK PA5
#if SD_CONNECTION_IS(ONBOARD)
#define FORCE_SOFT_SPI
#endif
//#define LCD_SCREEN_ROT_180

#else // !MKS_MINI_12864

Expand Down Expand Up @@ -342,6 +370,10 @@
#define W25QXX_SCK_PIN PB13
#endif

#ifndef BEEPER_PIN
#define BEEPER_PIN PC5
#endif

#if ENABLED(SPEAKER) && BEEPER_PIN == PC5
#error "MKS Robin nano default BEEPER_PIN is not a SPEAKER."
#endif
1 change: 1 addition & 0 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
#define DOGLCD_SCK PB13
#define FORCE_SOFT_SPI
#define SOFTWARE_SPI
//#define LCD_SCREEN_ROT_180

#else

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define BOARD_NO_NATIVE_USB

// Avoid conflict with TIMER_SERVO when using the STM32 HAL
#define TEMP_TIMER 5
#define TEMP_TIMER 5

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define BOARD_NO_NATIVE_USB

// Avoid conflict with TIMER_SERVO when using the STM32 HAL
#define TEMP_TIMER 5
#define TEMP_TIMER 5

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
Expand Down Expand Up @@ -345,6 +345,7 @@
#if SD_CONNECTION_IS(ONBOARD)
#define FORCE_SOFT_SPI
#endif
//#define LCD_SCREEN_ROT_180

#else // !MKS_MINI_12864

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME

// Avoid conflict with fans and TIMER_TONE
#define TEMP_TIMER 3
#define STEP_TIMER 5
#define TEMP_TIMER 3
#define STEP_TIMER 5

//
// EEPROM Emulation
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@
#if SD_CONNECTION_IS(ONBOARD)
#define FORCE_SOFT_SPI
#endif
//#define LCD_SCREEN_ROT_180

#else // !MKS_MINI_12864

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/stm32f4/pins_RUMBA32_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
// This will be difficult to solve from the Arduino IDE, without modifying the RUMBA32 variant
// included with the STM32 framework.

#define STEP_TIMER 10
#define TEMP_TIMER 14
#define STEP_TIMER 10
#define TEMP_TIMER 14

//
// Limit Switches
Expand Down