Skip to content

Commit

Permalink
MKS Robin Pins fixes for STM32 and STM32F1 (MarlinFirmware#20404)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
2 people authored and tharts committed Jan 6, 2021
1 parent 8a76a91 commit f3bc09e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
40 changes: 23 additions & 17 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

/**
* MKS Robin (STM32F130ZET6) board pin assignments
*
* https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware
*/

Expand Down Expand Up @@ -121,42 +120,37 @@
#define PS_ON_PIN PA3 // PW_OFF
#define FIL_RUNOUT_PIN PF11 // MT_DET

#ifdef ARDUINO_ARCH_STM32F1
#define BEEPER_PIN PC13
#else
#define BEEPER_PIN -1
#endif
#define BEEPER_PIN PC13
#define LED_PIN PB2

#if HAS_FSMC_TFT || HAS_GRAPHICAL_TFT
#define TFT_CS_PIN PG12 // NE4
#define TFT_RS_PIN PF0 // A0
#endif

#if HAS_FSMC_TFT
/**
* Note: MKS Robin TFT screens use various TFT controllers
* Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240)
* ILI9488 is not supported
* Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
*
* If the screen stays white, disable 'LCD_RESET_PIN'
* If the screen stays white, disable 'TFT_RESET_PIN'
* to let the bootloader init the screen.
*
* Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
* Setting an 'TFT_RESET_PIN' may cause a flicker when entering the LCD menu
* because Marlin uses the reset as a failsafe to revive a glitchy LCD.
*/
//#define LCD_RESET_PIN PF6
#define LCD_BACKLIGHT_PIN PG11
#define TFT_CS_PIN PG12 // NE4
#define TFT_RS_PIN PF0 // A0

#define FSMC_CS_PIN TFT_CS_PIN
#define FSMC_RS_PIN TFT_RS_PIN

#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
#define FSMC_DMA_DEV DMA2
#define FSMC_DMA_CHANNEL DMA_CH5
#elif HAS_GRAPHICAL_TFT

#define TFT_RESET_PIN PF6
#define TFT_BACKLIGHT_PIN PG11

#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2
#endif

#if NEED_TOUCH_PINS
Expand All @@ -170,11 +164,23 @@
// SPI1(PA7) & SPI3(PB5) not available
#define SPI_DEVICE 2

#define SDIO_SUPPORT
#if ENABLED(SDIO_SUPPORT)
#define SCK_PIN PB13 // SPI2
#define MISO_PIN PB14 // SPI2
#define MOSI_PIN PB15 // SPI2
#define SD_DETECT_PIN PF12 // SD_CD
/**
* MKS Robin has a few hardware revisions
* https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware
*
* MKS Robin less or equal to V2.3 don't have SD_DETECT_PIN.
*
* MKS Robin greater or equal to V2.4 have SD_DETECT_PIN at PF12.
*
* You can uncomment it here, or you can add it SD_DETECT_PIN to your Configuration.h
*/
//#define SD_DETECT_PIN -1
//#define SD_DETECT_PIN PF12 // SD_CD
#else
// SD as custom software SPI (SDIO pins)
#define SCK_PIN PC12
Expand Down
7 changes: 2 additions & 5 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/**
* MKS Robin nano (STM32F130VET6) board pin assignments
* https://github.com/makerbase-mks/MKS-Robin-Nano-V1.X/tree/master/hardware
*/

#if NOT_TARGET(STM32F1, STM32F1xx)
Expand Down Expand Up @@ -167,18 +168,14 @@

/**
* Note: MKS Robin TFT screens use various TFT controllers.
* If the screen stays white, disable 'LCD_RESET_PIN'
* If the screen stays white, disable 'TFT_RESET_PIN'
* to let the bootloader init the screen.
*/

// Shared FSMC Configs
#if HAS_FSMC_TFT
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
#define DOGLCD_SCK -1

#define FSMC_CS_PIN PD7 // NE4
#define FSMC_RS_PIN PD11 // A0

#define TOUCH_CS_PIN PA7 // SPI2_NSS
#define TOUCH_SCK_PIN PB13 // SPI2_SCK
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
Expand Down

0 comments on commit f3bc09e

Please sign in to comment.