Browse Source

MKS Robin Pins fixes for STM32 and STM32F1 (#20404)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Victor Oliveira 4 years ago
parent
commit
6e4925e6b6
No account linked to committer's email address

+ 23
- 17
Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h View File

23
 
23
 
24
 /**
24
 /**
25
  * MKS Robin (STM32F130ZET6) board pin assignments
25
  * MKS Robin (STM32F130ZET6) board pin assignments
26
- *
27
  * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware
26
  * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware
28
  */
27
  */
29
 
28
 
121
 #define PS_ON_PIN                           PA3   // PW_OFF
120
 #define PS_ON_PIN                           PA3   // PW_OFF
122
 #define FIL_RUNOUT_PIN                      PF11  // MT_DET
121
 #define FIL_RUNOUT_PIN                      PF11  // MT_DET
123
 
122
 
124
-#ifdef ARDUINO_ARCH_STM32F1
125
-  #define BEEPER_PIN                        PC13
126
-#else
127
-  #define BEEPER_PIN                        -1
128
-#endif
123
+#define BEEPER_PIN                          PC13
129
 #define LED_PIN                             PB2
124
 #define LED_PIN                             PB2
130
 
125
 
131
-#if HAS_FSMC_TFT || HAS_GRAPHICAL_TFT
132
-  #define TFT_CS_PIN                        PG12  // NE4
133
-  #define TFT_RS_PIN                        PF0   // A0
134
-#endif
135
-
136
 #if HAS_FSMC_TFT
126
 #if HAS_FSMC_TFT
137
   /**
127
   /**
138
    * Note: MKS Robin TFT screens use various TFT controllers
128
    * Note: MKS Robin TFT screens use various TFT controllers
140
    * ILI9488 is not supported
130
    * ILI9488 is not supported
141
    * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
131
    * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
142
    *
132
    *
143
-   * If the screen stays white, disable 'LCD_RESET_PIN'
133
+   * If the screen stays white, disable 'TFT_RESET_PIN'
144
    * to let the bootloader init the screen.
134
    * to let the bootloader init the screen.
145
    *
135
    *
146
-   * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
136
+   * Setting an 'TFT_RESET_PIN' may cause a flicker when entering the LCD menu
147
    * because Marlin uses the reset as a failsafe to revive a glitchy LCD.
137
    * because Marlin uses the reset as a failsafe to revive a glitchy LCD.
148
    */
138
    */
149
-  //#define LCD_RESET_PIN                   PF6
150
-  #define LCD_BACKLIGHT_PIN                 PG11
139
+  #define TFT_CS_PIN                        PG12  // NE4
140
+  #define TFT_RS_PIN                        PF0   // A0
141
+
151
   #define FSMC_CS_PIN                 TFT_CS_PIN
142
   #define FSMC_CS_PIN                 TFT_CS_PIN
152
   #define FSMC_RS_PIN                 TFT_RS_PIN
143
   #define FSMC_RS_PIN                 TFT_RS_PIN
153
 
144
 
154
   #define LCD_USE_DMA_FSMC                        // Use DMA transfers to send data to the TFT
145
   #define LCD_USE_DMA_FSMC                        // Use DMA transfers to send data to the TFT
155
   #define FSMC_DMA_DEV                      DMA2
146
   #define FSMC_DMA_DEV                      DMA2
156
   #define FSMC_DMA_CHANNEL               DMA_CH5
147
   #define FSMC_DMA_CHANNEL               DMA_CH5
157
-#elif HAS_GRAPHICAL_TFT
148
+
158
   #define TFT_RESET_PIN                     PF6
149
   #define TFT_RESET_PIN                     PF6
159
   #define TFT_BACKLIGHT_PIN                 PG11
150
   #define TFT_BACKLIGHT_PIN                 PG11
151
+
152
+  #define TOUCH_BUTTONS_HW_SPI
153
+  #define TOUCH_BUTTONS_HW_SPI_DEVICE          2
160
 #endif
154
 #endif
161
 
155
 
162
 #if NEED_TOUCH_PINS
156
 #if NEED_TOUCH_PINS
170
 // SPI1(PA7) & SPI3(PB5) not available
164
 // SPI1(PA7) & SPI3(PB5) not available
171
 #define SPI_DEVICE                             2
165
 #define SPI_DEVICE                             2
172
 
166
 
167
+#define SDIO_SUPPORT
173
 #if ENABLED(SDIO_SUPPORT)
168
 #if ENABLED(SDIO_SUPPORT)
174
   #define SCK_PIN                           PB13  // SPI2
169
   #define SCK_PIN                           PB13  // SPI2
175
   #define MISO_PIN                          PB14  // SPI2
170
   #define MISO_PIN                          PB14  // SPI2
176
   #define MOSI_PIN                          PB15  // SPI2
171
   #define MOSI_PIN                          PB15  // SPI2
177
-  #define SD_DETECT_PIN                     PF12  // SD_CD
172
+  /**
173
+   * MKS Robin has a few hardware revisions
174
+   * https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware
175
+   *
176
+   * MKS Robin less or equal to V2.3 don't have SD_DETECT_PIN.
177
+   *
178
+   * MKS Robin greater or equal to V2.4 have SD_DETECT_PIN at PF12.
179
+   *
180
+   * You can uncomment it here, or you can add it SD_DETECT_PIN to your Configuration.h
181
+   */
182
+  //#define SD_DETECT_PIN                   -1
183
+  //#define SD_DETECT_PIN                   PF12  // SD_CD
178
 #else
184
 #else
179
   // SD as custom software SPI (SDIO pins)
185
   // SD as custom software SPI (SDIO pins)
180
   #define SCK_PIN                           PC12
186
   #define SCK_PIN                           PC12

+ 2
- 5
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h View File

23
 
23
 
24
 /**
24
 /**
25
  * MKS Robin nano (STM32F130VET6) board pin assignments
25
  * MKS Robin nano (STM32F130VET6) board pin assignments
26
+ * https://github.com/makerbase-mks/MKS-Robin-Nano-V1.X/tree/master/hardware
26
  */
27
  */
27
 
28
 
28
 #if NOT_TARGET(STM32F1, STM32F1xx)
29
 #if NOT_TARGET(STM32F1, STM32F1xx)
167
 
168
 
168
 /**
169
 /**
169
  * Note: MKS Robin TFT screens use various TFT controllers.
170
  * Note: MKS Robin TFT screens use various TFT controllers.
170
- * If the screen stays white, disable 'LCD_RESET_PIN'
171
+ * If the screen stays white, disable 'TFT_RESET_PIN'
171
  * to let the bootloader init the screen.
172
  * to let the bootloader init the screen.
172
  */
173
  */
173
-
174
 // Shared FSMC Configs
174
 // Shared FSMC Configs
175
 #if HAS_FSMC_TFT
175
 #if HAS_FSMC_TFT
176
   #define DOGLCD_MOSI                       -1    // Prevent auto-define by Conditionals_post.h
176
   #define DOGLCD_MOSI                       -1    // Prevent auto-define by Conditionals_post.h
177
   #define DOGLCD_SCK                        -1
177
   #define DOGLCD_SCK                        -1
178
 
178
 
179
-  #define FSMC_CS_PIN                       PD7   // NE4
180
-  #define FSMC_RS_PIN                       PD11  // A0
181
-
182
   #define TOUCH_CS_PIN                      PA7   // SPI2_NSS
179
   #define TOUCH_CS_PIN                      PA7   // SPI2_NSS
183
   #define TOUCH_SCK_PIN                     PB13  // SPI2_SCK
180
   #define TOUCH_SCK_PIN                     PB13  // SPI2_SCK
184
   #define TOUCH_MISO_PIN                    PB14  // SPI2_MISO
181
   #define TOUCH_MISO_PIN                    PB14  // SPI2_MISO

Loading…
Cancel
Save