Fehlende backlight.c
authorWintermute <wintermute@hannover.ccc.de>
Fri, 1 Nov 2013 18:58:35 +0000 (19:58 +0100)
committerWintermute <wintermute@hannover.ccc.de>
Fri, 1 Nov 2013 18:58:35 +0000 (19:58 +0100)
badge/backlight.c [new file with mode: 0644]

diff --git a/badge/backlight.c b/badge/backlight.c
new file mode 100644 (file)
index 0000000..8cf6a6e
--- /dev/null
@@ -0,0 +1,24 @@
+#include "backlight.h"
+#include "pinconfig.h"
+#include <lpc134x.h>
+
+#include <core/wdt/wdt.h>
+
+void badge_backlight_init(void) {
+  HOB_SET_PIN_FUNC(HOB_LCD_BACKLIGHT, CLKOUT);
+
+  wdtInit(false);
+  SCB_CLKOUTCLKSEL = SCB_MAINCLKSEL_SOURCE_WDTOSC;
+  SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_DISABLE;
+  SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_UPDATE;
+
+  badge_backlight_enable();
+}
+
+void badge_backlight_enable(void) {
+  SCB_CLKOUTCLKDIV = 75;
+}
+
+void badge_backlight_disable(void) {
+  SCB_CLKOUTCLKDIV =  0;
+}
This page took 0.021923 seconds and 4 git commands to generate.