Skip to content

Commit 44b2a63

Browse files
authored
SPI (fix): Adds SPI 3 to the ESP32-S2 and adds comments about it
1 parent 4cbce10 commit 44b2a63

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Diff for: cores/esp32/esp32-hal-spi.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ extern "C" {
3131
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32S3
3232
#define FSPI 0
3333
#define HSPI 1
34-
#else
35-
#define FSPI 1 //SPI bus attached to the flash (can use the same data lines but different SS)
36-
#define HSPI 2 //SPI bus normally mapped to pins 12 - 15, but can be matrixed to any pins
37-
#if CONFIG_IDF_TARGET_ESP32
38-
#define VSPI 3 //SPI bus normally attached to pins 5, 18, 19 and 23, but can be matrixed to any pins
39-
#endif
34+
#elif CONFIG_IDF_TARGET_ESP32S2
35+
#define FSPI 1 //SPI 1 bus. ESP32S2: for external memory only (can use the same data lines but different SS)
36+
#define HSPI 2 //SPI 2 bus. ESP32S2: external memory or device - itcan be matrixed to any pins
37+
#define SPI2 2 // Another name for ESP32S2 SPI 2
38+
#define SPI3 3 //SPI 3 bus. ESP32S2: device only - itcan be matrixed to any pins
39+
#elif CONFIG_IDF_TARGET_ESP32
40+
#define FSPI 1 //SPI 1 bus attached to the flash (can use the same data lines but different SS)
41+
#define HSPI 2 //SPI 2 bus normally mapped to pins 12 - 15, but can be matrixed to any pins
42+
#define VSPI 3 //SPI 3 bus normally attached to pins 5, 18, 19 and 23, but can be matrixed to any pins
4043
#endif
4144

4245
// This defines are not representing the real Divider of the ESP32

0 commit comments

Comments
 (0)