From 871b2ba237b7f63348d6a9127939a53c66113cfc Mon Sep 17 00:00:00 2001 From: wanlei Date: Mon, 13 Feb 2023 15:44:12 +0800 Subject: [PATCH] spi: simplify readme description of spi examples --- .../spi_master/hd_eeprom/README.md | 22 +++++++++---------- examples/peripherals/spi_slave/README.md | 18 ++++++++------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/examples/peripherals/spi_master/hd_eeprom/README.md b/examples/peripherals/spi_master/hd_eeprom/README.md index ee40b3f014..3a741b363e 100644 --- a/examples/peripherals/spi_master/hd_eeprom/README.md +++ b/examples/peripherals/spi_master/hd_eeprom/README.md @@ -9,18 +9,18 @@ ### Connections -For different chip and host used, the connections may be different. +For different chip and host used, the connections may be different. Here show a example diagram of hardware connection, you can freely change the GPIO defined in start of `main/spi_eeprom_main.c` and change the hardware relatively. -| | ESP32 | ESP32 | ESP32S2 | ESP32C2 | ESP32C3 | ESP32C6 | ESP32S3 | ESP32H2 | -| ---- | ----- | ----- | ------- | ------- | ------- | ------- | ------- | ------- | -| Host | SPI1 | HSPI | SPI2 | SPI2 | SPI2 | SPI2 | SPI2 | SPI2 | -| VCC | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V | -| GND | GND | GND | GND | GND | GND | GND | GND | GND | -| DO | 7 | 18 | 37 | 2 | 2 | 2 | 13 | 0 | -| DI | 8 | 23 | 35 | 7 | 7 | 7 | 11 | 5 | -| SK | 6 | 19 | 36 | 6 | 6 | 6 | 12 | 4 | -| CS | 13 | 13 | 34 | 10 | 10 | 10 | 10 | 1 | -| ORG | GND | GND | GND | GND | GND | GND | GND | GND | +| | ESP32 | +| ---- | ----- | +| Host | SPI1 | +| VCC | 3.3V | +| GND | GND | +| DO | 7 | +| DI | 8 | +| SK | 6 | +| CS | 13 | +| ORG | GND | ### Notes diff --git a/examples/peripherals/spi_slave/README.md b/examples/peripherals/spi_slave/README.md index 3083e5643f..c094825d32 100644 --- a/examples/peripherals/spi_slave/README.md +++ b/examples/peripherals/spi_slave/README.md @@ -5,15 +5,17 @@ These two projects illustrate the SPI Slave driver. They're supposed to be flashed into two separate Espressif chips connected to eachother using the SPI pins defined in app_main.c. Once connected and flashed, they will use the spi master and spi slave driver to communicate with eachother. The example also includes a handshaking line to allow the master to only poll the slave when it is actually ready to parse a transaction. +For different chip and host used, the connections may be different. Here show a example diagram of hardware connection, you can freely change the GPIO settings by editing defines in the top of `main/app_main.c` in the master/slave source code. and change the hardware relatively. + The default GPIOs used in the example are the following: -| Signal | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C6 | ESP32-H2 | -|-----------|--------|----------|----------|----------|----------|----------| -| Handshake | GPIO2 | GPIO2 | GPIO2 | GPIO3 | GPIO15 | GPIO2 | -| MOSI | GPIO12 | GPIO12 | GPIO11 | GPIO7 | GPIO20 | GPIO5 | -| MISO | GPIO13 | GPIO13 | GPIO13 | GPIO2 | GPIO19 | GPIO0 | -| SCLK | GPIO15 | GPIO15 | GPIO12 | GPIO6 | GPIO18 | GPIO4 | -| CS | GPIO14 | GPIO14 | GPIO10 | GPIO10 | GPIO9 | GPIO1 | +| Signal | ESP32 | +|-----------|--------| +| Handshake | GPIO2 | +| MOSI | GPIO12 | +| MISO | GPIO13 | +| SCLK | GPIO15 | +| CS | GPIO14 | Please run wires between the following GPIOs between the slave and master to make the example function: @@ -26,4 +28,4 @@ Please run wires between the following GPIOs between the slave and master to mak | SCLK | SCLK | | CS | CS | -Be aware that the example by default uses lines normally reserved for JTAG on ESP32. If this is an issue, either because of hardwired JTAG hardware or because of the need to do JTAG debugging, feel free to change the GPIO settings by editing defines in the top of main.c in the master/slave source code. +Be aware that the example by default uses lines normally reserved for JTAG on ESP32. If this is an issue, either because of hardwired JTAG hardware or because of the need to do JTAG debugging, feel free to change the GPIO settings.