diff --git a/.github/workflows/ZeDMD.yml b/.github/workflows/ZeDMD.yml index 843f936..7e31612 100644 --- a/.github/workflows/ZeDMD.yml +++ b/.github/workflows/ZeDMD.yml @@ -40,7 +40,7 @@ jobs: needs: [ version ] strategy: matrix: - 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'] + panels: ['128x32', '256x64', '128x64', 'S3-N16R8_128x32', 'S3-N16R8_256x64', 'S3-N16R8_128x64', 'LilygoS3Amoled_128x32', 'LilygoS3Amoled_128x32_wifi', 'AdafruitMatrixPortalS3_128x32', 'AdafruitMatrixPortalS3_256x64', 'pico_128x32', 'pico_256x64', 'pico2_128x32', 'pico2_256x64'] name: ZeDMD ${{ matrix.panels }} @@ -76,7 +76,7 @@ jobs: 0x210000 .pio/build/${{ matrix.panels }}/littlefs.bin cp .pio/build/${{ matrix.panels }}/firmware.elf firmware.elf - - 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') + - 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_128x32' || matrix.panels == 'AdafruitMatrixPortalS3_256x64') name: Build ZeDMD S3 run: | pio run -e ${{ matrix.panels }} @@ -147,6 +147,12 @@ jobs: cd ../ZeDMD-LilygoS3Amoled_128x32_wifi echo "${{ needs.version.outputs.tag }}" > version.txt zip ../ZeDMD-LilygoS3Amoled_128x32_wifi.zip ZeDMD.bin firmware.elf version.txt + cd ../ZeDMD-AdafruitMatrixPortalS3_128x32 + echo "${{ needs.version.outputs.tag }}" > version.txt + zip ../ZeDMD-AdafruitMatrixPortalS3_128x32.zip ZeDMD.bin firmware.elf version.txt + cd ../ZeDMD-AdafruitMatrixPortalS3_256x64 + echo "${{ needs.version.outputs.tag }}" > version.txt + zip ../ZeDMD-AdafruitMatrixPortalS3_256x64.zip ZeDMD.bin firmware.elf version.txt cd ../ZeDMD-pico_128x32 echo "${{ needs.version.outputs.tag }}" > version.txt zip ../ZeDMD-pico_128x32.zip firmware.uf2 firmware-update.uf2 version.txt @@ -174,6 +180,8 @@ jobs: ZeDMD-S3-N16R8_128x64.zip ZeDMD-LilygoS3Amoled_128x32.zip ZeDMD-LilygoS3Amoled_128x32_wifi.zip + ZeDMD-AdafruitMatrixPortalS3_128x32.zip + ZeDMD-AdafruitMatrixPortalS3_256x64.zip ZeDMD-pico_128x32.zip ZeDMD-pico_256x64.zip ZeDMD-pico2_128x32.zip diff --git a/README.md b/README.md index 07ab345..ff60537 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ A full tutorial of its installation is available in [English](https://www.pincab * ESP32-S3-DevKitC-1-N16R8 * original ESP32 with CP2102 USB-to-serial converter * original ESP32 with CH340 USB-to-serial converter +* Adafruit MatrixPortal S3 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. diff --git a/platformio.ini b/platformio.ini index 5bd69bd..3e5abf2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -124,6 +124,35 @@ build_flags = ${esp32.build_flags} ;-DARDUINO_USB_CDC_ON_BOOT=1 ;//Leave this for debugging -DDISPLAY_RM67162_AMOLED=1 +[env:AdafruitMatrixPortalS3_128x32] +extends = esp32 +board = adafruit_matrixportal_esp32s3 +lib_deps = ${esp32.lib_deps} + https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.13 + https://github.com/adafruit/Adafruit_NeoPixel#1.12.4 + https://github.com/kitesurfer1404/WS2812FX#v1.4.5 +build_flags = ${esp32.build_flags} + -DARDUINO_USB_MODE=1 + -DDISPLAY_LED_MATRIX=1 + -DPIXEL_COLOR_DEPTH_BITS=8 +build_unflags = + -DARDUINO_EVENT_RUNNING_CORE=0 + +[env:AdafruitMatrixPortalS3_256x64] +extends = esp32 +board = adafruit_matrixportal_esp32s3 +lib_deps = ${esp32.lib_deps} + https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA#3.0.13 + https://github.com/adafruit/Adafruit_NeoPixel#1.12.4 + https://github.com/kitesurfer1404/WS2812FX#v1.4.5 +build_flags = ${esp32.build_flags} + -DARDUINO_USB_MODE=1 + -DDISPLAY_LED_MATRIX=1 + -DPIXEL_COLOR_DEPTH_BITS=8 + -DZEDMD_HD=1 +build_unflags = + -DARDUINO_EVENT_RUNNING_CORE=0 + [pico] platform = https://github.com/mkalkbrenner/platform-raspberrypi#issue-112 framework = arduino diff --git a/src/displays/Esp32LedMatrix.h b/src/displays/Esp32LedMatrix.h index e8d2b46..ba55ad2 100644 --- a/src/displays/Esp32LedMatrix.h +++ b/src/displays/Esp32LedMatrix.h @@ -16,6 +16,21 @@ #define LAT_PIN 40 #define OE_PIN 2 #define CLK_PIN 41 +#elif defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) +#define R1_PIN 42 +#define G1_PIN 41 +#define B1_PIN 40 +#define R2_PIN 38 +#define G2_PIN 39 +#define B2_PIN 37 +#define A_PIN 45 +#define B_PIN 36 +#define C_PIN 48 +#define D_PIN 35 +#define E_PIN 21 +#define LAT_PIN 47 +#define OE_PIN 14 +#define CLK_PIN 2 #else // Pinout derived from ESP32-HUB75-MatrixPanel-I2S-DMA.h #define R1_PIN 25 diff --git a/src/main.cpp b/src/main.cpp index faf44c0..73e6125 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,7 +37,9 @@ #endif // Specific improvements and #define for the ESP32 S3 series -#if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) +#if defined(ARDUINO_ESP32_S3_N16R8) || \ + defined(DISPLAY_RM67162_AMOLED) || \ + defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) #include "S3Specific.h" #endif #ifndef PICO_BUILD @@ -69,7 +71,7 @@ #define BC 2 #ifdef SPEAKER_LIGHTS -#ifdef ARDUINO_ESP32_S3_N16R8 +#ifdef ARDUINO_ESP32_S3_N16R8 || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) #define SPEAKER_LIGHTS_LEFT_PIN 9 // Left speaker LED strip #define SPEAKER_LIGHTS_RIGHT_PIN 10 // Right speaker LED strip #elif defined(DMDREADER) @@ -1217,12 +1219,12 @@ uint8_t HandleData(uint8_t *pData, size_t len) { response[N_INTERMEDIATE_CTR_CHARS + 18] = 0; #endif #if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \ - defined(PICO_BUILD) + defined(PICO_BUILD) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) response[N_INTERMEDIATE_CTR_CHARS + 18] += 0b00000010; #endif response[N_INTERMEDIATE_CTR_CHARS + 19] = shortId & 0xff; response[N_INTERMEDIATE_CTR_CHARS + 20] = (shortId >> 8) & 0xff; -#if defined(ARDUINO_ESP32_S3_N16R8) +#if defined(ARDUINO_ESP32_S3_N16R8) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) response[N_INTERMEDIATE_CTR_CHARS + 21] = 1; // ESP32 S3 #elif defined(DISPLAY_RM67162_AMOLED) response[N_INTERMEDIATE_CTR_CHARS + 21] = 2; // ESP32 S3 with diff --git a/src/main.h b/src/main.h index 0b84fa7..adcea99 100644 --- a/src/main.h +++ b/src/main.h @@ -45,7 +45,7 @@ #endif #if defined(ARDUINO_ESP32_S3_N16R8) || defined(DISPLAY_RM67162_AMOLED) || \ - defined(PICO_BUILD) + defined(PICO_BUILD) || defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) // USB CDC #define SERIAL_BAUD 115200 #define USB_PACKAGE_SIZE 512 @@ -63,6 +63,9 @@ #define DOWN_BUTTON_PIN 45 #define FORWARD_BUTTON_PIN 48 #define BACKWARD_BUTTON_PIN 47 +#elif defined(ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3) +#define UP_BUTTON_PIN 7 +#define FORWARD_BUTTON_PIN 6 #elif defined(PICO_BUILD) #define UP_BUTTON_PIN 27 #define DOWN_BUTTON_PIN 28 diff --git a/src/transports/usb_transport.cpp b/src/transports/usb_transport.cpp index 573168c..1fa7782 100644 --- a/src/transports/usb_transport.cpp +++ b/src/transports/usb_transport.cpp @@ -45,8 +45,10 @@ void UsbTransport::Task_ReadSerial(void* pvParameters) { tud_cdc_set_rx_buffer_size(usbPackageSize + 128); #else Serial.setRxBufferSize(usbPackageSize + 128); +#ifndef ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3 Serial.setTxBufferSize(64); #endif +#endif #if (defined(ARDUINO_USB_MODE) && ARDUINO_USB_MODE == 1) // S3 USB CDC. The actual baud rate doesn't matter. Serial.begin(115200);