Skip to content

Commit

Permalink
Start adding BusI2SClockless
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Jan 26, 2024
1 parent 04ef3f9 commit de616b2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ lib_deps =
fastled/FastLED @ 3.6.0
IRremoteESP8266 @ 2.8.2
makuna/NeoPixelBus @ 2.7.5
https://github.com/hpwit/I2SClocklessVirtualLedDriver.git ; @ 2.1
https://github.com/Aircoookie/ESPAsyncWebServer.git @ ~2.0.7
# ESP-NOW library (includes mandatory QuickDebug library)
; gmag11/QuickESPNow @ 0.6.2
Expand Down
5 changes: 5 additions & 0 deletions wled00/bus_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,9 @@ void BusNetwork::cleanup() {
freeData();
}

BusI2SClockless::BusI2SClockless(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite, bc.count) {

}

//utility to get the approx. memory usage of a given BusConfig
uint32_t BusManager::memUsage(BusConfig &bc) {
Expand Down Expand Up @@ -639,6 +642,8 @@ int BusManager::add(BusConfig &bc) {
busses[numBusses] = new BusDigital(bc, numBusses, colorOrderMap);
} else if (bc.type == TYPE_ONOFF) {
busses[numBusses] = new BusOnOff(bc);
} else if (bc.type == TYPE_I2S) {
busses[numBusses] = new BusI2SClockless(bc);
} else {
busses[numBusses] = new BusPwm(bc);
}
Expand Down
11 changes: 11 additions & 0 deletions wled00/bus_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

#include "const.h"
#include "I2SClocklessVirtualLedDriver.h"


#define GET_BIT(var,bit) (((var)>>(bit))&0x01)
#define SET_BIT(var,bit) ((var)|=(uint16_t)(0x0001<<(bit)))
Expand Down Expand Up @@ -313,6 +315,15 @@ class BusNetwork : public Bus {
bool _broadcastLock;
};

class BusI2SClockless : public Bus {
public:
BusI2SClockless(BusConfig &bc);
~BusI2SClockless() { cleanup(); }
void show() override;
void setPixelColor(uint16_t pix, uint32_t c) override;
void cleanup();
};


class BusManager {
public:
Expand Down
1 change: 1 addition & 0 deletions wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
#define TYPE_UCS8904 29 //first RGBW digital type (hardcoded in busmanager.cpp, memUsage())
#define TYPE_SK6812_RGBW 30
#define TYPE_TM1814 31
#define TYPE_I2S 32
//"Analog" types (40-47)
#define TYPE_ONOFF 40 //binary output (relays etc.; NOT PWM)
#define TYPE_ANALOG_1CH 41 //single channel PWM. Uses value of brightest RGBW channel
Expand Down

0 comments on commit de616b2

Please sign in to comment.