Led

Sample API funtions for controlling LEDs. More...

Typedefs

typedef int8u HalBoardLed
 Ensures that the definitions from the BOARD_HEADER are always used as parameters to the LED functions.

Functions

void halInitLed (void)
 Configures GPIOs pertaining to the control of LEDs.
void halToggleLed (HalBoardLed led)
 Atomically wraps an XOR or similar operation for a single GPIO pin attached to an LED.
void halSetLed (HalBoardLed led)
 Turns on (sets) a GPIO pin connected to an LED so that the LED turns on.
void halClearLed (HalBoardLed led)
 Turns off (clears) a GPIO pin connected to an LED, which turns off the LED.

Detailed Description

Sample API funtions for controlling LEDs.

When specifying an LED to use, always use the BOARDLEDx definitions that are defined within the BOARD_HEADER.

See led.h for source code.


Function Documentation

void halClearLed ( HalBoardLed  led  ) 

Turns off (clears) a GPIO pin connected to an LED, which turns off the LED.

Parameters:
led Identifier (from BOARD_HEADER) for the LED to turn off.

Definition at line 28 of file led.c.

References halGpioSet().

Referenced by halInitLed().

void halSetLed ( HalBoardLed  led  ) 

Turns on (sets) a GPIO pin connected to an LED so that the LED turns on.

Parameters:
led Identifier (from BOARD_HEADER) for the LED to turn on.

Definition at line 23 of file led.c.

References halGpioSet().

void halToggleLed ( HalBoardLed  led  ) 

Atomically wraps an XOR or similar operation for a single GPIO pin attached to an LED.

Parameters:
led Identifier (from BOARD_HEADER) for the LED to be toggled.

Definition at line 33 of file led.c.

References ATOMIC, and BIT.


Generated on Mon Apr 11 14:23:57 2011 for Contiki 2.5 by  doxygen 1.6.1