X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d38fa49cb6cb3804c9bb17601688a62ba466b535..2a0c28e6e47c8a173f32fc99cd8666a2633c5c12:/LUFA/Drivers/Board/LEDs.h?ds=inline diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index 1874dfde3..cd2b857a4 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -48,11 +48,20 @@ * - None * * \section Module Description - * Functions, macros, variables, enums and types related to the control of board LEDs. + * 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 \ref Page_WritingBoardDrivers) + * which contains only stub functions and defines no LEDs. + * * @{ */ @@ -84,6 +93,22 @@ #include "Board/LEDs.h" #endif + #if !defined(LEDS_LED1) + #define LEDS_LED1 0 + #endif + + #if !defined(LEDS_LED2) + #define LEDS_LED2 0 + #endif + + #if !defined(LEDS_LED3) + #define LEDS_LED3 0 + #endif + + #if !defined(LEDS_LED4) + #define LEDS_LED4 0 + #endif + /* Pseudo-Functions for Doxygen: */ #if defined(__DOXYGEN__) /** Initializes the board LED driver so that the LEDs can be controlled. This sets the appropriate port @@ -93,28 +118,28 @@ /** Turns on the LEDs specified in the given LED mask. * - * \param LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file) + * \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file) */ static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask); /** Turns off the LEDs specified in the given LED mask. * - * \param LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file) + * \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file) */ static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask); /** Turns off all LEDs not specified in the given LED mask, and turns on all the LEDs in the given LED * mask. * - * \param LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file) + * \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file) */ static inline void LEDs_SetAllLEDs(const uint8_t LEDMask); /** 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. * - * \param LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file) - * \param ActiveMask Mask of whether the LEDs in the LED mask should be turned on or off + * \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file) + * \param[in] ActiveMask Mask of whether the LEDs in the LED mask should be turned on or off */ static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask);