LEDs Driver - LUFA/Drivers/Board/LEDs.h
[Board Drivers]

Modules

 ATAVRUSBRF01
 BUMBLEB
 EVK527
 RZUSBSTICK
 STK525
 STK526
 USBKEY
 XPLAIN

Functions

static void LEDs_Init (void)
static void LEDs_TurnOnLEDs (const uint8_t LEDMask)
static void LEDs_TurnOffLEDs (const uint8_t LEDMask)
static void LEDs_SetAllLEDs (const uint8_t LEDMask)
static void LEDs_ChangeLEDs (const uint8_t LEDMask, const uint8_t ActiveMask)
static void LEDs_ToggleLEDs (const uint8_t LEDMask)
static uint8_t LEDs_GetLEDs (void) ATTR_WARN_UNUSED_RESULT

Detailed Description

Module Source Dependencies

The following files must be built with any user project that uses this module:

Description

Hardware LEDs driver. This provides an easy to use driver for the hardware LEDs present on many boards. It provides an interface to configure, test and change the status of all the board LEDs.

If the BOARD value is set to BOARD_USER, this will include the /Board/Dataflash.h file in the user project directory. Otherwise, it will include the appropriate built in board driver header file.

Note:
To make code as compatible as possible, it is assumed that all boards carry a minimum of four LEDs. If a board contains less than four LEDs, the remaining LED masks are defined to 0 so as to have no effect. If other behaviour is desired, either alias the remaining LED masks to existing LED masks via the -D switch in the project makefile, or alias them to nothing in the makefile to cause compilation errors when a non-existing LED is referenced in application code. Note that this means that it is possible to make compatible code for a board with no LEDs by making a board LED driver (see Writing LUFA Board Drivers) which contains only stub functions and defines no LEDs.

Function Documentation

static void LEDs_ChangeLEDs ( const uint8_t  LEDMask,
const uint8_t  ActiveMask 
) [inline, static]

Turns off all LEDs in the LED mask that are not set in the active mask, and turns on all the LEDs specified in both the LED and active masks.

Parameters:
[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
[in] ActiveMask Mask of whether the LEDs in the LED mask should be turned on or off
static uint8_t LEDs_GetLEDs ( void   )  [inline, static]

Returns the status of all the board LEDs; set LED masks in the return value indicate that the corresponding LED is on.

Returns:
Mask of the board LEDs which are currently turned on
static void LEDs_Init ( void   )  [inline, static]

Initializes the board LED driver so that the LEDs can be controlled. This sets the appropriate port I/O pins as outputs, and sets the LEDs to default to off.

static void LEDs_SetAllLEDs ( const uint8_t  LEDMask  )  [inline, static]

Turns off all LEDs not specified in the given LED mask, and turns on all the LEDs in the given LED mask.

Parameters:
[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
static void LEDs_ToggleLEDs ( const uint8_t  LEDMask  )  [inline, static]

Toggles all LEDs in the LED mask, leaving all others in their current states.

Parameters:
[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
static void LEDs_TurnOffLEDs ( const uint8_t  LEDMask  )  [inline, static]

Turns off the LEDs specified in the given LED mask.

Parameters:
[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
static void LEDs_TurnOnLEDs ( const uint8_t  LEDMask  )  [inline, static]

Turns on the LEDs specified in the given LED mask.

Parameters:
[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)

Generated by  doxygen 1.6.2