summaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/promethium/rgbsps.c
diff options
context:
space:
mode:
authorPriyadi Iman Nurcahyo <priyadi@priyadi.net>2016-11-26 13:11:40 +0700
committerPriyadi Iman Nurcahyo <priyadi@priyadi.net>2016-11-26 23:48:11 +0700
commit8ee389c9b6e6757c228534b095e609d5a9501102 (patch)
treee3c1edca8e3d977b145321f4708d5acecfd2aff7 /keyboards/handwired/promethium/rgbsps.c
parent746fd15638e2a42ea7bd69e2d0bb6a1f8e465f4e (diff)
My Promethium keyboard 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