From: Wintermute Date: Fri, 1 Nov 2013 18:58:35 +0000 (+0100) Subject: Fehlende backlight.c X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/commitdiff_plain/adf69ed4aa95d022041388b89a40ecdeb401c4fd?hp=90e53a11b55796369426f3720200666366259d0a Fehlende 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; +}