From 654aeada0a4d88595c31a68c62d339a09794c381 Mon Sep 17 00:00:00 2001 From: lbernstone Date: Wed, 27 Mar 2024 00:07:12 -1000 Subject: [PATCH] Matched pin numbers in doco to numbers in variants files (#9422) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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> --- libraries/SD/README.md | 12 +++++----- libraries/SD/examples/SD_Test/SD_Test.ino | 27 ++++++++++++----------- libraries/SD/examples/SD_time/SD_time.ino | 27 ++++++++++++----------- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/libraries/SD/README.md b/libraries/SD/README.md index 136703c9452..4e0a05ee06d 100644 --- a/libraries/SD/README.md +++ b/libraries/SD/README.md @@ -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 | ESP32‑S2 | 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: diff --git a/libraries/SD/examples/SD_Test/SD_Test.ino b/libraries/SD/examples/SD_Test/SD_Test.ino index 2028f91850c..2d7d5bf1dd4 100644 --- a/libraries/SD/examples/SD_Test/SD_Test.ino +++ b/libraries/SD/examples/SD_Test/SD_Test.ino @@ -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 | ESP32‑S2 | 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 @@ -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; } diff --git a/libraries/SD/examples/SD_time/SD_time.ino b/libraries/SD/examples/SD_time/SD_time.ino index e161bf036e0..79f6edb0952 100644 --- a/libraries/SD/examples/SD_time/SD_time.ino +++ b/libraries/SD/examples/SD_time/SD_time.ino @@ -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 | ESP32‑S2 | 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 @@ -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; }