Matched pin numbers in doco to numbers in variants files (#9422)

* Matched pin numbers in doco to numbers in variants files

* Non-breaking dashes

* Changed SD examples to make REASSIGN_PINS more transparent. Fixes #9082

---------

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
This commit is contained in:
lbernstone 2024-03-27 00:07:12 -10:00 committed by GitHub
parent 91c9ecd3c4
commit 654aeada0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 34 additions and 32 deletions

View File

@ -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 | ESP32S3 | ESP32C3 | ESP32C6 | ESP32H2 |
|--------------|---------|-------|----------|----------|----------|----------|----------|
| 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:

View File

@ -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 | ESP32S3 | ESP32C3 | ESP32C6 | ESP32H2 |
* +==============+=========+=======+==========+==========+==========+==========+==========+
* | 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
@ -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;
}

View File

@ -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 | ESP32S3 | ESP32C3 | ESP32C6 | ESP32H2 |
* +==============+=========+=======+==========+==========+==========+==========+==========+
* | 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
@ -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;
}