vanity-convert: add Makefile
[hackover2013-badge-firmware.git] / badge / backlight.c
1 #include "backlight.h"
2 #include "pinconfig.h"
3 #include <lpc134x.h>
4
5 #include <core/wdt/wdt.h>
6
7 void badge_backlight_init(void) {
8 HOB_SET_PIN_FUNC(HOB_LCD_BACKLIGHT, CLKOUT);
9
10 wdtInit(false);
11 SCB_CLKOUTCLKSEL = SCB_MAINCLKSEL_SOURCE_WDTOSC;
12 SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_DISABLE;
13 SCB_CLKOUTCLKUEN = SCB_CLKOUTCLKUEN_UPDATE;
14
15 badge_backlight_enable();
16 }
17
18 void badge_backlight_enable(void) {
19 SCB_CLKOUTCLKDIV = 75;
20 }
21
22 void badge_backlight_disable(void) {
23 SCB_CLKOUTCLKDIV = 0;
24 }
This page took 0.052424 seconds and 5 git commands to generate.