Ensure the DFU bootloader disables and clears the activity LED toggle timer when...
[pub/USBasp.git] / LUFA / Drivers / Board / XMEGA / A3BU_XPLAINED / LEDs.h
index d7186bb..b47199b 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 /*
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  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
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
  *
  *  Board specific LED driver header for the Atmel XMEGA A3BU Xplained.
  *
  *
  *  Board specific LED driver header for the Atmel XMEGA A3BU Xplained.
  *
+ *  <table>
+ *    <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
+ *    <tr><td>LEDS_LED1</td><td>Yellow</td><td>LED0 LED</td><td>Low</td><td>PORTR.0</td></tr>
+ *    <tr><td>LEDS_LED2</td><td>Yellow</td><td>LED1 LED</td><td>Low</td><td>PORTR.1</td></tr>
+ *  </table>
+ *
  *  @{
  */
 
  *  @{
  */
 
                #if !defined(__DOXYGEN__)
                        static inline void LEDs_Init(void)
                        {
                #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)
                        {
                        }
 
                        static inline void LEDs_Disable(void)
                        {
-                               PORTR_DIRCLR = LEDS_ALL_LEDS;
-                               PORTR_OUTCLR = LEDS_ALL_LEDS;
+                               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)
                        {
                        }
 
                        static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
                        {
-                               PORTR_OUTCLR = LEDMask;
+                               PORTR_OUTSET = LEDMask;
                        }
 
                        static inline void LEDs_TurnOffLEDs(const uint8_t 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)
                        }
 
                        static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)