📺 MKS MINI12864 V3 for Robin E3P, etc. (#22453)
This commit is contained in:
		@@ -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
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
//
 | 
			
		||||
@@ -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.
 | 
			
		||||
@@ -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)
 | 
			
		||||
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -166,6 +166,7 @@
 | 
			
		||||
    #define DOGLCD_SCK                      PB13
 | 
			
		||||
    #define FORCE_SOFT_SPI
 | 
			
		||||
    #define SOFTWARE_SPI
 | 
			
		||||
	//#define LCD_SCREEN_ROT_180
 | 
			
		||||
 | 
			
		||||
  #else
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -345,6 +345,7 @@
 | 
			
		||||
    #if SD_CONNECTION_IS(ONBOARD)
 | 
			
		||||
      #define FORCE_SOFT_SPI
 | 
			
		||||
    #endif
 | 
			
		||||
	//#define LCD_SCREEN_ROT_180
 | 
			
		||||
 | 
			
		||||
  #else                                           // !MKS_MINI_12864
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user