diff --git a/examples/peripherals/spi_master/hd_eeprom/README.md b/examples/peripherals/spi_master/hd_eeprom/README.md index 40b533d9e3..870f58dc89 100644 --- a/examples/peripherals/spi_master/hd_eeprom/README.md +++ b/examples/peripherals/spi_master/hd_eeprom/README.md @@ -8,16 +8,16 @@ For different chip and host used, the connections may be different. -| | ESP32 | ESP32 | ESP32S2 | ESP32C3 | -| ---- | ----- | ----- | ------- | ------- | -| Host | SPI1 | HSPI | FSPI | SPI2 | -| VCC | 3.3V | 3.3V | 3.3V | 3.3V | -| GND | GND | GND | GND | GND | -| DO | 7 | 18 | 37 | 2 | -| DI | 8 | 23 | 35 | 7 | -| SK | 6 | 19 | 36 | 6 | -| CS | 13 | 13 | 34 | 10 | -| ORG | GND | GND | GND | GND | +| | ESP32 | ESP32 | ESP32S2 | ESP32C3 | ESP32S3 | +| ---- | ----- | ----- | ------- | ------- | ------- | +| Host | SPI1 | HSPI | FSPI | SPI2 | SPI2 | +| VCC | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V | +| GND | GND | GND | GND | GND | GND | +| DO | 7 | 18 | 37 | 2 | 13 | +| DI | 8 | 23 | 35 | 7 | 11 | +| SK | 6 | 19 | 36 | 6 | 12 | +| CS | 13 | 13 | 34 | 10 | 10 | +| ORG | GND | GND | GND | GND | GND | ### Notes diff --git a/examples/peripherals/spi_master/hd_eeprom/main/spi_eeprom_main.c b/examples/peripherals/spi_master/hd_eeprom/main/spi_eeprom_main.c index bf16e10404..13f5326c69 100644 --- a/examples/peripherals/spi_master/hd_eeprom/main/spi_eeprom_main.c +++ b/examples/peripherals/spi_master/hd_eeprom/main/spi_eeprom_main.c @@ -52,6 +52,14 @@ # define PIN_NUM_MOSI 7 # define PIN_NUM_CLK 6 # define PIN_NUM_CS 10 + +#elif CONFIG_IDF_TARGET_ESP32S3 +# define EEPROM_HOST SPI2_HOST + +# define PIN_NUM_MISO 13 +# define PIN_NUM_MOSI 11 +# define PIN_NUM_CLK 12 +# define PIN_NUM_CS 10 #endif diff --git a/examples/peripherals/spi_slave/receiver/main/app_main.c b/examples/peripherals/spi_slave/receiver/main/app_main.c index 874fdbb50a..0ea85cf207 100644 --- a/examples/peripherals/spi_slave/receiver/main/app_main.c +++ b/examples/peripherals/spi_slave/receiver/main/app_main.c @@ -63,16 +63,20 @@ Pins in use. The SPI Master can use the GPIO mux, so feel free to change these i #define GPIO_SCLK 6 #define GPIO_CS 10 +#elif CONFIG_IDF_TARGET_ESP32S3 +#define GPIO_HANDSHAKE 2 +#define GPIO_MOSI 11 +#define GPIO_MISO 13 +#define GPIO_SCLK 12 +#define GPIO_CS 10 + #endif //CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 #ifdef CONFIG_IDF_TARGET_ESP32 #define RCV_HOST HSPI_HOST -#elif defined CONFIG_IDF_TARGET_ESP32S2 -#define RCV_HOST SPI2_HOST - -#elif defined CONFIG_IDF_TARGET_ESP32C3 +#else #define RCV_HOST SPI2_HOST #endif diff --git a/examples/peripherals/spi_slave/sender/main/app_main.c b/examples/peripherals/spi_slave/sender/main/app_main.c index 7c70cf2799..673bebb3da 100644 --- a/examples/peripherals/spi_slave/sender/main/app_main.c +++ b/examples/peripherals/spi_slave/sender/main/app_main.c @@ -64,16 +64,20 @@ Pins in use. The SPI Master can use the GPIO mux, so feel free to change these i #define GPIO_SCLK 6 #define GPIO_CS 10 +#elif CONFIG_IDF_TARGET_ESP32S3 +#define GPIO_HANDSHAKE 2 +#define GPIO_MOSI 11 +#define GPIO_MISO 13 +#define GPIO_SCLK 12 +#define GPIO_CS 10 + #endif //CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 #ifdef CONFIG_IDF_TARGET_ESP32 #define SENDER_HOST HSPI_HOST -#elif defined CONFIG_IDF_TARGET_ESP32S2 -#define SENDER_HOST SPI2_HOST - -#elif defined CONFIG_IDF_TARGET_ESP32C3 +#else #define SENDER_HOST SPI2_HOST #endif