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