Skip to content

Commit c19ea73

Browse files
committed
I2S support for S2 and S3; updated default pins
1 parent 5a13725 commit c19ea73

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

libraries/I2S/src/I2S.h

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,39 @@ namespace esp_i2s {
3232
#endif
3333

3434
#ifndef PIN_I2S_FS
35-
#if CONFIG_IDF_TARGET_ESP32S2
36-
#define PIN_I2S_FS 27
35+
#if (CONFIG_IDF_TARGET_ESP32S2 | CONFIG_IDF_TARGET_ESP32S3)
36+
#define PIN_I2S_FS 15
3737
#else
3838
#define PIN_I2S_FS 25
3939
#endif
4040
#endif
4141

4242
#ifndef PIN_I2S_SD
43-
#define PIN_I2S_SD 26
43+
#if CONFIG_IDF_TARGET_ESP32S3
44+
#define PIN_I2S_SD 12
45+
#elif CONFIG_IDF_TARGET_ESP32S2
46+
#define PIN_I2S_SD 33
47+
#else
48+
#define PIN_I2S_SD 26
49+
#endif
4450
#endif
4551

4652
#ifndef PIN_I2S_SD_OUT
47-
#define PIN_I2S_SD_OUT 26
53+
#if CONFIG_IDF_TARGET_ESP32S3
54+
#define PIN_I2S_SD_OUT 12
55+
#elif CONFIG_IDF_TARGET_ESP32S2
56+
#define PIN_I2S_SD_OUT 33
57+
#else
58+
#define PIN_I2S_SD_OUT 26
59+
#endif
4860
#endif
4961

5062
#ifndef PIN_I2S_SD_IN
51-
#define PIN_I2S_SD_IN 35 // Pin 35 is only input!
63+
#if CONFIG_IDF_TARGET_ESP32S2
64+
#define PIN_I2S_SD_IN 21
65+
#else
66+
#define PIN_I2S_SD_IN 35 // Pin 35 is only input!
67+
#endif
5268
#endif
5369

5470
typedef enum {

0 commit comments

Comments
 (0)