Selaa lähdekoodia

Fix SDCARD_CONNECTION default for BTT SKR (#21755)

ellensp 4 vuotta sitten
vanhempi
commit
8c912d7ece
No account linked to committer's email address

+ 50
- 32
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h Näytä tiedosto

52
 #define E0_DIR_PIN                         P2_13
52
 #define E0_DIR_PIN                         P2_13
53
 #define E0_ENABLE_PIN                      P2_12
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
  * LCD / Controller
87
  * LCD / Controller
57
  *
88
  *
68
 #if IS_TFTGLCD_PANEL
99
 #if IS_TFTGLCD_PANEL
69
 
100
 
70
   #if ENABLED(TFTGLCD_PANEL_SPI)
101
   #if ENABLED(TFTGLCD_PANEL_SPI)
71
-    #define TFTGLCD_CS                     P3_26
102
+    #define TFTGLCD_CS               EXP2_08_PIN
72
   #endif
103
   #endif
73
 
104
 
74
-  #define SD_DETECT_PIN                    P1_31
75
-
76
 #elif HAS_WIRED_LCD
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
   #if ENABLED(MKS_MINI_12864)
116
   #if ENABLED(MKS_MINI_12864)
89
     #define DOGLCD_CS                      P2_06
117
     #define DOGLCD_CS                      P2_06
90
-    #define DOGLCD_A0                      P0_16
118
+    #define DOGLCD_A0                EXP1_07_PIN
91
   #endif
119
   #endif
92
 
120
 
93
 #endif // HAS_WIRED_LCD
121
 #endif // HAS_WIRED_LCD
106
   #endif
134
   #endif
107
 #endif
135
 #endif
108
 
136
 
109
-#if SD_CONNECTION_IS(LCD)
110
-  #define SD_SS_PIN                        P1_23
111
-#endif
112
-
113
 // Trinamic driver support
137
 // Trinamic driver support
114
 
138
 
115
 #if HAS_TRINAMIC_CONFIG
139
 #if HAS_TRINAMIC_CONFIG
140
   // When using any TMC SPI-based drivers, software SPI is used
164
   // When using any TMC SPI-based drivers, software SPI is used
141
   // because pins may be shared with the display or SD card.
165
   // because pins may be shared with the display or SD card.
142
   #define TMC_USE_SW_SPI
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
   // To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.)
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
   // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise.
171
   // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise.
148
   //#define TMC_SW_SCK                     P2_06
172
   //#define TMC_SW_SCK                     P2_06
149
 
173
 
186
     //            SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2.
210
     //            SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2.
187
     //#define SKR_USE_LCD_PINS_FOR_CS
211
     //#define SKR_USE_LCD_PINS_FOR_CS
188
     #if ENABLED(SKR_USE_LCD_PINS_FOR_CS)
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
     #endif
218
     #endif
198
 
219
 
199
     // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
220
     // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
201
     //            the pins will be in use. So SDCARD_CONNECTION must not be 'LCD'.
222
     //            the pins will be in use. So SDCARD_CONNECTION must not be 'LCD'.
202
     //#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS
223
     //#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS
203
     #if ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
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
       #define X_CS_PIN                     P0_02
225
       #define X_CS_PIN                     P0_02
208
       #define Y_CS_PIN                     P0_03
226
       #define Y_CS_PIN                     P0_03
209
       #define Z_CS_PIN                     P2_06
227
       #define Z_CS_PIN                     P2_06
210
       // We use SD_DETECT_PIN for E0
228
       // We use SD_DETECT_PIN for E0
211
       #undef SD_DETECT_PIN
229
       #undef SD_DETECT_PIN
212
-      #define E0_CS_PIN                    P1_31
230
+      #define E0_CS_PIN              EXP2_04_PIN
213
       // We use LCD_SDSS pin for E1
231
       // We use LCD_SDSS pin for E1
214
       #undef LCD_SDSS
232
       #undef LCD_SDSS
215
       #define LCD_SDSS                     -1
233
       #define LCD_SDSS                     -1
216
-      #define E1_CS_PIN                    P1_23
234
+      #define E1_CS_PIN              EXP2_07_PIN
217
     #endif
235
     #endif
218
 
236
 
219
     // Example 3: Use the driver enable pins for chip-select.
237
     // Example 3: Use the driver enable pins for chip-select.

+ 0
- 12
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h Näytä tiedosto

367
 
367
 
368
 #endif // HAS_WIRED_LCD
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
  * Special pins
371
  * Special pins
384
  *   P1_30  (37) (NOT 5V tolerant)
372
  *   P1_30  (37) (NOT 5V tolerant)

+ 0
- 18
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h Näytä tiedosto

32
 #endif
32
 #endif
33
 
33
 
34
 //
34
 //
35
-// SD Connection
36
-//
37
-#ifndef SDCARD_CONNECTION
38
-  #define SDCARD_CONNECTION LCD
39
-#endif
40
-
41
-//
42
 // Servos
35
 // Servos
43
 //
36
 //
44
 #define SERVO0_PIN                         P2_00
37
 #define SERVO0_PIN                         P2_00
263
 #define EXP2_09_PIN                        P0_15
256
 #define EXP2_09_PIN                        P0_15
264
 #define EXP2_10_PIN                        P0_17
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
  *           NC | · · | GND                                    5V | · · | GND
261
  *           NC | · · | GND                                    5V | · · | GND
443
 
429
 
444
     #define LCD_SDSS                 EXP2_07_PIN  // (16) J3-7 & AUX-4
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
     #if ENABLED(FYSETC_MINI_12864)
432
     #if ENABLED(FYSETC_MINI_12864)
451
       #define DOGLCD_CS              EXP1_08_PIN
433
       #define DOGLCD_CS              EXP1_08_PIN
452
       #define DOGLCD_A0              EXP1_07_PIN
434
       #define DOGLCD_A0              EXP1_07_PIN

+ 16
- 0
Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h Näytä tiedosto

105
 //
105
 //
106
 // SD Support
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
 #define ONBOARD_SD_CS_PIN                  P0_06  // Chip select for "System" SD card
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
 #if SD_CONNECTION_IS(LCD)
123
 #if SD_CONNECTION_IS(LCD)
111
   #define SD_SCK_PIN                       P0_15
124
   #define SD_SCK_PIN                       P0_15
112
   #define SD_MISO_PIN                      P0_17
125
   #define SD_MISO_PIN                      P0_17
113
   #define SD_MOSI_PIN                      P0_18
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
 #elif SD_CONNECTION_IS(ONBOARD)
130
 #elif SD_CONNECTION_IS(ONBOARD)
115
   #undef SD_DETECT_PIN
131
   #undef SD_DETECT_PIN
116
   #define SD_DETECT_PIN                    P0_27
132
   #define SD_DETECT_PIN                    P0_27

Loading…
Peruuta
Tallenna