Skip to content

Commit d097ee3

Browse files
committed
Add support for the Adafruit Matrix Portal ESP32-S3 board.
1 parent 1a1af86 commit d097ee3

File tree

7 files changed

+49
-7
lines changed

7 files changed

+49
-7
lines changed

.github/workflows/ZeDMD.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
needs: [ version ]
4141
strategy:
4242
matrix:
43-
panels: ['128x32', '256x64', '128x64', 'S3-N16R8_128x32', 'S3-N16R8_256x64', 'S3-N16R8_128x64', 'LilygoS3Amoled_128x32', 'LilygoS3Amoled_128x32_wifi', 'pico_128x32', 'pico_256x64', 'pico2_128x32', 'pico2_256x64']
43+
panels: ['128x32', '256x64', '128x64', 'S3-N16R8_128x32', 'S3-N16R8_256x64', 'S3-N16R8_128x64', 'LilygoS3Amoled_128x32', 'LilygoS3Amoled_128x32_wifi', 'AdafruitMatrixPortalS3_256x64', 'pico_128x32', 'pico_256x64', 'pico2_128x32', 'pico2_256x64']
4444

4545
name: ZeDMD ${{ matrix.panels }}
4646

@@ -76,7 +76,7 @@ jobs:
7676
0x210000 .pio/build/${{ matrix.panels }}/littlefs.bin
7777
cp .pio/build/${{ matrix.panels }}/firmware.elf firmware.elf
7878
79-
- if: (matrix.panels == 'S3-N16R8_128x32' || matrix.panels == 'S3-N16R8_256x64' || matrix.panels == 'S3-N16R8_128x64' || matrix.panels == 'S3-N16R8_128x32_UART' || matrix.panels == 'S3-N16R8_256x64_UART' || matrix.panels == 'S3-N16R8_128x64_UART' || matrix.panels == 'LilygoS3Amoled_128x32' || matrix.panels == 'LilygoS3Amoled_128x32_wifi')
79+
- if: (matrix.panels == 'S3-N16R8_128x32' || matrix.panels == 'S3-N16R8_256x64' || matrix.panels == 'S3-N16R8_128x64' || matrix.panels == 'S3-N16R8_128x32_UART' || matrix.panels == 'S3-N16R8_256x64_UART' || matrix.panels == 'S3-N16R8_128x64_UART' || matrix.panels == 'LilygoS3Amoled_128x32' || matrix.panels == 'LilygoS3Amoled_128x32_wifi' || matrix.panels == 'AdafruitMatrixPortalS3_256x64')
8080
name: Build ZeDMD S3
8181
run: |
8282
pio run -e ${{ matrix.panels }}
@@ -147,6 +147,9 @@ jobs:
147147
cd ../ZeDMD-LilygoS3Amoled_128x32_wifi
148148
echo "${{ needs.version.outputs.tag }}" > version.txt
149149
zip ../ZeDMD-LilygoS3Amoled_128x32_wifi.zip ZeDMD.bin firmware.elf version.txt
150+
cd ../ZeDMD-AdafruitMatrixPortalS3_256x64
151+
echo "${{ needs.version.outputs.tag }}" > version.txt
152+
zip ../ZeDMD-AdafruitMatrixPortalS3_256x64.zip ZeDMD.bin firmware.elf version.txt
150153
cd ../ZeDMD-pico_128x32
151154
echo "${{ needs.version.outputs.tag }}" > version.txt
152155
zip ../ZeDMD-pico_128x32.zip firmware.uf2 firmware-update.uf2 version.txt
@@ -174,6 +177,7 @@ jobs:
174177
ZeDMD-S3-N16R8_128x64.zip
175178
ZeDMD-LilygoS3Amoled_128x32.zip
176179
ZeDMD-LilygoS3Amoled_128x32_wifi.zip
180+
ZeDMD-AdafruitMatrixPortalS3_256x64.zip
177181
ZeDMD-pico_128x32.zip
178182
ZeDMD-pico_256x64.zip
179183
ZeDMD-pico2_128x32.zip

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ A full tutorial of its installation is available in [English](https://www.pincab
2222
* ESP32-S3-DevKitC-1-N16R8
2323
* original ESP32 with CP2102 USB-to-serial converter
2424
* original ESP32 with CH340 USB-to-serial converter
25+
* Adafruit MatrixPortal S3
2526

2627
For a new build, the ESP32 S3 is recommended. It provides more memory which is used for smoother rendering and higher color depth. And it provides a native USB interface which allows higher data transfer rates.
2728

platformio.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,21 @@ build_flags = ${esp32.build_flags}
124124
;-DARDUINO_USB_CDC_ON_BOOT=1 ;//Leave this for debugging
125125
-DDISPLAY_RM67162_AMOLED=1
126126

127+
[env:AdafruitMatrixPortalS3_256x64]
128+
extends = esp32
129+
board = adafruit_matrixportal_esp32s3
130+
lib_deps = ${esp32.lib_deps}
131+
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.13
132+
https://github.com/adafruit/Adafruit_NeoPixel#1.12.4
133+
https://github.com/kitesurfer1404/WS2812FX#v1.4.5
134+
build_flags = ${esp32.build_flags}
135+
-DARDUINO_USB_MODE=1
136+
-DDISPLAY_LED_MATRIX=1
137+
-DPIXEL_COLOR_DEPTH_BITS=8
138+
-DZEDMD_HD=1
139+
build_unflags =
140+
-DARDUINO_EVENT_RUNNING_CORE=0
141+
127142
[pico]
128143
platform = https://github.com/mkalkbrenner/platform-raspberrypi#issue-112
129144
framework = arduino

src/displays/Esp32LedMatrix.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@
1616
#define LAT_PIN 40
1717
#define OE_PIN 2
1818
#define CLK_PIN 41
19+
#elif defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
20+
#define R1_PIN 42
21+
#define G1_PIN 41
22+
#define B1_PIN 40
23+
#define R2_PIN 38
24+
#define G2_PIN 39
25+
#define B2_PIN 37
26+
#define A_PIN 45
27+
#define B_PIN 36
28+
#define C_PIN 48
29+
#define D_PIN 35
30+
#define E_PIN 21
31+
#define LAT_PIN 47
32+
#define OE_PIN 14
33+
#define CLK_PIN 2
1934
#else
2035
// Pinout derived from ESP32-HUB75-MatrixPanel-I2S-DMA.h
2136
#define R1_PIN 25

src/main.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
#endif
3838

3939
// Specific improvements and #define for the ESP32 S3 series
40-
#if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED)
40+
#if defined(ARDUINO_ESP32_S3_N16R8) || \
41+
defined(DISPLAY_RM67162_AMOLED) || \
42+
defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
4143
#include "S3Specific.h"
4244
#endif
4345
#ifndef PICO_BUILD
@@ -69,7 +71,7 @@
6971
#define BC 2
7072

7173
#ifdef SPEAKER_LIGHTS
72-
#ifdef ARDUINO_ESP32_S3_N16R8
74+
#ifdef ARDUINO_ESP32_S3_N16R8 || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
7375
#define SPEAKER_LIGHTS_LEFT_PIN 9 // Left speaker LED strip
7476
#define SPEAKER_LIGHTS_RIGHT_PIN 10 // Right speaker LED strip
7577
#elif defined(DMDREADER)
@@ -1217,12 +1219,12 @@ uint8_t HandleData(uint8_t *pData, size_t len) {
12171219
response[N_INTERMEDIATE_CTR_CHARS + 18] = 0;
12181220
#endif
12191221
#if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \
1220-
defined(PICO_BUILD)
1222+
defined(PICO_BUILD) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
12211223
response[N_INTERMEDIATE_CTR_CHARS + 18] += 0b00000010;
12221224
#endif
12231225
response[N_INTERMEDIATE_CTR_CHARS + 19] = shortId & 0xff;
12241226
response[N_INTERMEDIATE_CTR_CHARS + 20] = (shortId >> 8) & 0xff;
1225-
#if defined(ARDUINO_ESP32_S3_N16R8)
1227+
#if defined(ARDUINO_ESP32_S3_N16R8) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
12261228
response[N_INTERMEDIATE_CTR_CHARS + 21] = 1; // ESP32 S3
12271229
#elif defined(DISPLAY_RM67162_AMOLED)
12281230
response[N_INTERMEDIATE_CTR_CHARS + 21] = 2; // ESP32 S3 with

src/main.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#endif
4646

4747
#if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \
48-
defined(PICO_BUILD)
48+
defined(PICO_BUILD) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
4949
// USB CDC
5050
#define SERIAL_BAUD 115200
5151
#define USB_PACKAGE_SIZE 512
@@ -63,6 +63,9 @@
6363
#define DOWN_BUTTON_PIN 45
6464
#define FORWARD_BUTTON_PIN 48
6565
#define BACKWARD_BUTTON_PIN 47
66+
#elif defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3)
67+
#define UP_BUTTON_PIN 7
68+
#define FORWARD_BUTTON_PIN 6
6669
#elif defined(PICO_BUILD)
6770
#define UP_BUTTON_PIN 27
6871
#define DOWN_BUTTON_PIN 28

src/transports/usb_transport.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ void UsbTransport::Task_ReadSerial(void* pvParameters) {
4545
tud_cdc_set_rx_buffer_size(usbPackageSize + 128);
4646
#else
4747
Serial.setRxBufferSize(usbPackageSize + 128);
48+
#ifndef ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3
4849
Serial.setTxBufferSize(64);
4950
#endif
51+
#endif
5052
#if (defined(ARDUINO_USB_MODE) && ARDUINO_USB_MODE == 1)
5153
// S3 USB CDC. The actual baud rate doesn't matter.
5254
Serial.begin(115200);

0 commit comments

Comments
 (0)