Commit for the LUFA-120730-BETA release.
[pub/USBasp.git] / LUFA / Drivers / Board / AVR8 / RZUSBSTICK / LEDs.h
index ed5c2c1..7be9b37 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] 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, distribute, and sell this
   software and its documentation for any purpose is hereby granted
  *
  *  Board specific LED driver header for the Atmel RZUSBSTICK.
  *
+ *  <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>Blue</td><td>General Indicator</td><td>High</td><td>PORTD.7</td></tr>
+ *    <tr><td>LEDS_LED1</td><td>Red</td><td>General Indicator</td><td>Low</td><td>PORTD.5</td></tr>
+ *    <tr><td>LEDS_LED1</td><td>Green</td><td>General Indicator</td><td>Low</td><td>PORTE.6</td></tr>
+ *    <tr><td>LEDS_LED1</td><td>Yellow</td><td>General Indicator</td><td>Low</td><td>PORTE.7</td></tr>
+ *  </table>
+ *
  *  @{
  */
 
                                PORTE |=  (LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT);
                        }
 
+                       static inline void LEDs_Disable(void)
+                       {
+                               DDRD  &= ~LEDS_PORTD_LEDS;
+                               PORTD &= ~LEDS_PORTD_LEDS;
+
+                               DDRE  &= ~(LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT);
+                               PORTE &= ~(LEDS_PORTE_LEDS << LEDS_PORTE_MASK_SHIFT);
+                       }
+
                        static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
                        {
                                PORTD |=  (LEDMask & LEDS_LED1);
 
                        static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
                        {
-                               PORTD ^= (LEDMask & LEDS_PORTD_LEDS);
-                               PORTE ^= ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
+                               PIND  = (LEDMask & LEDS_PORTD_LEDS);
+                               PINE  = ((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT);
                        }
 
                        static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;