X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f201f6697b7f99b63389509b42112026b8f6f76f..d4684b29b9a3a4b45b6422d0f1cf6c79639c84c8:/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h index d555ac211..b47199bbb 100644 --- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h +++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h @@ -1,18 +1,18 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com + www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 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 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 @@ -42,6 +42,12 @@ * * Board specific LED driver header for the Atmel XMEGA A3BU Xplained. * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowLED0 LEDLowPORTR.0
LEDS_LED2YellowLED1 LEDLowPORTR.1
+ * * @{ */ @@ -79,18 +85,30 @@ #if !defined(__DOXYGEN__) static inline void LEDs_Init(void) { - PORTR_DIRSET = LEDS_ALL_LEDS; - PORTR_OUTSET = LEDS_ALL_LEDS; + PORTR.DIRSET = LEDS_ALL_LEDS; + PORTR.OUTCLR = LEDS_ALL_LEDS; + + PORTCFG.MPCMASK = LEDS_ALL_LEDS; + PORTR.PIN0CTRL = PORT_INVEN_bm; + } + + static inline void LEDs_Disable(void) + { + PORTR.DIRCLR = LEDS_ALL_LEDS; + PORTR.OUTCLR = LEDS_ALL_LEDS; + + PORTCFG.MPCMASK = 0; + PORTR.PIN0CTRL = LEDS_ALL_LEDS; } static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { - PORTR_OUTCLR = LEDMask; + PORTR_OUTSET = LEDMask; } static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) { - PORTR_OUTSET = LEDMask; + PORTR_OUTCLR = LEDMask; } static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)