Demo to control 4 LEDs

Dependencies:   BSP_DISCO_F469NI mbed

user/user.cpp

Committer:
Faberge
Date:
2017-10-31
Revision:
2:e6fc24fbd86c
Parent:
1:a6d179a9ffbb

File content as of revision 2:e6fc24fbd86c:

/*
 * user.cpp
 * 
 * Copyright 2017 Faberge@TsarTeam
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 */

#include "user.h"

/* Additional functions */
void InitLEDs()
{
    BSP_LED_Init(DISCO_LED_BLUE);
    BSP_LED_Init(DISCO_LED_RED);
    BSP_LED_Init(DISCO_LED_ORANGE);
    BSP_LED_Init(DISCO_LED_GREEN);
}

void toggleBlueLED(bool state)
{
    if (state)
        BSP_LED_On(DISCO_LED_BLUE);
    else
        BSP_LED_Off(DISCO_LED_BLUE);
}

void toggleRedLED(bool state)
{
    if (state)
        BSP_LED_On(DISCO_LED_RED);
    else
        BSP_LED_Off(DISCO_LED_RED);
}

void toggleOrangeLED(bool state)
{
    if (state)
        BSP_LED_On(DISCO_LED_ORANGE);
    else
        BSP_LED_Off(DISCO_LED_ORANGE);
}

void toggleGreenLED(bool state)
{
    if (state)
        BSP_LED_On(DISCO_LED_GREEN);
    else
        BSP_LED_Off(DISCO_LED_GREEN);
}