Contiki 2.6
|
00001 /** @file hal/micro/led.h 00002 * @brief Header for led APIs 00003 * 00004 * <!--(C) COPYRIGHT 2010 STMicroelectronics. All rights reserved. --> 00005 */ 00006 00007 /** @addtogroup led 00008 * @brief Sample API funtions for controlling LEDs. 00009 * 00010 * When specifying an LED to use, always use the BOARDLEDx definitions that 00011 * are defined within the BOARD_HEADER. 00012 * 00013 * See led.h for source code. 00014 *@{ 00015 */ 00016 00017 00018 /** @brief Configures GPIOs pertaining to the control of LEDs. 00019 */ 00020 void halInitLed(void); 00021 00022 /** @brief Ensures that the definitions from the BOARD_HEADER 00023 * are always used as parameters to the LED functions. 00024 */ 00025 typedef int8u HalBoardLed; 00026 // Note: Even though many compilers will use 16 bits for an enum instead of 8, 00027 // we choose to use an enum here. The possible compiler inefficiency does not 00028 // affect stack-based parameters and local variables, which is the 00029 // general case for led paramters. 00030 00031 /** @brief Atomically wraps an XOR or similar operation for a single GPIO 00032 * pin attached to an LED. 00033 * 00034 * @param led Identifier (from BOARD_HEADER) for the LED to be toggled. 00035 */ 00036 void halToggleLed(HalBoardLed led); 00037 00038 /** @brief Turns on (sets) a GPIO pin connected to an LED so that the LED 00039 * turns on. 00040 * 00041 * @param led Identifier (from BOARD_HEADER) for the LED to turn on. 00042 */ 00043 void halSetLed(HalBoardLed led); 00044 00045 /** @brief Turns off (clears) a GPIO pin connected to an LED, which turns 00046 * off the LED. 00047 * 00048 * @param led Identifier (from BOARD_HEADER) for the LED to turn off. 00049 */ 00050 void halClearLed(HalBoardLed led); 00051 00052 #ifdef CORTEXM3_STM32F103 00053 #include "micro/cortexm3/stm32f103ret/led-specific.h" 00054 #endif 00055 00056 /** @} // END addtogroup 00057 */ 00058