Przeglądaj źródła

Fix SDCARD_CONNECTION default for BTT SKR (#21755)

ellensp 4 lat temu
rodzic
commit
8c912d7ece
No account linked to committer's email address

+ 50
- 32
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h Wyświetl plik

@@ -52,6 +52,37 @@
52 52
 #define E0_DIR_PIN                         P2_13
53 53
 #define E0_ENABLE_PIN                      P2_12
54 54
 
55
+
56
+/**
57
+ *               _____                                   _____
58
+ *           NC | 1 2 | GND                          5V | 1 2 | GND
59
+ *        RESET | 3 4 | 1.31                         NC | 3 4 | NC
60
+ *         0.18 | 5 6   3.25                         NC | 5 6   0.15
61
+ *         1.23 | 7 8 | 3.26                       0.16 | 7 8 | 0.18
62
+ *         0.15 | 9 10| 0.17                       2.11 | 9 10| 1.30
63
+ *               -----                                   -----
64
+ *               EXP2                                    EXP1
65
+ */
66
+
67
+#define EXP1_03_PIN                        -1
68
+#define EXP1_04_PIN                        -1
69
+#define EXP1_05_PIN                        -1
70
+#define EXP1_06_PIN                        P0_15
71
+#define EXP1_07_PIN                        P0_16
72
+#define EXP1_08_PIN                        P0_18
73
+#define EXP1_09_PIN                        P2_11
74
+#define EXP1_10_PIN                        P1_30
75
+
76
+#define EXP2_03_PIN                        -1
77
+#define EXP2_04_PIN                        P1_31
78
+#define EXP2_05_PIN                        P0_18
79
+#define EXP2_06_PIN                        P3_25
80
+#define EXP2_07_PIN                        P1_23
81
+#define EXP2_08_PIN                        P3_26
82
+#define EXP2_09_PIN                        P0_15
83
+#define EXP2_10_PIN                        P0_17
84
+
85
+
55 86
 /**
56 87
  * LCD / Controller
57 88
  *
@@ -68,26 +99,23 @@
68 99
 #if IS_TFTGLCD_PANEL
69 100
 
70 101
   #if ENABLED(TFTGLCD_PANEL_SPI)
71
-    #define TFTGLCD_CS                     P3_26
102
+    #define TFTGLCD_CS               EXP2_08_PIN
72 103
   #endif
73 104
 
74
-  #define SD_DETECT_PIN                    P1_31
75
-
76 105
 #elif HAS_WIRED_LCD
77 106
 
78
-  #define BTN_EN1                          P3_26
79
-  #define BTN_EN2                          P3_25
80
-  #define BTN_ENC                          P2_11
107
+  #define BTN_EN1                    EXP2_08_PIN
108
+  #define BTN_EN2                    EXP2_06_PIN
109
+  #define BTN_ENC                    EXP1_09_PIN
81 110
 
82
-  #define SD_DETECT_PIN                    P1_31
83
-  #define LCD_SDSS                         P1_23
84
-  #define LCD_PINS_RS                      P0_16
85
-  #define LCD_PINS_ENABLE                  P0_18
86
-  #define LCD_PINS_D4                      P0_15
111
+  #define LCD_SDSS                   EXP2_07_PIN
112
+  #define LCD_PINS_RS                EXP1_07_PIN
113
+  #define LCD_PINS_ENABLE            EXP2_05_PIN
114
+  #define LCD_PINS_D4                EXP2_09_PIN
87 115
 
88 116
   #if ENABLED(MKS_MINI_12864)
89 117
     #define DOGLCD_CS                      P2_06
90
-    #define DOGLCD_A0                      P0_16
118
+    #define DOGLCD_A0                EXP1_07_PIN
91 119
   #endif
92 120
 
93 121
 #endif // HAS_WIRED_LCD
@@ -106,10 +134,6 @@
106 134
   #endif
107 135
 #endif
108 136
 
109
-#if SD_CONNECTION_IS(LCD)
110
-  #define SD_SS_PIN                        P1_23
111
-#endif
112
-
113 137
 // Trinamic driver support
114 138
 
115 139
 #if HAS_TRINAMIC_CONFIG
@@ -140,10 +164,10 @@
140 164
   // When using any TMC SPI-based drivers, software SPI is used
141 165
   // because pins may be shared with the display or SD card.
142 166
   #define TMC_USE_SW_SPI
143
-  #define TMC_SW_MOSI                      P0_18
144
-  #define TMC_SW_MISO                      P0_17
167
+  #define TMC_SW_MOSI                EXP2_05_PIN
168
+  #define TMC_SW_MISO                EXP2_10_PIN
145 169
   // To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.)
146
-  #define TMC_SW_SCK                       P0_15
170
+  #define TMC_SW_SCK                 EXP2_09_PIN
147 171
   // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise.
148 172
   //#define TMC_SW_SCK                     P2_06
149 173
 
@@ -186,14 +210,11 @@
186 210
     //            SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2.
187 211
     //#define SKR_USE_LCD_PINS_FOR_CS
188 212
     #if ENABLED(SKR_USE_LCD_PINS_FOR_CS)
189
-      #if SD_CONNECTION_IS(LCD)
190
-        #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_PINS_FOR_CS."
191
-      #endif
192
-      #define X_CS_PIN                     P1_23
193
-      #define Y_CS_PIN                     P3_26
194
-      #define Z_CS_PIN                     P2_11
195
-      #define E0_CS_PIN                    P3_25
196
-      #define E1_CS_PIN                    P1_31
213
+      #define X_CS_PIN               EXP2_07_PIN
214
+      #define Y_CS_PIN               EXP2_08_PIN
215
+      #define Z_CS_PIN               EXP1_09_PIN
216
+      #define E0_CS_PIN              EXP2_06_PIN
217
+      #define E1_CS_PIN              EXP2_04_PIN
197 218
     #endif
198 219
 
199 220
     // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
@@ -201,19 +222,16 @@
201 222
     //            the pins will be in use. So SDCARD_CONNECTION must not be 'LCD'.
202 223
     //#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS
203 224
     #if ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
204
-      #if SD_CONNECTION_IS(LCD)
205
-        #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_SD_CARD_PINS_FOR_CS."
206
-      #endif
207 225
       #define X_CS_PIN                     P0_02
208 226
       #define Y_CS_PIN                     P0_03
209 227
       #define Z_CS_PIN                     P2_06
210 228
       // We use SD_DETECT_PIN for E0
211 229
       #undef SD_DETECT_PIN
212
-      #define E0_CS_PIN                    P1_31
230
+      #define E0_CS_PIN              EXP2_04_PIN
213 231
       // We use LCD_SDSS pin for E1
214 232
       #undef LCD_SDSS
215 233
       #define LCD_SDSS                     -1
216
-      #define E1_CS_PIN                    P1_23
234
+      #define E1_CS_PIN              EXP2_07_PIN
217 235
     #endif
218 236
 
219 237
     // Example 3: Use the driver enable pins for chip-select.

+ 0
- 12
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h Wyświetl plik

@@ -367,18 +367,6 @@
367 367
 
368 368
 #endif // HAS_WIRED_LCD
369 369
 
370
-//
371
-// SD Support
372
-//
373
-
374
-#ifndef SDCARD_CONNECTION
375
-  #define SDCARD_CONNECTION                  LCD
376
-#endif
377
-
378
-#if SD_CONNECTION_IS(LCD)
379
-  #define SD_SS_PIN                  EXP2_07_PIN
380
-#endif
381
-
382 370
 /**
383 371
  * Special pins
384 372
  *   P1_30  (37) (NOT 5V tolerant)

+ 0
- 18
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h Wyświetl plik

@@ -32,13 +32,6 @@
32 32
 #endif
33 33
 
34 34
 //
35
-// SD Connection
36
-//
37
-#ifndef SDCARD_CONNECTION
38
-  #define SDCARD_CONNECTION LCD
39
-#endif
40
-
41
-//
42 35
 // Servos
43 36
 //
44 37
 #define SERVO0_PIN                         P2_00
@@ -263,13 +256,6 @@
263 256
 #define EXP2_09_PIN                        P0_15
264 257
 #define EXP2_10_PIN                        P0_17
265 258
 
266
-//
267
-// SD Connection
268
-//
269
-#if SD_CONNECTION_IS(LCD)
270
-  #define SD_SS_PIN                  EXP2_07_PIN
271
-#endif
272
-
273 259
 /**
274 260
  *               _____                                             _____
275 261
  *           NC | · · | GND                                    5V | · · | GND
@@ -443,10 +429,6 @@
443 429
 
444 430
     #define LCD_SDSS                 EXP2_07_PIN  // (16) J3-7 & AUX-4
445 431
 
446
-    #if SD_CONNECTION_IS(LCD)
447
-      #define SD_DETECT_PIN          EXP2_04_PIN  // (49) (NOT 5V tolerant)
448
-    #endif
449
-
450 432
     #if ENABLED(FYSETC_MINI_12864)
451 433
       #define DOGLCD_CS              EXP1_08_PIN
452 434
       #define DOGLCD_A0              EXP1_07_PIN

+ 16
- 0
Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h Wyświetl plik

@@ -105,12 +105,28 @@
105 105
 //
106 106
 // SD Support
107 107
 //
108
+#ifndef SDCARD_CONNECTION
109
+  #if HAS_WIRED_LCD
110
+    #define SDCARD_CONNECTION                LCD
111
+  #else
112
+    #define SDCARD_CONNECTION            ONBOARD
113
+  #endif
114
+#endif
115
+
116
+
108 117
 #define ONBOARD_SD_CS_PIN                  P0_06  // Chip select for "System" SD card
109 118
 
119
+#if SD_CONNECTION_IS(LCD) && ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
120
+  #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_PINS_FOR_CS."
121
+#endif
122
+
110 123
 #if SD_CONNECTION_IS(LCD)
111 124
   #define SD_SCK_PIN                       P0_15
112 125
   #define SD_MISO_PIN                      P0_17
113 126
   #define SD_MOSI_PIN                      P0_18
127
+  #define SD_SS_PIN                  EXP2_07_PIN
128
+  #define SD_DETECT_PIN              EXP2_04_PIN
129
+
114 130
 #elif SD_CONNECTION_IS(ONBOARD)
115 131
   #undef SD_DETECT_PIN
116 132
   #define SD_DETECT_PIN                    P0_27

Ładowanie…
Anuluj
Zapisz