diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-05 18:06:49 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-05 18:09:51 +0200 |
commit | 0af68991e9b7829e2046810d9d748c5a35dc437a (patch) | |
tree | 6cf0e9567256a3c4e882240f816d293a837f9986 /src/glutt-o-logique/leds.c | |
parent | c6bf425075ca38ec52198e584dcdc67eaf0f1d98 (diff) | |
download | glutte-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.c | 42 |
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; + } +} |