summaryrefslogtreecommitdiff
path: root/keyboards/handwired/promethium/rgbsps.c
diff options
context:
space:
mode:
authorlucwastiaux2016-12-10 12:49:47 +0800
committerlucwastiaux2016-12-10 12:49:47 +0800
commit9240f27ba909aece233bda59e4ec15f7666fdece (patch)
tree7b6e2b05a0722734e4739dd7b52817d82fae51c6 /keyboards/handwired/promethium/rgbsps.c
parentdc4c8875ba2b961deb5d9712f422b00ce7c90979 (diff)
parent985a091a739c99736d5b17de5161831488dbc219 (diff)
Merge remote-tracking branch 'upstream/master'
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 000000000..ea922ec3f
--- /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