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