Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example: Matched pin numbers in docs to numbers in variants files #9422

Merged
merged 4 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions libraries/SD/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Some ESP32 modules have different pin outs!
## Default SPI pins:
Note that SPI pins can be configured by using `SPI.begin(sck, miso, mosi, cs);` alternatively, you can change only the CS pin with `SD.begin(CSpin)`

| SPI Pin Name | ESP8266 | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 |
|--------------|---------|-------|----------|----------|----------|
| CS (SS) | GPIO15 | GPIO5 | GPIO5 | GPIO13 | GPIO13 |
| DI (MOSI) | GPIO13 | GPIO23| GPIO24 | GPIO14 | GPIO14 |
| DO (MISO) | GPIO12 | GPIO19| GPIO25 | GPIO15 | GPIO15 |
| SCK (SCLK) | GPIO14 | GPIO18| GPIO19 | GPIO16 | GPIO16 |
| SPI Pin Name | ESP8266 | ESP32 | ESP32S2 | ESP32‑S3 | ESP32‑C3 | ESP32‑C6 | ESP32‑H2 |
|--------------|---------|-------|----------|----------|----------|----------|----------|
| CS (SS) | GPIO15 | GPIO5 | GPIO34 | GPIO10 | GPIO7 | GPIO18 | GPIO0 |
| DI (MOSI) | GPIO13 | GPIO23| GPIO35 | GPIO11 | GPIO6 | GPIO19 | GPIO25 |
| DO (MISO) | GPIO12 | GPIO19| GPIO37 | GPIO13 | GPIO5 | GPIO20 | GPIO11 |
| SCK (SCLK) | GPIO14 | GPIO18| GPIO36 | GPIO12 | GPIO4 | GPIO21 | GPIO10 |

## FAQ:

Expand Down
27 changes: 14 additions & 13 deletions libraries/SD/examples/SD_Test/SD_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
* Note: The SPI pins can be manually configured by using `SPI.begin(sck, miso, mosi, cs).`
* Alternatively, you can change the CS pin and use the other default settings by using `SD.begin(cs)`.
*
* +--------------+---------+-------+----------+----------+----------+
* | SPI Pin Name | ESP8266 | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 |
* +==============+=========+=======+==========+==========+==========+
* | CS (SS) | GPIO15 | GPIO5 | GPIO5 | GPIO13 | GPIO13 |
* +--------------+---------+-------+----------+----------+----------+
* | DI (MOSI) | GPIO13 | GPIO23| GPIO24 | GPIO14 | GPIO14 |
* +--------------+---------+-------+----------+----------+----------+
* | DO (MISO) | GPIO12 | GPIO19| GPIO25 | GPIO15 | GPIO15 |
* +--------------+---------+-------+----------+----------+----------+
* | SCK (SCLK) | GPIO14 | GPIO18| GPIO19 | GPIO16 | GPIO16 |
* +--------------+---------+-------+----------+----------+----------+
* +--------------+---------+-------+----------+----------+----------+----------+----------+
* | SPI Pin Name | ESP8266 | ESP32 | ESP32S2 | ESP32‑S3 | ESP32‑C3 | ESP32‑C6 | ESP32‑H2 |
* +==============+=========+=======+==========+==========+==========+==========+==========+
* | CS (SS) | GPIO15 | GPIO5 | GPIO34 | GPIO10 | GPIO7 | GPIO18 | GPIO0 |
* +--------------+---------+-------+----------+----------+----------+----------+----------+
* | DI (MOSI) | GPIO13 | GPIO23| GPIO35 | GPIO11 | GPIO6 | GPIO19 | GPIO25 |
* +--------------+---------+-------+----------+----------+----------+----------+----------+
* | DO (MISO) | GPIO12 | GPIO19| GPIO37 | GPIO13 | GPIO5 | GPIO20 | GPIO11 |
* +--------------+---------+-------+----------+----------+----------+----------+----------+
* | SCK (SCLK) | GPIO14 | GPIO18| GPIO36 | GPIO12 | GPIO4 | GPIO21 | GPIO10 |
* +--------------+---------+-------+----------+----------+----------+----------+----------+
*
* For more info see file README.md in this library or on URL:
* https://github.com/espressif/arduino-esp32/tree/master/libraries/SD
Expand Down Expand Up @@ -214,9 +214,10 @@ void setup(){

#ifdef REASSIGN_PINS
SPI.begin(sck, miso, mosi, cs);
#endif
//if(!SD.begin(cs)){ //Change to this function to manually change CS pin
if(!SD.begin(cs)){
#else
if(!SD.begin()){
#endif
Serial.println("Card Mount Failed");
return;
}
Expand Down
27 changes: 14 additions & 13 deletions libraries/SD/examples/SD_time/SD_time.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
* Note: The SPI pins can be manually configured by using `SPI.begin(sck, miso, mosi, cs);`.
* Alternatively you can change only the CS pin with `SD.begin(CSpin)` and keep the default settings for other pins.
*
* +--------------+---------+-------+----------+----------+----------+
* | SPI Pin Name | ESP8266 | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 |
* +==============+=========+=======+==========+==========+==========+
* | CS (SS) | GPIO15 | GPIO5 | GPIO5 | GPIO13 | GPIO13 |
* +--------------+---------+-------+----------+----------+----------+
* | DI (MOSI) | GPIO13 | GPIO23| GPIO24 | GPIO14 | GPIO14 |
* +--------------+---------+-------+----------+----------+----------+
* | DO (MISO) | GPIO12 | GPIO19| GPIO25 | GPIO15 | GPIO15 |
* +--------------+---------+-------+----------+----------+----------+
* | SCK (SCLK) | GPIO14 | GPIO18| GPIO19 | GPIO16 | GPIO16 |
* +--------------+---------+-------+----------+----------+----------+
+----------+
* | SPI Pin Name | ESP8266 | ESP32 | ESP32S2 | ESP32‑S3 | ESP32‑C3 | ESP32‑C6 | ESP32‑H2 |
* +==============+=========+=======+==========+==========+==========+==========+==========+
* | CS (SS) | GPIO15 | GPIO5 | GPIO34 | GPIO10 | GPIO7 | GPIO18 | GPIO0 |
* +--------------+---------+-------+----------+----------+----------+----------+----------+
* | DI (MOSI) | GPIO13 | GPIO23| GPIO35 | GPIO11 | GPIO6 | GPIO19 | GPIO25 |
* +--------------+---------+-------+----------+----------+----------+----------+----------+
* | DO (MISO) | GPIO12 | GPIO19| GPIO37 | GPIO13 | GPIO5 | GPIO20 | GPIO11 |
* +--------------+---------+-------+----------+----------+----------+----------+----------+
* | SCK (SCLK) | GPIO14 | GPIO18| GPIO36 | GPIO12 | GPIO4 | GPIO21 | GPIO10 |
* +--------------+---------+-------+----------+----------+----------+----------+----------+
*
* For more info see file README.md in this library or on URL:
* https://github.com/espressif/arduino-esp32/tree/master/libraries/SD
Expand Down Expand Up @@ -208,9 +208,10 @@ void setup(){

#ifdef REASSIGN_PINS
SPI.begin(sck, miso, mosi, cs);
#endif
//if(!SD.begin(cs)){ //Change to this function to manually change CS pin
if(!SD.begin(cs)){
#else
if(!SD.begin()){
#endif
Serial.println("Card Mount Failed");
return;
}
Expand Down