aboutsummaryrefslogtreecommitdiffstats
path: root/src/glutt-o-logique/leds.c
blob: 0792e4a18d5b4ffd8685f75e20da1d0258c9deab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;
    }
}