summaryrefslogtreecommitdiffstats
path: root/libleds.c
diff options
context:
space:
mode:
authorTobias Wiese <tobias@tobiaswiese.com>2021-05-03 23:58:30 +0200
committerTobias Wiese <tobias@tobiaswiese.com>2021-07-22 02:26:29 +0200
commit68b5f182af145fdd9e62c9dde3eedcb9108f5ba4 (patch)
tree67c0011276b30f8f785b934be44044935f78bd73 /libleds.c
Initial commitHEADmaster
Signed-off-by: Tobias Wiese <tobias@tobiaswiese.com>
Diffstat (limited to 'libleds.c')
-rw-r--r--libleds.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libleds.c b/libleds.c
new file mode 100644
index 0000000..1e32d90
--- /dev/null
+++ b/libleds.c
@@ -0,0 +1,14 @@
+#include <util/delay.h>
+#include "libleds.h"
+
+void led_write_rgb_all(struct led_obj const obj, struct led_color const color)
+{
+ for (int i = 0; i < obj.width * obj.height; i++) {
+ led_write_rgb(obj.port, obj.pins, color);
+ }
+}
+
+void led_latch(void)
+{
+ _delay_us(280);
+}