X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/aae20139b90521cf1d1b17fdcb3ff9d42ecdf937..04526d284dec7f2b2b2cd3716de979d8d3140198:/LUFA/Drivers/Board/EVK1101/LEDs.h diff --git a/LUFA/Drivers/Board/EVK1101/LEDs.h b/LUFA/Drivers/Board/EVK1101/LEDs.h index f19e464d7..6ed80be18 100644 --- a/LUFA/Drivers/Board/EVK1101/LEDs.h +++ b/LUFA/Drivers/Board/EVK1101/LEDs.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2010. + Copyright (C) Dean Camera, 2009. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -29,20 +29,18 @@ */ /** \file - * - * Board specific LED driver header for the EVK1101. + * \brief Board specific LED driver header for the Atmel EVK1101. + * \copydetails Group_LEDs_EVK1101 * * \note This file should not be included directly. It is automatically included as needed by the LEDs driver * dispatch header located in LUFA/Drivers/Board/LEDs.h. */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_EVK1101 EVK1101 + * \defgroup Group_LEDs_EVK1101 EVK1101 + * \brief Board specific LED driver header for the Atmel EVK1101. * - * Board specific LED driver header for the EVK1101. - * - * \note This file should not be included directly. It is automatically included as needed by the LEDs driver - * dispatch header located in LUFA/Drivers/Board/LEDs.h. + * Board specific LED driver header for the Atmel EVK1101. * * @{ */ @@ -61,10 +59,16 @@ #endif /* Preprocessor Checks: */ - #if !defined(__INCLUDE_FROM_LEDS_H) + #if !defined(INCLUDE_FROM_LEDS_H) #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #endif + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define LEDS_PORT 0 + #endif + /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ @@ -89,42 +93,37 @@ #if !defined(__DOXYGEN__) static inline void LEDs_Init(void) { - AVR32_GPIO.port[0].gpers = LEDS_ALL_LEDS; - AVR32_GPIO.port[0].oders = LEDS_ALL_LEDS; - AVR32_GPIO.port[0].ovrs = LEDS_ALL_LEDS; + AVR32_GPIO.port[LEDS_PORT].gpers = LEDS_ALL_LEDS; + AVR32_GPIO.port[LEDS_PORT].oders = LEDS_ALL_LEDS; + AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS; } - static inline void LEDs_TurnOnLEDs(const uint32_t LEDMask) + static inline void LEDs_TurnOnLEDs(const uint32_t LedMask) { - AVR32_GPIO.port[0].ovrc = LEDMask; + AVR32_GPIO.port[LEDS_PORT].ovrc = LedMask; } - static inline void LEDs_TurnOffLEDs(const uint32_t LEDMask) + static inline void LEDs_TurnOffLEDs(const uint32_t LedMask) { - AVR32_GPIO.port[0].ovrs = LEDMask; + AVR32_GPIO.port[LEDS_PORT].ovrs = LedMask; } - static inline void LEDs_SetAllLEDs(const uint32_t LEDMask) - { - AVR32_GPIO.port[0].ovrs = LEDS_ALL_LEDS; - AVR32_GPIO.port[0].ovrc = LEDMask; - } - - static inline void LEDs_ChangeLEDs(const uint32_t LEDMask, const uint32_t ActiveMask) + static inline void LEDs_SetAllLEDs(const uint32_t LedMask) { - AVR32_GPIO.port[0].ovrs = LEDMask; - AVR32_GPIO.port[0].ovrc = ActiveMask; + AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS; + AVR32_GPIO.port[LEDS_PORT].ovrc = LedMask; } - static inline void LEDs_ToggleLEDs(const uint32_t LEDMask) + static inline void LEDs_ChangeLEDs(const uint32_t LedMask, const uint32_t ActiveMask) { - AVR32_GPIO.port[0].ovrt = LEDMask; + AVR32_GPIO.port[LEDS_PORT].ovrs = LedMask; + AVR32_GPIO.port[LEDS_PORT].ovrc = ActiveMask; } static inline uint32_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint32_t LEDs_GetLEDs(void) { - return (AVR32_GPIO.port[0].ovr & LEDS_ALL_LEDS); + return (AVR32_GPIO.port[LEDS_PORT].ovr & LEDS_ALL_LEDS); } #endif