From adf69ed4aa95d022041388b89a40ecdeb401c4fd Mon Sep 17 00:00:00 2001 From: Wintermute Date: Fri, 1 Nov 2013 19:58:35 +0100 Subject: [PATCH 1/1] Fehlende backlight.c --- badge/backlight.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 badge/backlight.c diff --git a/badge/backlight.c b/badge/backlight.c new file mode 100644 index 0000000..8cf6a6e --- /dev/null +++ b/badge/backlight.c @@ -0,0 +1,24 @@ +#include "backlight.h" +#include "pinconfig.h" +#include + +#include + +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; +} -- 2.20.1