1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/drivers/include/led.h

109 lines
2.9 KiB
C
Raw Normal View History

2016-03-14 19:49:52 +01:00
/*
* Copyright (C) 2016 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup drivers_led Control on-board LEDs
* @ingroup drivers_actuators
2016-03-14 19:49:52 +01:00
* @brief Access macros to control the on-board LEDs
*
* This header contains a set of macros for controlling the on-board LEDs of
* a board. The LEDs are enumerated, starting from LED0 to LED7. As most
* platforms have a different number of LEDs, the existing ones are mapped onto
* the lowest LED numbers, while the higher LED numbers will simply be empty
* defines. This ensures, that the LED macros are portable to any platform with
* any number of LEDs.
*
* Providing access macros to 8 LEDs is a random decision, as currently 8 is the
* maximum number of on-board LEDs found on any board in RIOT (stm32f3discovery).
*
* @{
*
* @file
* @brief Macros for controlling the on-board LEDs
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef LED_H
#define LED_H
2016-03-14 19:49:52 +01:00
#include "board.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
2017-08-29 18:00:46 +02:00
* @name LED fallback macros
2016-03-14 19:49:52 +01:00
* @{
*/
#ifndef LED0_ON
2017-08-29 18:00:46 +02:00
#define LED0_ON /**< defined empty */
#define LED0_OFF /**< defined empty */
#define LED0_TOGGLE /**< defined empty */
2016-03-14 19:49:52 +01:00
#endif
#ifndef LED1_ON
2017-08-29 18:00:46 +02:00
#define LED1_ON /**< defined empty */
#define LED1_OFF /**< defined empty */
#define LED1_TOGGLE /**< defined empty */
2016-03-14 19:49:52 +01:00
#endif
#ifndef LED2_ON
2017-08-29 18:00:46 +02:00
#define LED2_ON /**< defined empty */
#define LED2_OFF /**< defined empty */
#define LED2_TOGGLE /**< defined empty */
2016-03-14 19:49:52 +01:00
#endif
#ifndef LED3_ON
2017-08-29 18:00:46 +02:00
#define LED3_ON /**< defined empty */
#define LED3_OFF /**< defined empty */
#define LED3_TOGGLE /**< defined empty */
2016-03-14 19:49:52 +01:00
#endif
#ifndef LED4_ON
2017-08-29 18:00:46 +02:00
#define LED4_ON /**< defined empty */
#define LED4_OFF /**< defined empty */
#define LED4_TOGGLE /**< defined empty */
2016-03-14 19:49:52 +01:00
#endif
#ifndef LED5_ON
2017-08-29 18:00:46 +02:00
#define LED5_ON /**< defined empty */
#define LED5_OFF /**< defined empty */
#define LED5_TOGGLE /**< defined empty */
2016-03-14 19:49:52 +01:00
#endif
#ifndef LED6_ON
2017-08-29 18:00:46 +02:00
#define LED6_ON /**< defined empty */
#define LED6_OFF /**< defined empty */
#define LED6_TOGGLE /**< defined empty */
2016-03-14 19:49:52 +01:00
#endif
#ifndef LED7_ON
2017-08-29 18:00:46 +02:00
#define LED7_ON /**< defined empty */
#define LED7_OFF /**< defined empty */
#define LED7_TOGGLE /**< defined empty */
2016-03-14 19:49:52 +01:00
#endif
/** @} */
/**
2017-08-29 18:00:46 +02:00
* @name Convenience LED control macros
2016-03-14 19:49:52 +01:00
* @{
*/
2017-08-29 18:00:46 +02:00
#define LED_ON(x) LED ## x ##_ON /**< Turn on led x */
#define LED_OFF(x) LED ## x ## _OFF /**< Turn off led x */
#define LED_TOGGLE(x) LED ## x ##_TOGGLE /**< Toggle led x */
2016-03-14 19:49:52 +01:00
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* LED_H */
2016-03-14 19:49:52 +01:00
/** @} */