mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spi: simplify readme description of spi examples
This commit is contained in:
parent
a361724a46
commit
871b2ba237
@ -9,18 +9,18 @@
|
|||||||
|
|
||||||
### Connections
|
### 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 |
|
| | ESP32 |
|
||||||
| ---- | ----- | ----- | ------- | ------- | ------- | ------- | ------- | ------- |
|
| ---- | ----- |
|
||||||
| Host | SPI1 | HSPI | SPI2 | SPI2 | SPI2 | SPI2 | SPI2 | SPI2 |
|
| Host | SPI1 |
|
||||||
| VCC | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V |
|
| VCC | 3.3V |
|
||||||
| GND | GND | GND | GND | GND | GND | GND | GND | GND |
|
| GND | GND |
|
||||||
| DO | 7 | 18 | 37 | 2 | 2 | 2 | 13 | 0 |
|
| DO | 7 |
|
||||||
| DI | 8 | 23 | 35 | 7 | 7 | 7 | 11 | 5 |
|
| DI | 8 |
|
||||||
| SK | 6 | 19 | 36 | 6 | 6 | 6 | 12 | 4 |
|
| SK | 6 |
|
||||||
| CS | 13 | 13 | 34 | 10 | 10 | 10 | 10 | 1 |
|
| CS | 13 |
|
||||||
| ORG | GND | GND | GND | GND | GND | GND | GND | GND |
|
| ORG | GND |
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|
||||||
|
@ -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.
|
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:
|
The default GPIOs used in the example are the following:
|
||||||
|
|
||||||
| Signal | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C6 | ESP32-H2 |
|
| Signal | ESP32 |
|
||||||
|-----------|--------|----------|----------|----------|----------|----------|
|
|-----------|--------|
|
||||||
| Handshake | GPIO2 | GPIO2 | GPIO2 | GPIO3 | GPIO15 | GPIO2 |
|
| Handshake | GPIO2 |
|
||||||
| MOSI | GPIO12 | GPIO12 | GPIO11 | GPIO7 | GPIO20 | GPIO5 |
|
| MOSI | GPIO12 |
|
||||||
| MISO | GPIO13 | GPIO13 | GPIO13 | GPIO2 | GPIO19 | GPIO0 |
|
| MISO | GPIO13 |
|
||||||
| SCLK | GPIO15 | GPIO15 | GPIO12 | GPIO6 | GPIO18 | GPIO4 |
|
| SCLK | GPIO15 |
|
||||||
| CS | GPIO14 | GPIO14 | GPIO10 | GPIO10 | GPIO9 | GPIO1 |
|
| CS | GPIO14 |
|
||||||
|
|
||||||
|
|
||||||
Please run wires between the following GPIOs between the slave and master to make the example function:
|
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 |
|
| SCLK | SCLK |
|
||||||
| CS | CS |
|
| 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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user