Contiki 2.5
led.h
Go to the documentation of this file.
1 /** @file hal/micro/led.h
2  * @brief Header for led APIs
3  *
4  * <!--(C) COPYRIGHT 2010 STMicroelectronics. All rights reserved. -->
5  */
6 
7 /** @addtogroup led
8  * @brief Sample API funtions for controlling LEDs.
9  *
10  * When specifying an LED to use, always use the BOARDLEDx definitions that
11  * are defined within the BOARD_HEADER.
12  *
13  * See led.h for source code.
14  *@{
15  */
16 
17 
18 /** @brief Configures GPIOs pertaining to the control of LEDs.
19  */
20 void halInitLed(void);
21 
22 /** @brief Ensures that the definitions from the BOARD_HEADER
23  * are always used as parameters to the LED functions.
24  */
25  typedef int8u HalBoardLed;
26 // Note: Even though many compilers will use 16 bits for an enum instead of 8,
27 // we choose to use an enum here. The possible compiler inefficiency does not
28 // affect stack-based parameters and local variables, which is the
29 // general case for led paramters.
30 
31 /** @brief Atomically wraps an XOR or similar operation for a single GPIO
32  * pin attached to an LED.
33  *
34  * @param led Identifier (from BOARD_HEADER) for the LED to be toggled.
35  */
36 void halToggleLed(HalBoardLed led);
37 
38 /** @brief Turns on (sets) a GPIO pin connected to an LED so that the LED
39  * turns on.
40  *
41  * @param led Identifier (from BOARD_HEADER) for the LED to turn on.
42  */
43 void halSetLed(HalBoardLed led);
44 
45 /** @brief Turns off (clears) a GPIO pin connected to an LED, which turns
46  * off the LED.
47  *
48  * @param led Identifier (from BOARD_HEADER) for the LED to turn off.
49  */
50 void halClearLed(HalBoardLed led);
51 
52 #ifdef CORTEXM3_STM32F103
53 #include "micro/cortexm3/stm32f103ret/led-specific.h"
54 #endif
55 
56 /** @} // END addtogroup
57  */
58