Added "invert" and "spimode" options to ws2801, ws2812spi and sk6812spi devices (#172)

* Added "invert" and "spimode" options to ws2801, ws2812spi and sk6812spi devices

* fixed test/TestSpi.cpp

* some coding style wish
This commit is contained in:
penfold42
2016-08-14 03:54:08 +10:00
committed by redPanther
parent 9c27db390d
commit 5a902add81
10 changed files with 61 additions and 29 deletions

View File

@@ -54,7 +54,7 @@ void setColor(char* colorStr)
unsigned ledCnt = 50;
std::vector<ColorRgb> buff(ledCnt, color);
LedDeviceWs2801 ledDevice("/dev/spidev0.0", 40000, 500000);
LedDeviceWs2801 ledDevice("/dev/spidev0.0", 40000, 500000, 0, 0);
ledDevice.open();
ledDevice.write(buff);
}
@@ -68,7 +68,7 @@ void doCircle()
unsigned ledCnt = 50;
std::vector<ColorRgb> data(ledCnt, ColorRgb::BLACK);
LedDeviceWs2801 ledDevice("/dev/spidev0.0", 40000, 500000);
LedDeviceWs2801 ledDevice("/dev/spidev0.0", 40000, 500000, 0, 0);
ledDevice.open();
timespec loopTime;