Access macros and functions to control the on-board LEDs.
More...
Access macros and functions 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 | led.h |
| Macros and inline functions for controlling the on-board LEDs.
|
|
|
static void | led_on (unsigned id) |
| Turn on an LED. More...
|
|
static void | led_off (unsigned id) |
| Turn off an LED. More...
|
|
static void | led_toggle (unsigned id) |
| Toggle an LED. More...
|
|
#define | LED_ON(id) LED ## id ##_ON |
| Turn on an LED.
|
|
#define | LED_OFF(id) LED ## id ## _OFF |
| Turn off an LED.
|
|
#define | LED_TOGGLE(id) LED ## id ##_TOGGLE |
| Toggle an LED.
|
|
◆ led_off()
static void led_off |
( |
unsigned |
id | ) |
|
|
inlinestatic |
Turn off an LED.
- Note
- If id is a compile-time constant, consider using LED_OFF(id) instead.
- Parameters
-
id | id of LED between 0 and 7 |
Definition at line 170 of file led.h.
◆ led_on()
static void led_on |
( |
unsigned |
id | ) |
|
|
inlinestatic |
Turn on an LED.
- Note
- If id is a compile-time constant, consider using LED_ON(id) instead.
- Parameters
-
id | id of LED between 0 and 7 |
Definition at line 149 of file led.h.
◆ led_toggle()
static void led_toggle |
( |
unsigned |
id | ) |
|
|
inlinestatic |
Toggle an LED.
- Note
- If id is a compile-time constant, consider using LED_TOGGLE(id) instead.
- Parameters
-
id | id of LED between 0 and 7 |
Definition at line 191 of file led.h.