36 #include "contiki-conf.h"
41 #define LED_ARCH_RED GPIO_LED_RED
42 #define LED_ARCH_GREEN GPIO_LED_GREEN
43 #define LED_ARCH_BLUE GPIO_LED_BLUE
48 GPIO->FUNC_SEL.LED_ARCH_RED = 3;
49 GPIO->FUNC_SEL.LED_ARCH_GREEN = 3;
50 GPIO->FUNC_SEL.LED_ARCH_BLUE = 3;
53 GPIO->PAD_DIR.LED_ARCH_RED = 1;
54 GPIO->PAD_DIR.LED_ARCH_GREEN = 1;
55 GPIO->PAD_DIR.LED_ARCH_BLUE = 1;
58 unsigned char leds_arch_get(
void)
61 return ((GPIO->DATA.LED_ARCH_RED) ? 0 : LEDS_RED)
62 | ((GPIO->DATA.LED_ARCH_GREEN) ? 0 : LEDS_GREEN)
63 | ((GPIO->DATA.LED_ARCH_BLUE) ? 0 : LEDS_BLUE);
67 void leds_arch_set(
unsigned char leds)
69 if(leds & LEDS_RED) { GPIO->DATA.LED_ARCH_RED = 1; }
else { gpio_reset(LED_ARCH_RED); }
70 if(leds & LEDS_GREEN) { gpio_set(LED_ARCH_GREEN); }
else { gpio_reset(LED_ARCH_GREEN); }
71 if(leds & LEDS_BLUE) { gpio_set(LED_ARCH_BLUE); }
else { gpio_reset(LED_ARCH_BLUE); }