Skip to content

Commit

Permalink
Add config for MatrixPortal_S3
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Jan 13, 2024
1 parent caf78e5 commit 1ae2f0e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
25 changes: 25 additions & 0 deletions wled00/MatrixHardware_MatrixPortal_S3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#define GPIOPINOUT 99

// ADDX is output directly using GPIO
#define CLKS_DURING_LATCH 0
#define MATRIX_I2S_MODE I2S_PARALLEL_BITS_16
#define MATRIX_DATA_STORAGE_TYPE uint16_t


#define R1_PIN GPIO_NUM_42
#define G1_PIN GPIO_NUM_41
#define B1_PIN GPIO_NUM_40
#define R2_PIN GPIO_NUM_38
#define G2_PIN GPIO_NUM_39
#define B2_PIN GPIO_NUM_37

#define A_PIN GPIO_NUM_45
#define B_PIN GPIO_NUM_36
#define C_PIN GPIO_NUM_48
#define D_PIN GPIO_NUM_35
#define E_PIN GPIO_NUM_21

#define LAT_PIN GPIO_NUM_47
#define OE_PIN GPIO_NUM_14

#define CLK_PIN GPIO_NUM_2
8 changes: 3 additions & 5 deletions wled00/bus_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,6 @@ BusSmartMatrix::BusSmartMatrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh
smartMatrix.addLayer(&backgroundLayer);
smartMatrix.begin();

smartMatrix.setBrightness(50); // TODO - hard code for now

this->buffer = backgroundLayer.backBuffer();

backgroundLayer.swapBuffers(true);
Expand All @@ -505,9 +503,9 @@ void BusSmartMatrix::setPixelColor(uint16_t pix, uint32_t c) {
this->buffer[pix] = rgb24(r, g, b);
}

// void BusSmartMatrix::setBrightness(uint8_t b, bool immediate) {
// this->smartMatrix->setBrightness(b);
// }
void BusSmartMatrix::setBrightness(uint8_t b, bool immediate) {
this->smartMatrix->setBrightness(b);
}
#endif
// ***************************************************************************

Expand Down
10 changes: 5 additions & 5 deletions wled00/bus_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#define BusManager_h

#ifdef WLED_ENABLE_SMARTMATRIX
#ifdef ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3
#include <MatrixHardware_MatrixPortal_S3.h>
#else
#include <MatrixHardware_ESP32_V0.h>
#endif
#include <SmartMatrix.h>
#endif
/*
Expand Down Expand Up @@ -351,14 +355,10 @@ class BusSmartMatrix : public Bus {
return !backgroundLayer->isSwapPending();
}

// void setBrightness(uint8_t b, bool immediate);
void setBrightness(uint8_t b, bool immediate);

// uint8_t getPins(uint8_t* pinArray) {} // todo

uint16_t getLength() {
return _len;
}

void cleanup() {}

~BusSmartMatrix() {
Expand Down

0 comments on commit 1ae2f0e

Please sign in to comment.