summaryrefslogtreecommitdiff
path: root/keyboards/handwired/promethium/rgbsps.c
diff options
context:
space:
mode:
authordbroqua <dbroqua@mousur.org>2016-12-17 22:25:21 +0100
committerdbroqua <dbroqua@mousur.org>2016-12-17 22:25:21 +0100
commitdf50bee5a88cacbd1f5fab98b26c2068646b61c0 (patch)
tree60a59d80c173055788e66b7e9dd79aaad7b27df6 /keyboards/handwired/promethium/rgbsps.c
parent46b93f02d570c0bb66410cb8d9af2451d5453635 (diff)
parent13c4080a1d77cb1dfdf48df8a42e78b9dc483912 (diff)
Merge branch 'master' of https://github.com/Dbroqua/qmk_firmware
Diffstat (limited to 'keyboards/handwired/promethium/rgbsps.c')
-rw-r--r--keyboards/handwired/promethium/rgbsps.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/keyboards/handwired/promethium/rgbsps.c b/keyboards/handwired/promethium/rgbsps.c
new file mode 100644
index 0000000000..ea922ec3fd
--- /dev/null
+++ b/keyboards/handwired/promethium/rgbsps.c
@@ -0,0 +1,24 @@
+#include "light_ws2812.h"
+#include "rgbsps.h"
+
+struct cRGB led[RGBSPS_NUM];
+
+void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b) {
+ led[index].r = r;
+ led[index].g = g;
+ led[index].b = b;
+}
+
+void rgbsps_setall(uint8_t r, uint8_t g, uint8_t b) {
+ for (uint16_t i = 0; i < RGBSPS_NUM; i++) {
+ rgbsps_set(i, r, g, b);
+ }
+}
+
+void rgbsps_turnoff(void) {
+ rgbsps_setall(0, 0, 0);
+}
+
+void rgbsps_send(void) {
+ ws2812_setleds(led, RGBSPS_NUM);
+} \ No newline at end of file