Skip to content

Commit 7a79e18

Browse files
committed
ESP32-S3 ready
1 parent a4ff0f1 commit 7a79e18

File tree

3 files changed

+127
-40
lines changed

3 files changed

+127
-40
lines changed

Diff for: esp32devS3.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32s3_out.ld",
5+
"partitions": "default_8MB.csv"
6+
},
7+
"core": "esp32",
8+
"extra_flags": [
9+
"-DARDUINO_TINYS3",
10+
"-DARDUINO_RUNNING_CORE=1",
11+
"-DARDUINO_EVENT_RUNNING_CORE=1"
12+
],
13+
"f_cpu": "240000000L",
14+
"f_flash": "80000000L",
15+
"flash_mode": "qio",
16+
"hwids": [
17+
[
18+
"0X303A",
19+
"0x80D0"
20+
]
21+
],
22+
"mcu": "esp32s3",
23+
"variant": "um_tinys3"
24+
},
25+
"connectivity": [
26+
"wifi"
27+
],
28+
"debug": {
29+
"openocd_target": "esp32s3.cfg"
30+
},
31+
"frameworks": [
32+
"arduino"
33+
],
34+
"name": "Unexpected Maker TinyS3",
35+
"upload": {
36+
"flash_size": "8MB",
37+
"maximum_ram_size": 327680,
38+
"maximum_size": 8388608,
39+
"use_1200bps_touch": true,
40+
"wait_for_upload_port": true,
41+
"require_upload_port": true,
42+
"speed": 460800
43+
},
44+
"url": "https://unexpectedmaker.com/shop/ttinys3-esp32s3",
45+
"vendor": "Unexpected Maker"
46+
}
47+

Diff for: platformio.ini

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
;platform = https://github.com/platformio/platform-espressif32.git#v4.2.0
1313
platform = https://github.com/platformio/platform-espressif32.git#v4.4.0
1414

15-
board = esp32dev
16-
;board = um_tinys3
15+
board = esp32dev ;chipmodel ESP32
16+
;board = um_tinys3 ;chipmodel ESP32S3
1717

1818
board_build.f_cpu = 240000000L
1919
board_build.flash_size=4MB
@@ -55,3 +55,6 @@ build_flags =
5555
-DARDUINO_RUNNING_CORE=1 ; Arduino Runs On Core (setup, loop)
5656
-DARDUINO_EVENT_RUNNING_CORE=1 ; Events Run On Core
5757

58+
build_unflags =
59+
-DARDUINO_USB_CDC_ON_BOOT=0 ; traditional log
60+
; -DBOARD_HAS_PSRAM

Diff for: src/common.h

+75-38
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
#define _SSID "mySSID" // Your WiFi credentials here
77
#define _PW "myWiFiPassword"
88
#define TZName "CET-1CEST,M3.5.0,M10.5.0/3" // Timezone (more TZNames in "rtime.cpp")
9-
#define DECODER 1 // (0)VS1053 , (1)MAX98357A PCM5102A... (2)AC101 (3)ES8388 (4)WM8978
10-
#define TFT_CONTROLLER 2 // (0)ILI9341, (1)HX8347D, (2)ILI9486a, (3)ILI9486b, (4)ILI9488
9+
#define DECODER 0 // (0)VS1053 , (1)MAX98357A PCM5102A... (2)AC101 (3)ES8388 (4)WM8978
10+
#define TFT_CONTROLLER 4 // (0)ILI9341, (1)HX8347D, (2)ILI9486a, (3)ILI9486b, (4)ILI9488
1111
#define DISPLAY_INVERSION 0 // (0) off (1) on
1212
#define TFT_FREQUENCY 40000000 // 27000000, 40000000, 80000000
1313
#define TFT_ROTATION 3 // 1 or 3 (landscape)
14-
#define TP_VERSION 3 // (0)ILI9341, (1)ILI9341RPI, (2)HX8347D, (3)ILI9486, (4)ILI9488
14+
#define TP_VERSION 4 // (0)ILI9341, (1)ILI9341RPI, (2)HX8347D, (3)ILI9486, (4)ILI9488
1515
#define TP_ROTATION 3 // 1 or 3 (landscape)
1616
#define AUDIOTASK_CORE 1 // 0 or 1
1717
#define AUDIOTASK_PRIO 2 // 0 ... 24 Priority of the Task (0...configMAX_PRIORITIES -1)
@@ -39,38 +39,75 @@
3939
#include "ES8388.h"
4040
#include "WM8978.h"
4141

42-
// Digital I/O used
43-
#define TFT_CS 22
44-
#define TFT_DC 21
45-
#define TFT_BL 32 // at -1 the brightness menu is not displayed
46-
#define TP_IRQ 39 // VN
47-
#define TP_CS 5
48-
#define SD_MMC_D0 2 // cannot be changed
49-
#define SD_MMC_CLK 14 // cannot be changed
50-
#define SD_MMC_CMD 15 // cannot be changed
51-
#define IR_PIN 35
52-
#define TFT_MOSI 23 // TFT and TP (VSPI)
53-
#define TFT_MISO 19 // TFT and TP (VSPI)
54-
#define TFT_SCK 18 // TFT and TP (VSPI)
55-
#if DECODER == 0
56-
#define VS1053_CS 33
57-
#define VS1053_DCS 4
58-
#define VS1053_DREQ 36
59-
#define VS1053_MOSI 13 // VS1053 (HSPI)
60-
#define VS1053_MISO 34 // VS1053 (HSPI)
61-
#define VS1053_SCK 12 // VS1053 (HSPI) (sometimes we need a 1k resistor against ground)
62-
#else
63-
#define I2S_DOUT 25
64-
#define I2S_DIN -1 // pin not used
65-
#define I2S_BCLK 27
66-
#define I2S_LRC 26
67-
#define I2S_MCLK 0 // mostly not used
42+
#ifdef CONFIG_IDF_TARGET_ESP32
43+
// Digital I/O used
44+
#define TFT_CS 22
45+
#define TFT_DC 21
46+
#define TFT_BL 32 // at -1 the brightness menu is not displayed
47+
#define TP_IRQ 39 // VN
48+
#define TP_CS 5
49+
#define SD_MMC_D0 2 // cannot be changed
50+
#define SD_MMC_CLK 14 // cannot be changed
51+
#define SD_MMC_CMD 15 // cannot be changed
52+
#define IR_PIN 35
53+
#define TFT_MOSI 23 // TFT and TP (VSPI)
54+
#define TFT_MISO 19 // TFT and TP (VSPI)
55+
#define TFT_SCK 18 // TFT and TP (VSPI)
56+
#if DECODER == 0
57+
#define VS1053_CS 33
58+
#define VS1053_DCS 4
59+
#define VS1053_DREQ 36
60+
#define VS1053_MOSI 13 // VS1053 (HSPI)
61+
#define VS1053_MISO 34 // VS1053 (HSPI)
62+
#define VS1053_SCK 12 // VS1053 (HSPI) (sometimes we need a 1k resistor against ground)
63+
#else
64+
#define I2S_DOUT 25
65+
#define I2S_DIN -1 // pin not used
66+
#define I2S_BCLK 27
67+
#define I2S_LRC 26
68+
#define I2S_MCLK 0 // mostly not used
69+
#endif
70+
#define I2C_DATA -1 // some DACs are controlled via I2C
71+
#define I2C_CLK -1
72+
#define SD_DETECT -1 // some pins on special boards: Lyra, Olimex, A1S ...
73+
#define HP_DETECT -1
74+
#define AMP_ENABLED -1
75+
#endif
76+
77+
#ifdef CONFIG_IDF_TARGET_ESP32S3
78+
// Digital I/O used
79+
#define TFT_CS 8
80+
#define TFT_DC 12
81+
#define TFT_BL 10 // at -1 the brightness menu is not displayed
82+
#define TP_IRQ 39
83+
#define TP_CS 15
84+
#define SD_MMC_D0 11
85+
#define SD_MMC_CLK 13
86+
#define SD_MMC_CMD 14
87+
#define IR_PIN 33
88+
#define TFT_MOSI 18 // TFT and TP (FSPI)
89+
#define TFT_MISO 2 // TFT and TP (FSPI)
90+
#define TFT_SCK 17 // TFT and TP (FSPI)
91+
#if DECODER == 0
92+
#define VS1053_CS 48
93+
#define VS1053_DCS 16
94+
#define VS1053_DREQ 38
95+
#define VS1053_MOSI 20 // VS1053 (HSPI)
96+
#define VS1053_MISO 19 // VS1053 (HSPI)
97+
#define VS1053_SCK 21 // VS1053 (HSPI) (sometimes we need a 1k resistor against ground)
98+
#else
99+
#define I2S_DOUT 9
100+
#define I2S_DIN -1
101+
#define I2S_BCLK 3
102+
#define I2S_LRC 1
103+
#define I2S_MCLK -1
104+
#endif
105+
#define I2C_DATA -1 // some DACs are controlled via I2C
106+
#define I2C_CLK -1
107+
#define SD_DETECT -1 // some pins on special boards: Lyra, Olimex, A1S ...
108+
#define HP_DETECT -1
109+
#define AMP_ENABLED -1
68110
#endif
69-
#define I2C_DATA -1 // some DACs are controlled via I2C
70-
#define I2C_CLK -1
71-
#define SD_DETECT -1 // some pins on special boards: Lyra, Olimex, A1S ...
72-
#define HP_DETECT -1
73-
#define AMP_ENABLED -1
74111

75112
/**********************************************************************************************************************/
76113
// output on serial terminal
@@ -173,7 +210,7 @@ boolean audioIsRunning();
173210

174211

175212
// PINS for ESP32S3 (suggestion)
176-
213+
177214
// // Digital I/O used
178215
// #define TFT_CS 7
179216
// #define TFT_DC 12
@@ -184,9 +221,9 @@ boolean audioIsRunning();
184221
// #define SD_MMC_CLK 13
185222
// #define SD_MMC_CMD 14
186223
// #define IR_PIN 35
187-
// #define SPI_MOSI 18 // TFT and TP (FSPI)
188-
// #define SPI_MISO 2 // TFT and TP (FSPI)
189-
// #define SPI_SCK 17 // TFT and TP (FSPI)
224+
// #define TFT_MOSI 18 // TFT and TP (FSPI)
225+
// #define TFT_MISO 2 // TFT and TP (FSPI)
226+
// #define TFT_SCK 17 // TFT and TP (FSPI)
190227

191228

192229
// #define I2S_DOUT 9

0 commit comments

Comments
 (0)