Skip to content

Commit 5c28d83

Browse files
committed
squashed updates
1 parent 20d20a9 commit 5c28d83

File tree

4 files changed

+34
-52
lines changed

4 files changed

+34
-52
lines changed

libraries/SD/examples/SD_Test/SD_Test.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* | █/
2020
* |__▍___▊___█___█___█___█___█___█___/
2121
*
22-
* Note: that SPI pins can be configured by using `SPI.begin(sck, miso, mosi, cs);`
23-
* alternatively you can change only the CS pin with `SD.begin(CSpin)`
22+
* Note: The SPI pins can be manually configured by using `SPI.begin(sck, miso, mosi, cs).`
23+
* Alternatively, you can change the CS pin and use the other default settings by using `SD.begin(cs)`.
2424
*
2525
* +--------------+---------+-------+----------+----------+----------+
2626
* | SPI Pin Name | ESP8266 | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 |
@@ -43,7 +43,7 @@
4343
#include "SPI.h"
4444

4545
/*
46-
Uncomment and setup pins you want to use for the SPI communication
46+
Uncomment and set up if you want to use custom pins for the SPI communication
4747
#define REASSIGN_PINS
4848
int sck = -1;
4949
int miso = -1;

libraries/SD/examples/SD_time/SD_time.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* | █/
2020
* |__▍___▊___█___█___█___█___█___█___/
2121
*
22-
* Note: that SPI pins can be configured by using `SPI.begin(sck, miso, mosi, cs);`
23-
* alternatively you can change only the CS pin with `SD.begin(CSpin)`
22+
* Note: The SPI pins can be manually configured by using `SPI.begin(sck, miso, mosi, cs);`.
23+
* Alternatively you can change only the CS pin with `SD.begin(CSpin)` and keep the default settings for other pins.
2424
*
2525
* +--------------+---------+-------+----------+----------+----------+
2626
* | SPI Pin Name | ESP8266 | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 |

libraries/SD_MMC/examples/SDMMC_Test/SDMMC_Test.ino

+16-25
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* SD pin number | 8 7 6 5 4 3 2 1 9 /
2222
* | █/
2323
* |__▍___▊___█___█___█___█___█___█___/
24-
* WARNING: ALL data pins must be pulled up to 3.3V with external 10k Ohm resistor!
25-
* Note to ESP32 pin 2 (D0) : add 1K pull up after flashing
24+
* WARNING: ALL data pins must be pulled up to 3.3V with an external 10k Ohm resistor!
25+
* Note to ESP32 pin 2 (D0): Add a 1K Ohm pull-up resistor to 3.3V after flashing
2626
*
2727
* For more info see file README.md in this library or on URL:
2828
* https://github.com/espressif/arduino-esp32/tree/master/libraries/SD_MMC
@@ -32,24 +32,24 @@
3232
#include "SD_MMC.h"
3333

3434
// Default pins for ESP-S3
35-
// Warning: ESP32-S3-WROOM-2 is using most of the default SD_MMC GPIOs (33-37) to interface with on-board OPI flash.
36-
// If the SD_MMC is initialized with default pins it will result in rebooting loop - please
37-
// reassign the pins elsewhere using the mentioned command `setPins`.
35+
// Warning: ESP32-S3-WROOM-2 is using most of the default SD_MMC GPIOs (33-37) to interface with the on-board OPI flash.
36+
// If the SD_MMC is initialized with the default pins it will result in rebooting loop.
37+
// Please reassign the pins elsewhere using the mentioned command `setPins`.
3838
// Note: ESP32-S3-WROOM-1 does not have GPIO 33 and 34 broken out.
39-
// Note: The board SP32-S3-USB-OTG has predefined default pins and the following definitions with the setPins() call will not be compiled.
39+
// Note: The board ESP32-S3-USB-OTG has predefined default pins and the following definitions with the setPins() call will not be compiled.
4040
// Note: Pins in this definition block are ordered from top down in order in which they are on the full-sized SD card
41-
// from left to right when facing the pins down (when connected to a breadboard)
41+
// from left to right when facing the pins down (when connected to a breadboard)
4242

4343
#if defined(SOC_SDMMC_USE_GPIO_MATRIX) && not defined(BOARD_HAS_SDMMC)
44-
int d1 = 21; // SD pin 8 - add 10k Pullup to 3.3V if using 4-bit mode (use_1_bit_mode = false)
45-
int d0 = 47; // SD pin 7 - add 10k Pullup
44+
int d1 = 21; // SD pin 8 - Add a 10k Ohm pull-up resistor to 3.3V if using 4-bit mode (use_1_bit_mode = false)
45+
int d0 = 47; // SD pin 7 - Add a 10k Ohm pull-up resistor to 3.3V
4646
// GND pin - SD pin 6
47-
int clk = 39; // SD pin 5 - add 10k Pullup
47+
int clk = 39; // SD pin 5 - Add a 10k Ohm pull-up resistor to 3.3V
4848
// 3.3V pin - SD pin 4
4949
// GND pin - SD pin 3
50-
int cmd = 40; // SD pin 2 - add 10k Pullup
51-
int d3 = 41; // SD pin 1 - add 10k Pullup to card's pin even when using 1-bit mode
52-
int d2 = 42; // SD pin 9 - add 10k Pullup to 3.3V if using 4-bit mode (use_1_bit_mode = false)
50+
int cmd = 40; // SD pin 2 - Add a 10k Ohm pull-up resistor to 3.3V
51+
int d3 = 41; // SD pin 1 - Add a 10k Ohm pull-up resistor to 3.3V to card's pin even when using 1-bit mode
52+
int d2 = 42; // SD pin 9 - Add a 10k Ohm pull-up resistor to 3.3V if using 4-bit mode (use_1_bit_mode = false)
5353
#endif
5454

5555
bool use_1_bit_mode = false; // Change the value to `true` to use 1-bit mode instead of the 4-bit mode
@@ -214,9 +214,9 @@ void setup(){
214214
Serial.println("SDMMC_Test.ino starting!");
215215

216216
// If you are using any other ESP32-S3 board than ESP32-S3-USB-OTG which has preset default pins, you will
217-
// need to specify the pins with the following example of SD_MMC.setPins()
217+
// need to specify the pins with the following example of SD_MMC.setPins()
218218
// If you want to use only 1-bit mode, you can use the line with only one data pin (d0) begin changed.
219-
// Please note that ESP32 does not allow pin change and will fail unless you enter the same pin config as is the hardwired.
219+
// Please note that ESP32 does not allow pin changes and will fail unless you enter the same pin config as is the hardwired.
220220
#if defined(SOC_SDMMC_USE_GPIO_MATRIX) && not defined(BOARD_HAS_SDMMC)
221221
//if(! SD_MMC.setPins(clk, cmd, d0)){ // 1-bit line version
222222
if(! SD_MMC.setPins(clk, cmd, d0, d1, d2, d3)){ // 4-bit line version
@@ -225,19 +225,10 @@ void setup(){
225225
}
226226
#endif
227227

228-
/*
229-
// This is waiting for implementation in peripheral manager (periman)
230-
if(use_1_bit_mode){
231-
Serial.printf("Begin in 1-bit mode; pins: CLK=%d, CMD=%d, D0=%d\n", SD_MMC.getClkPin(), SD_MMC.getCmdPin(), SD_MMC.getD0Pin());
232-
}else{
233-
Serial.printf("Begin in 4-bit mode; pins: CLK=%d, CMD=%d, D0=%d, D1=%d, D2=%d, D3=%d\n", SD_MMC.getClkPin(), SD_MMC.getCmdPin(), SD_MMC.getD0Pin(), SD_MMC.getD1Pin(), SD_MMC.getD2Pin(), SD_MMC.getD3Pin());
234-
}
235-
*/
236-
237228
if(!SD_MMC.begin("/sdcard", use_1_bit_mode)){
238229
Serial.println("Card Mount Failed.");
239230
Serial.println("Increase log level to see more info: Tools > Core Debug Level > Verbose");
240-
Serial.println("Make sure that all data pins have 10 kOhm pull-up resistor");
231+
Serial.println("Make sure that all data pins have a 10k Ohm pull-up resistor to 3.3V");
241232
#ifdef SOC_SDMMC_USE_GPIO_MATRIX
242233
Serial.println("Make sure that when using generic ESP32-S3 board the pins are setup using SD_MMC.setPins()");
243234
#endif

libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino

+13-22
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* | █/
2323
* |__▍___▊___█___█___█___█___█___█___/
2424
* WARNING: ALL data pins must be pulled up to 3.3V with external 10k Ohm resistor!
25-
* Note to ESP32 pin 2 (D0) : add 1K pull up after flashing
25+
* Note to ESP32 pin 2 (D0): Add 1K Ohm pull-up resistor to 3.3V after flashing
2626
*
2727
* For more info see file README.md in this library or on URL:
2828
* https://github.com/espressif/arduino-esp32/tree/master/libraries/SD_MMC
@@ -45,20 +45,20 @@ byte daysavetime = 1;
4545
// If the SD_MMC is initialized with default pins it will result in rebooting loop - please
4646
// reassign the pins elsewhere using the mentioned command `setPins`.
4747
// Note: ESP32-S3-WROOM-1 does not have GPIO 33 and 34 broken out.
48-
// Note: The board SP32-S3-USB-OTG has predefined default pins and the following definitions with the setPins() call will not be compiled.
48+
// Note: The board ESP32-S3-USB-OTG has predefined default pins and the following definitions with the setPins() call will not be compiled.
4949
// Note: Pins in this definition block are ordered from top down in order in which they are on the full-sized SD card
50-
// from left to right when facing the pins down (when connected to a breadboard)
50+
// from left to right when facing the pins down (when connected to a breadboard)
5151

5252
#if defined(SOC_SDMMC_USE_GPIO_MATRIX) && not defined(BOARD_HAS_SDMMC)
53-
int d1 = 21; // SD pin 8 - add 10k Pullup to 3.3V if using 4-bit mode (use_1_bit_mode = false)
54-
int d0 = 47; // SD pin 7 - add 10k Pullup
53+
int d1 = 21; // SD pin 8 - Add a 10k Ohm pull-up resistor to 3.3V if using 4-bit mode (use_1_bit_mode = false)
54+
int d0 = 47; // SD pin 7 - Add a 10k Ohm pull-up resistor to 3.3V
5555
// GND pin - SD pin 6
56-
int clk = 39; // SD pin 5 - add 10k Pullup
56+
int clk = 39; // SD pin 5 - Add a 10k Ohm pull-up resistor to 3.3V
5757
// 3.3V pin - SD pin 4
5858
// GND pin - SD pin 3
59-
int cmd = 40; // SD pin 2 - add 10k Pullup
60-
int d3 = 41; // SD pin 1 - add 10k Pullup to card's pin even when using 1-bit mode
61-
int d2 = 42; // SD pin 9 - add 10k Pullup to 3.3V if using 4-bit mode (use_1_bit_mode = false)
59+
int cmd = 40; // SD pin 2 - Add a 10k Ohm pull-up resistor to 3.3V
60+
int d3 = 41; // SD pin 1 - Add a 10k Ohm pull-up resistor to 3.3V to card's pin even when using 1-bit mode
61+
int d2 = 42; // SD pin 9 - Add a 10k Ohm pull-up resistor to 3.3V if using 4-bit mode (use_1_bit_mode = false)
6262
#endif
6363

6464
bool use_1_bit_mode = false; // Change the value to `true` to use 1-bit mode instead of the 4-bit mode
@@ -211,36 +211,27 @@ void setup(){
211211
Serial.println("");
212212

213213
// If you are using any other ESP32-S3 board than ESP32-S3-USB-OTG which has preset default pins, you will
214-
// need to specify the pins with the following example of SD_MMC.setPins()
214+
// need to specify the pins with the following example of SD_MMC.setPins()
215215
// If you want to use only 1-bit mode, you can use the line with only one data pin (d0) begin changed.
216-
// Please note that ESP32 does not allow pin change and will fail unless you enter the same pin config as is the hardwired.
216+
// Please note that ESP32 does not allow pin changes and will fail unless you enter the same pin config as is the hardwired.
217217
#if defined(SOC_SDMMC_USE_GPIO_MATRIX) && not defined(BOARD_HAS_SDMMC)
218218
if(use_1_bit_mode){
219219
if(! SD_MMC.setPins(clk, cmd, d0)){ // 1-bit line version
220220
Serial.println("Pin change failed!");
221221
return;
222222
}
223-
}else{
223+
} else {
224224
if(! SD_MMC.setPins(clk, cmd, d0, d1, d2, d3)){ // 4-bit line version
225225
Serial.println("Pin change failed!");
226226
return;
227227
}
228228
}
229229
#endif
230230

231-
/*
232-
// This is waiting for implementation in peripheral manager (periman)
233-
if(use_1_bit_mode){
234-
Serial.printf("Begin in 1-bit mode; pins: CLK=%d, CMD=%d, D0=%d\n", SD_MMC.getClkPin(), SD_MMC.getCmdPin(), SD_MMC.getD0Pin());
235-
}else{
236-
Serial.printf("Begin in 4-bit mode; pins: CLK=%d, CMD=%d, D0=%d, D1=%d, D2=%d, D3=%d\n", SD_MMC.getClkPin(), SD_MMC.getCmdPin(), SD_MMC.getD0Pin(), SD_MMC.getD1Pin(), SD_MMC.getD2Pin(), SD_MMC.getD3Pin());
237-
}
238-
*/
239-
240231
if(!SD_MMC.begin("/sdcard", use_1_bit_mode)){
241232
Serial.println("Card Mount Failed.");
242233
Serial.println("Increase log level to see more info: Tools > Core Debug Level > Verbose");
243-
Serial.println("Make sure that all data pins have 10 kOhm pull-up resistor");
234+
Serial.println("Make sure that all data pins have a 10k Ohm pull-up resistor to 3.3V");
244235
#ifdef SOC_SDMMC_USE_GPIO_MATRIX
245236
Serial.println("Make sure that when using generic ESP32-S3 board the pins are setup using SD_MMC.setPins()");
246237
#endif

0 commit comments

Comments
 (0)