Browse Source

🎨 Pins and SDIO cleanup

Scott Lahteine 2 years ago
parent
commit
56ac681727

Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp → Marlin/src/HAL/STM32/sdio.cpp View File

@@ -28,6 +28,8 @@
28 28
 
29 29
 #if ENABLED(SDIO_SUPPORT)
30 30
 
31
+#include "sdio.h"
32
+
31 33
 #include <stdint.h>
32 34
 #include <stdbool.h>
33 35
 
@@ -49,14 +51,6 @@
49 51
   #error "SDIO only supported with STM32F103xE, STM32F103xG, STM32F4xx, or STM32F7xx."
50 52
 #endif
51 53
 
52
-// Fixed
53
-#define SDIO_D0_PIN   PC8
54
-#define SDIO_D1_PIN   PC9
55
-#define SDIO_D2_PIN   PC10
56
-#define SDIO_D3_PIN   PC11
57
-#define SDIO_CK_PIN   PC12
58
-#define SDIO_CMD_PIN  PD2
59
-
60 54
 SD_HandleTypeDef hsd;  // create SDIO structure
61 55
 // F4 supports one DMA for RX and another for TX, but Marlin will never
62 56
 // do read and write at same time, so we use the same DMA for both.

+ 29
- 0
Marlin/src/HAL/STM32/sdio.h View File

@@ -0,0 +1,29 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#define SDIO_D0_PIN   PC8
25
+#define SDIO_D1_PIN   PC9
26
+#define SDIO_D2_PIN   PC10
27
+#define SDIO_D3_PIN   PC11
28
+#define SDIO_CK_PIN   PC12
29
+#define SDIO_CMD_PIN  PD2

+ 4
- 11
Marlin/src/pins/stm32f4/pins_ANET_ET4.h View File

@@ -203,19 +203,12 @@
203 203
 
204 204
 #if ENABLED(SDSUPPORT)
205 205
 
206
-  #define SDIO_D0_PIN                       PC8
207
-  #define SDIO_D1_PIN                       PC9
208
-  #define SDIO_D2_PIN                       PC10
209
-  #define SDIO_D3_PIN                       PC11
210
-  #define SDIO_CK_PIN                       PC12
211
-  #define SDIO_CMD_PIN                      PD2
212
-
213 206
   #if DISABLED(SDIO_SUPPORT)
214 207
     #define SOFTWARE_SPI
215
-    #define SDSS                     SDIO_D3_PIN
216
-    #define SD_SCK_PIN               SDIO_CK_PIN
217
-    #define SD_MISO_PIN              SDIO_D0_PIN
218
-    #define SD_MOSI_PIN             SDIO_CMD_PIN
208
+    #define SDSS                            PC11
209
+    #define SD_SCK_PIN                      PC12
210
+    #define SD_MISO_PIN                     PC8
211
+    #define SD_MOSI_PIN                     PD2
219 212
   #endif
220 213
 
221 214
   #ifndef SD_DETECT_PIN

+ 5
- 13
Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h View File

@@ -140,25 +140,17 @@
140 140
 //
141 141
 // Onboard SD support
142 142
 //
143
-#define SDIO_D0_PIN                         PC8
144
-#define SDIO_D1_PIN                         PC9
145
-#define SDIO_D2_PIN                         PC10
146
-#define SDIO_D3_PIN                         PC11
147
-#define SDIO_CK_PIN                         PC12
148
-#define SDIO_CMD_PIN                        PD2
149
-
150 143
 #ifndef SDCARD_CONNECTION
151 144
   #define SDCARD_CONNECTION              ONBOARD
152 145
 #endif
153 146
 
154 147
 #if SD_CONNECTION_IS(ONBOARD)
155 148
   #define SDIO_SUPPORT                            // Use SDIO for onboard SD
156
-
157
-  #ifndef SDIO_SUPPORT
149
+  #if DISABLED(SDIO_SUPPORT)
158 150
     #define SOFTWARE_SPI                          // Use soft SPI for onboard SD
159
-    #define SDSS                     SDIO_D3_PIN
160
-    #define SD_SCK_PIN               SDIO_CK_PIN
161
-    #define SD_MISO_PIN              SDIO_D0_PIN
162
-    #define SD_MOSI_PIN             SDIO_CMD_PIN
151
+    #define SDSS                            PC11
152
+    #define SD_SCK_PIN                      PC12
153
+    #define SD_MISO_PIN                     PC8
154
+    #define SD_MOSI_PIN                     PD2
163 155
   #endif
164 156
 #endif

+ 0
- 7
Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h View File

@@ -338,13 +338,6 @@
338 338
 
339 339
 #if SD_CONNECTION_IS(ONBOARD)
340 340
   #define SDIO_SUPPORT                            // Use SDIO for onboard SD
341
-  #define SDIO_D0_PIN                       PC8
342
-  #define SDIO_D1_PIN                       PC9
343
-  #define SDIO_D2_PIN                       PC10
344
-  #define SDIO_D3_PIN                       PC11
345
-  #define SDIO_CK_PIN                       PC12
346
-  #define SDIO_CMD_PIN                      PD2
347
-
348 341
   //#define SDIO_CLOCK                  48000000
349 342
   #define SD_DETECT_PIN                     PC4
350 343
 #elif SD_CONNECTION_IS(CUSTOM_CABLE)

+ 0
- 10
Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h View File

@@ -365,24 +365,14 @@
365 365
 // Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2
366 366
 //
367 367
 #if SD_CONNECTION_IS(LCD)
368
-
369 368
   #define SDSS                       EXP2_07_PIN
370 369
   #define SD_SS_PIN                         SDSS
371 370
   #define SD_SCK_PIN                 EXP2_09_PIN
372 371
   #define SD_MISO_PIN                EXP2_10_PIN
373 372
   #define SD_MOSI_PIN                EXP2_05_PIN
374 373
   #define SD_DETECT_PIN              EXP2_04_PIN
375
-
376 374
 #elif SD_CONNECTION_IS(ONBOARD)
377
-
378 375
   #define SDIO_SUPPORT                            // Use SDIO for onboard SD
379
-  #define SDIO_D0_PIN                       PC8
380
-  #define SDIO_D1_PIN                       PC9
381
-  #define SDIO_D2_PIN                       PC10
382
-  #define SDIO_D3_PIN                       PC11
383
-  #define SDIO_CK_PIN                       PC12
384
-  #define SDIO_CMD_PIN                      PD2
385
-
386 376
 #elif SD_CONNECTION_IS(CUSTOM_CABLE)
387 377
   #error "No custom SD drive cable defined for this board."
388 378
 #endif

+ 107
- 112
Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h View File

@@ -48,13 +48,13 @@
48 48
 //
49 49
 // Limit Switches
50 50
 //
51
-#define X_MIN_PIN                             39  // PD8   X_STOP
52
-#define Y_MIN_PIN                             40  // PD9   Y_STOP
53
-#define Z_MIN_PIN                             41  // PD10  Z_STOP
51
+#define X_MIN_PIN                           PD8   // X_STOP
52
+#define Y_MIN_PIN                           PD9   // Y_STOP
53
+#define Z_MIN_PIN                           PD10  // Z_STOP
54 54
 
55
-#define X_MAX_PIN                             44  // PD0   W_STOP
56
-#define Y_MAX_PIN                             43  // PA8   V_STOP
57
-#define Z_MAX_PIN                             42  // PD11  U_STOP
55
+#define X_MAX_PIN                           PD0   // W_STOP
56
+#define Y_MAX_PIN                           PA8   // V_STOP
57
+#define Z_MAX_PIN                           PD11  // U_STOP
58 58
 
59 59
 //
60 60
 // Z Probe (when not Z_MIN_PIN)
@@ -66,64 +66,64 @@
66 66
 //
67 67
 // Filament runout
68 68
 //
69
-//#define FIL_RUNOUT_PIN                      53  // PA3    BED_THE
69
+//#define FIL_RUNOUT_PIN                    PA3   // BED_THE
70 70
 
71 71
 //
72 72
 // Steppers
73 73
 //
74 74
 
75
-#define X_STEP_PIN                            61  // PE14    X_PWM
76
-#define X_DIR_PIN                             62  // PE15    X_DIR
77
-#define X_ENABLE_PIN                          60  // PE13    X_RES
78
-#define X_CS_PIN                              16  // PA4     SPI_CS
75
+#define X_STEP_PIN                          PE14  // X_PWM
76
+#define X_DIR_PIN                           PE15  // X_DIR
77
+#define X_ENABLE_PIN                        PE13  // X_RES
78
+#define X_CS_PIN                            PA4   // SPI_CS
79 79
 
80
-#define Y_STEP_PIN                            64  // PB10    Y_PWM
81
-#define Y_DIR_PIN                             65  // PE9     Y_DIR
82
-#define Y_ENABLE_PIN                          63  // PE10    Y_RES
83
-#define Y_CS_PIN                              16  // PA4     SPI_CS
80
+#define Y_STEP_PIN                          PB10  // Y_PWM
81
+#define Y_DIR_PIN                           PE9   // Y_DIR
82
+#define Y_ENABLE_PIN                        PE10  // Y_RES
83
+#define Y_CS_PIN                            PA4   // SPI_CS
84 84
 
85
-#define Z_STEP_PIN                            67  // PC6     Z_PWM
86
-#define Z_DIR_PIN                             68  // PC0     Z_DIR
87
-#define Z_ENABLE_PIN                          66  // PC15    Z_RES
88
-#define Z_CS_PIN                              16  // PA4     SPI_CS
85
+#define Z_STEP_PIN                          PC6   // Z_PWM
86
+#define Z_DIR_PIN                           PC0   // Z_DIR
87
+#define Z_ENABLE_PIN                        PC15  // Z_RES
88
+#define Z_CS_PIN                            PA4   // SPI_CS
89 89
 
90
-#define E0_STEP_PIN                           71  // PD12    E1_PW
91
-#define E0_DIR_PIN                            70  // PC13    E1_DIR
92
-#define E0_ENABLE_PIN                         69  // PC14    E1_RE
93
-#define E0_CS_PIN                             16  // PA4     SPI_CS
90
+#define E0_STEP_PIN                         PD12  // E1_PW
91
+#define E0_DIR_PIN                          PC13  // E1_DIR
92
+#define E0_ENABLE_PIN                       PC14  // E1_RE
93
+#define E0_CS_PIN                           PA4   // SPI_CS
94 94
 
95
-#define E1_STEP_PIN                           73  // PE5     E2_PWM
96
-#define E1_DIR_PIN                            74  // PE6     E2_DIR
97
-#define E1_ENABLE_PIN                         72  // PE4     E2_RESE
98
-#define E1_CS_PIN                             16  // PA4     SPI_CS
95
+#define E1_STEP_PIN                         PE5   // E2_PWM
96
+#define E1_DIR_PIN                          PE6   // E2_DIR
97
+#define E1_ENABLE_PIN                       PE4   // E2_RESE
98
+#define E1_CS_PIN                           PA4   // SPI_CS
99 99
 
100
-#define E2_STEP_PIN                           77  // PB8     E3_PWM
101
-#define E2_DIR_PIN                            76  // PE2     E3_DIR
102
-#define E2_ENABLE_PIN                         75  // PE3     E3_RESE
103
-#define E2_CS_PIN                             16  // PA4     SPI_CS
100
+#define E2_STEP_PIN                         PB8   // E3_PWM
101
+#define E2_DIR_PIN                          PE2   // E3_DIR
102
+#define E2_ENABLE_PIN                       PE3   // E3_RESE
103
+#define E2_CS_PIN                           PA4   // SPI_CS
104 104
 
105 105
 // needed to pass a sanity check
106
-#define X2_CS_PIN                             16  // PA4     SPI_CS
107
-#define Y2_CS_PIN                             16  // PA4     SPI_CS
108
-#define Z2_CS_PIN                             16  // PA4     SPI_CS
109
-#define Z3_CS_PIN                             16  // PA4     SPI_CS
110
-#define E3_CS_PIN                             16  // PA4     SPI_CS
111
-#define E4_CS_PIN                             16  // PA4     SPI_CS
112
-#define E5_CS_PIN                             16  // PA4     SPI_CS
106
+#define X2_CS_PIN                           PA4   // SPI_CS
107
+#define Y2_CS_PIN                           PA4   // SPI_CS
108
+#define Z2_CS_PIN                           PA4   // SPI_CS
109
+#define Z3_CS_PIN                           PA4   // SPI_CS
110
+#define E3_CS_PIN                           PA4   // SPI_CS
111
+#define E4_CS_PIN                           PA4   // SPI_CS
112
+#define E5_CS_PIN                           PA4   // SPI_CS
113 113
 
114 114
 #if HAS_L64XX
115
-  #define L6470_CHAIN_SCK_PIN                 17  // PA5
116
-  #define L6470_CHAIN_MISO_PIN                18  // PA6
117
-  #define L6470_CHAIN_MOSI_PIN                19  // PA7
118
-  #define L6470_CHAIN_SS_PIN                  16  // PA4
115
+  #define L6470_CHAIN_SCK_PIN               PA5
116
+  #define L6470_CHAIN_MISO_PIN              PA6
117
+  #define L6470_CHAIN_MOSI_PIN              PA7
118
+  #define L6470_CHAIN_SS_PIN                PA4
119 119
 
120 120
   //#define SD_SCK_PIN       L6470_CHAIN_SCK_PIN
121 121
   //#define SD_MISO_PIN     L6470_CHAIN_MISO_PIN
122 122
   //#define SD_MOSI_PIN     L6470_CHAIN_MOSI_PIN
123 123
 #else
124
-  //#define SD_SCK_PIN                        13  // PB13    SPI_S
125
-  //#define SD_MISO_PIN                       12  // PB14    SPI_M
126
-  //#define SD_MOSI_PIN                       11  // PB15    SPI_M
124
+  //#define SD_SCK_PIN                      PB13  // SPI_S
125
+  //#define SD_MISO_PIN                     PB14  // SPI_M
126
+  //#define SD_MOSI_PIN                     PB15  // SPI_M
127 127
 #endif
128 128
 
129 129
 /**
@@ -144,114 +144,109 @@
144 144
 //
145 145
 // Temperature Sensors
146 146
 //
147
-#define TEMP_0_PIN                             3  // Analog input 3,  digital pin 54   PA0     E1_THERMISTOR
148
-#define TEMP_1_PIN                             4  // Analog input 4,  digital pin 55   PA1     E2_THERMISTOR
149
-#define TEMP_2_PIN                             5  // Analog input 5,  digital pin 56   PA2     E3_THERMISTOR
150
-#define TEMP_BED_PIN                           0  // Analog input 0,  digital pin 51   PC2     BED_THERMISTOR_1
151
-#define TEMP_BED_1_PIN                         1  // Analog input 1,  digital pin 52   PC3     BED_THERMISTOR_2
152
-#define TEMP_BED_2_PIN                         2  // Analog input 2,  digital pin 53   PA3     BED_THERMISTOR_3
147
+#define TEMP_0_PIN                          PA0   // Analog input 3,  digital pin 54   PA0     E1_THERMISTOR
148
+#define TEMP_1_PIN                          PA1   // Analog input 4,  digital pin 55   PA1     E2_THERMISTOR
149
+#define TEMP_2_PIN                          PA2   // Analog input 5,  digital pin 56   PA2     E3_THERMISTOR
150
+#define TEMP_BED_PIN                        PC2   // Analog input 0,  digital pin 51   PC2     BED_THERMISTOR_1
151
+#define TEMP_BED_1_PIN                      PC3   // Analog input 1,  digital pin 52   PC3     BED_THERMISTOR_2
152
+#define TEMP_BED_2_PIN                      PA3   // Analog input 2,  digital pin 53   PA3     BED_THERMISTOR_3
153 153
 
154 154
 //
155 155
 // Heaters / Fans
156 156
 //
157
-#define HEATER_0_PIN                          48  // PC7   E1_HEAT_PWM
158
-#define HEATER_1_PIN                          49  // PB0   E2_HEAT_PWM
159
-#define HEATER_2_PIN                          50  // PB1   E3_HEAT_PWM
160
-#define HEATER_BED_PIN                        46  // PD14 (BED_HEAT_1 FET
161
-#define HEATER_BED_1_PIN                      45  // PD13 (BED_HEAT_2 FET
162
-#define HEATER_BED_2_PIN                      47  // PD15 (BED_HEAT_3 FET
157
+#define HEATER_0_PIN                        PC7   // E1_HEAT_PWM
158
+#define HEATER_1_PIN                        PB0   // E2_HEAT_PWM
159
+#define HEATER_2_PIN                        PB1   // E3_HEAT_PWM
160
+#define HEATER_BED_PIN                      PD14  // (BED_HEAT_1 FET
161
+#define HEATER_BED_1_PIN                    PD13  // (BED_HEAT_2 FET
162
+#define HEATER_BED_2_PIN                    PD15  // (BED_HEAT_3 FET
163 163
 
164
-#define FAN_PIN                               57  // PC4   E1_FAN   PWM pin, Part cooling fan FET
165
-#define FAN1_PIN                              58  // PC5   E2_FAN   PWM pin, Extruder fan FET
166
-#define FAN2_PIN                              59  // PE8   E3_FAN   PWM pin, Controller fan FET
164
+#define FAN_PIN                             PC4   // E1_FAN   PWM pin, Part cooling fan FET
165
+#define FAN1_PIN                            PC5   // E2_FAN   PWM pin, Extruder fan FET
166
+#define FAN2_PIN                            PE8   // E3_FAN   PWM pin, Controller fan FET
167 167
 
168 168
 #ifndef E0_AUTO_FAN_PIN
169
-  #define E0_AUTO_FAN_PIN                     58  // FAN1_PIN
169
+  #define E0_AUTO_FAN_PIN                   PC5   // FAN1_PIN
170 170
 #endif
171 171
 
172 172
 //
173 173
 // Misc functions
174 174
 //
175
-#define LED_PIN                               -1  // 9 // PE1 green LED   Heart beat
176
-#define PS_ON_PIN                             -1
177
-#define KILL_PIN                              -1
178
-#define POWER_LOSS_PIN                        -1  // PWR_LOSS / nAC_FAULT
175
+#define LED_PIN                             -1    // 9 // PE1 green LED   Heart beat
176
+#define PS_ON_PIN                           -1
177
+#define KILL_PIN                            -1
178
+#define POWER_LOSS_PIN                      -1    // PWR_LOSS / nAC_FAULT
179 179
 
180 180
 //
181 181
 // LCD / Controller
182 182
 //
183
-//#define SD_DETECT_PIN                       66  // PA15    SD_CA
184
-//#define BEEPER_PIN                          24  // PC9     SDIO_D1
185
-//#define LCD_PINS_RS                         65  // PE9     Y_DIR
186
-//#define LCD_PINS_ENABLE                     59  // PE8     E3_FAN
187
-//#define LCD_PINS_D4                         10  // PB12    SPI_C
188
-//#define LCD_PINS_D5                         13  // PB13    SPI_S
189
-//#define LCD_PINS_D6                         12  // PB14    SPI_M
190
-//#define LCD_PINS_D7                         11  // PB15    SPI_M
191
-//#define BTN_EN1                             57  // PC4     E1_FAN
192
-//#define BTN_EN2                             58  // PC5     E2_FAN
193
-//#define BTN_ENC                             52  // PC3     BED_THE
183
+//#define SD_DETECT_PIN                     PA15  // SD_CA
184
+//#define BEEPER_PIN                        PC9   // SDIO_D1
185
+//#define LCD_PINS_RS                       PE9   // Y_DIR
186
+//#define LCD_PINS_ENABLE                   PE8   // E3_FAN
187
+//#define LCD_PINS_D4                       PB12  // SPI_C
188
+//#define LCD_PINS_D5                       PB13  // SPI_S
189
+//#define LCD_PINS_D6                       PB14  // SPI_M
190
+//#define LCD_PINS_D7                       PB15  // SPI_M
191
+//#define BTN_EN1                           PC4   // E1_FAN
192
+//#define BTN_EN2                           PC5   // E2_FAN
193
+//#define BTN_ENC                           PC3   // BED_THE
194 194
 
195 195
 //
196 196
 // Extension pins
197 197
 //
198
-//#define EXT0_PIN                            49  // PB0     E2_HEAT
199
-//#define EXT1_PIN                            50  // PB1     E3_HEAT
200
-//#define EXT2_PIN                                // PB2    not used (tied to ground
201
-//#define EXT3_PIN                            39  // PD8     X_STOP
202
-//#define EXT4_PIN                            40  // PD9     Y_STOP
203
-//#define EXT5_PIN                            41  // PD10    Z_STOP
204
-//#define EXT6_PIN                            42  // PD11
205
-//#define EXT7_PIN                            71  // PD12    E1_PW
206
-//#define EXT8_PIN                            64  // PB10    Y_PWM
198
+//#define EXT0_PIN                          PB0   //E2_HEAT
199
+//#define EXT1_PIN                          PB1   //E3_HEAT
200
+//#define EXT2_PIN                          PB2   //not used (tied to ground
201
+//#define EXT3_PIN                          PD8   //X_STOP
202
+//#define EXT4_PIN                          PD9   //Y_STOP
203
+//#define EXT5_PIN                          PD10  //Z_STOP
204
+//#define EXT6_PIN                          PD11
205
+//#define EXT7_PIN                          PD12  //E1_PW
206
+//#define EXT8_PIN                          PB10  //Y_PWM
207 207
 
208 208
 // WIFI
209
-//  2   // PD3   CTS
210
-//  3   // PD4   RTS
211
-//  4   // PD5   TX
212
-//  5   // PD6   RX
213
-//  6   // PB5   WIFI_WAKEUP
214
-//  7   // PE11  WIFI_RESET
215
-//  8   // PE12  WIFI_BOOT
209
+// PD3   CTS
210
+// PD4   RTS
211
+// PD5   TX
212
+// PD6   RX
213
+// PB5   WIFI_WAKEUP
214
+// PE11  WIFI_RESET
215
+// PE12  WIFI_BOOT
216 216
 
217 217
 // I2C USER
218
-// 14   // PB7   SDA
219
-// 15   // PB6   SCL
218
+// PB7   SDA
219
+// PB6   SCL
220 220
 
221 221
 // JTAG
222
-// 20   // PA13  JTAG_TMS/SWDIO
223
-// 21   // PA14  JTAG_TCK/SWCLK
224
-// 22   // PB3   JTAG_TDO/SWO
222
+// PA13  JTAG_TMS/SWDIO
223
+// PA14  JTAG_TCK/SWCLK
224
+// PB3   JTAG_TDO/SWO
225 225
 
226 226
 //
227 227
 // Onboard SD support
228 228
 //
229
-#define SDIO_D0_PIN                           23  // PC8   SDIO_D0
230
-#define SDIO_D1_PIN                           24  // PC9   SDIO_D1
231
-//#define SD_CARD_DETECT_PIN                  25  // PA15  SD_CARD_DETECT
232
-#define SDIO_D2_PIN                           26  // PC10  SDIO_D2
233
-#define SDIO_D3_PIN                           27  // PC11  SDIO_D3
234
-#define SDIO_CK_PIN                           28  // PC12  SDIO_CK
235
-#define SDIO_CMD_PIN                          29  // PD2   SDIO_CMD
236
-
237 229
 #ifndef SDCARD_CONNECTION
238 230
   #define SDCARD_CONNECTION              ONBOARD
239 231
 #endif
240 232
 
241 233
 #if SD_CONNECTION_IS(ONBOARD)
242
-  #define SDIO_SUPPORT                            // Use SDIO for onboard SD
243 234
 
244
-  #ifndef SDIO_SUPPORT
235
+  #define SDIO_SUPPORT                            // Use SDIO for onboard SD
236
+  #if DISABLED(SDIO_SUPPORT)
245 237
     #define SOFTWARE_SPI                          // Use soft SPI for onboard SD
246
-    #define SDSS                     SDIO_D3_PIN
247
-    #define SD_SCK_PIN               SDIO_CK_PIN
248
-    #define SD_MISO_PIN              SDIO_D0_PIN
249
-    #define SD_MOSI_PIN             SDIO_CMD_PIN
238
+    #define SDSS                            PC11
239
+    #define SD_SCK_PIN                      PC12
240
+    #define SD_MISO_PIN                     PC8
241
+    #define SD_MOSI_PIN                     PD2
250 242
   #endif
243
+
244
+  //#define SD_CARD_DETECT_PIN              PA15  // SD_CARD_DETECT
245
+
251 246
 #endif
252 247
 
253 248
 #ifndef SDSS
254
-  #define SDSS                                16  // PA4    SPI_CS
249
+  #define SDSS                              PA4   // SPI_CS
255 250
 #endif
256 251
 
257 252
 // OTG

Loading…
Cancel
Save