aboutsummaryrefslogtreecommitdiffstats
path: root/src/glutt-o-logique/leds.c
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-05 18:06:49 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-05 18:09:51 +0200
commit0af68991e9b7829e2046810d9d748c5a35dc437a (patch)
tree6cf0e9567256a3c4e882240f816d293a837f9986 /src/glutt-o-logique/leds.c
parentc6bf425075ca38ec52198e584dcdc67eaf0f1d98 (diff)
downloadglutte-o-matic-0af68991e9b7829e2046810d9d748c5a35dc437a.tar.gz
glutte-o-matic-0af68991e9b7829e2046810d9d748c5a35dc437a.tar.bz2
glutte-o-matic-0af68991e9b7829e2046810d9d748c5a35dc437a.zip
Restructure stm32 project
Diffstat (limited to 'src/glutt-o-logique/leds.c')
-rw-r--r--src/glutt-o-logique/leds.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/glutt-o-logique/leds.c b/src/glutt-o-logique/leds.c
new file mode 100644
index 0000000..88b46bf
--- /dev/null
+++ b/src/glutt-o-logique/leds.c
@@ -0,0 +1,42 @@
+#include "../../../common/src/GPIO/leds.c"
+
+#include "stm32f4xx_conf.h"
+
+#include "leds.h"
+
+void leds_turn_on(int l) {
+
+ switch (l) {
+ case LED_GREEN:
+ GPIO_SetBits(GPIOD, GPIOD_BOARD_LED_GREEN);
+ break;
+ case LED_ORANGE:
+ GPIO_SetBits(GPIOD, GPIOD_BOARD_LED_ORANGE);
+ break;
+ case LED_RED:
+ GPIO_SetBits(GPIOD, GPIOD_BOARD_LED_RED);
+ break;
+ case LED_BLUE:
+ GPIO_SetBits(GPIOD, GPIOD_BOARD_LED_BLUE);
+ break;
+
+ }
+}
+
+void leds_turn_off(int l) {
+
+ switch (l) {
+ case LED_GREEN:
+ GPIO_ResetBits(GPIOD, GPIOD_BOARD_LED_GREEN);
+ break;
+ case LED_ORANGE:
+ GPIO_ResetBits(GPIOD, GPIOD_BOARD_LED_ORANGE);
+ break;
+ case LED_RED:
+ GPIO_ResetBits(GPIOD, GPIOD_BOARD_LED_RED);
+ break;
+ case LED_BLUE:
+ GPIO_ResetBits(GPIOD, GPIOD_BOARD_LED_BLUE);
+ break;
+ }
+}