diff options
65 files changed, 422 insertions, 16 deletions
diff --git a/LUFA/CodeTemplates/DriverStubs/Buttons.h b/LUFA/CodeTemplates/DriverStubs/Buttons.h index f1a184600..a1de82d2c 100644 --- a/LUFA/CodeTemplates/DriverStubs/Buttons.h +++ b/LUFA/CodeTemplates/DriverStubs/Buttons.h @@ -67,6 +67,11 @@ // TODO: Initialize the appropriate port pins as an inputs here, with pull-ups } + static inline void Buttons_Disable(void) + { + // TODO: Clear the appropriate port pins as high impedance inputs here + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/CodeTemplates/DriverStubs/Joystick.h b/LUFA/CodeTemplates/DriverStubs/Joystick.h index bfde26bb6..cc6d29540 100644 --- a/LUFA/CodeTemplates/DriverStubs/Joystick.h +++ b/LUFA/CodeTemplates/DriverStubs/Joystick.h @@ -79,6 +79,11 @@ // TODO: Initialize joystick port pins as inputs with pull-ups } + static inline void Joystick_Disable(void) + { + // TODO: Clear the joystick pins as high impedance inputs here + } + static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Joystick_GetStatus(void) { diff --git a/LUFA/CodeTemplates/DriverStubs/LEDs.h b/LUFA/CodeTemplates/DriverStubs/LEDs.h index e698c9db6..24b428840 100644 --- a/LUFA/CodeTemplates/DriverStubs/LEDs.h +++ b/LUFA/CodeTemplates/DriverStubs/LEDs.h @@ -82,6 +82,11 @@ // TODO: Add code to initialize LED port pins as outputs here } + static inline void LEDs_Disable(void) + { + // TODO: Clear the LED port pins as high impedance inputs here + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { // TODO: Add code to turn on LEDs given in the LEDMask mask here, leave others as-is diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 6b9477e58..79a9aad4d 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -16,6 +16,7 @@ * - Added new Android Accessory Host class driver * - Added new USB_Host_GetDescriptor(), USB_Host_GetDeviceConfiguration() and USB_Host_GetInterfaceAltSetting() functions * - Added new CALLBACK_Audio_Device_GetSetInterfaceProperty() callback to the Audio Device Class driver + * - Added new LEDs_Disable(), Buttons_Disable() and Joystick_Disable() functions to the board hardware drivers * - Library Applications: * - Added User Application APIs to the CDC and DFU class bootloaders * - Added INVERTED_ISP_MISO compile time option to the AVRISP-MKII clone project (thanks to Chuck Rohs) diff --git a/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h b/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h index 7fa3b4719..329abb9b0 100644 --- a/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h @@ -80,6 +80,12 @@ PORTE &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRE &= ~LEDS_ALL_LEDS; + PORTE &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTE |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h index 0c382dfc5..78d715cd7 100644 --- a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h index 858b21eec..339e9eec2 100644 --- a/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h @@ -92,6 +92,12 @@ PORTD &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD |= (LEDMask & LEDS_ALL_LEDS); diff --git a/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h b/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h index 3e722d62b..b24482c0a 100644 --- a/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h b/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h index 790960068..dd52d83ca 100644 --- a/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h @@ -83,6 +83,12 @@ PORTC |= LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRC &= ~LEDS_ALL_LEDS; + PORTC &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTC &= ~LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h b/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h index 04a6a8485..bed5345a2 100644 --- a/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h @@ -83,6 +83,12 @@ PORTD &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/BUI/LEDs.h b/LUFA/Drivers/Board/AVR8/BUI/LEDs.h index aeb757a8b..66a19590a 100644 --- a/LUFA/Drivers/Board/AVR8/BUI/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BUI/LEDs.h @@ -82,7 +82,14 @@ #if !defined(__DOXYGEN__) static inline void LEDs_Init(void) { - DDRC |= LEDS_ALL_LEDS; + DDRC |= LEDS_ALL_LEDS; + PORTC &= ~LEDS_ALL_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRC &= ~LEDS_ALL_LEDS; + PORTC &= ~LEDS_ALL_LEDS; } static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) diff --git a/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h b/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h index c3860e08a..7ea526de9 100644 --- a/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h @@ -76,6 +76,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h b/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h index 98665740f..3c44bebcd 100644 --- a/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h @@ -91,7 +91,13 @@ static inline void Joystick_Init(void) { DDRD &= ~JOY_MASK; - PORTD |= JOY_MASK; + PORTD |= JOY_MASK; + } + + static inline void Joystick_Disable(void) + { + DDRD &= ~JOY_MASK; + PORTD &= ~JOY_MASK; } static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h b/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h index fa53764e0..acf125a63 100644 --- a/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h @@ -91,6 +91,12 @@ PORTB &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRB &= ~LEDS_ALL_LEDS; + PORTB &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LedMask) { PORTB |= LedMask; diff --git a/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h b/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h index 8a39fa641..caa700de6 100644 --- a/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h @@ -74,6 +74,12 @@ PORTE |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h b/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h index 86e5c0cff..dede020fd 100644 --- a/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h @@ -80,6 +80,12 @@ PORTE &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRE &= ~LEDS_ALL_LEDS; + PORTE &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTE |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h b/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h index 03c51d2e8..748299f50 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h @@ -74,6 +74,12 @@ PORTE |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h b/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h index 19d19ee7d..811b5f1c6 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h @@ -91,11 +91,20 @@ #if !defined(__DOXYGEN__) static inline void Joystick_Init(void) { - DDRF &= ~(JOY_FMASK); - DDRC &= ~(JOY_CMASK); + DDRF &= ~JOY_FMASK; + DDRC &= ~JOY_CMASK; - PORTF |= JOY_FMASK; - PORTC |= JOY_CMASK; + PORTF |= JOY_FMASK; + PORTC |= JOY_CMASK; + } + + static inline void Joystick_Disable(void) + { + DDRF &= ~JOY_FMASK; + DDRC &= ~JOY_CMASK; + + PORTF &= ~JOY_FMASK; + PORTC &= ~JOY_CMASK; } static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h b/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h index 4cb6aeb08..fddb99de2 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h @@ -86,6 +86,12 @@ PORTD &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h b/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h index 170eaeabd..848674497 100644 --- a/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h b/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h index b3847b709..f24bc327d 100644 --- a/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h @@ -80,6 +80,12 @@ PORTD &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h index f211e652c..aa5573794 100644 --- a/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h @@ -83,6 +83,12 @@ PORTB &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRB &= ~LEDS_ALL_LEDS; + PORTB &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTB |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h b/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h index e3ba95786..0b071032d 100644 --- a/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h b/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h index 6e8472922..ec61a043f 100644 --- a/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h @@ -80,6 +80,12 @@ PORTD |= LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD &= ~LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h b/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h index ef30a9b4c..f58762aaa 100644 --- a/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h b/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h index 124fbaaad..349e0ff74 100644 --- a/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h @@ -83,6 +83,12 @@ PORTD |= LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD &= ~LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h b/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h index 32a7511e8..c6d1b79e9 100644 --- a/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h b/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h index 9872b9463..94526045d 100644 --- a/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h @@ -80,6 +80,12 @@ PORTD |= LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD &= ~LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h b/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h index ed5c2c191..bc2001e73 100644 --- a/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h @@ -102,6 +102,15 @@ 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); diff --git a/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h b/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h index 278bee5c7..cf058b718 100644 --- a/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h @@ -80,6 +80,12 @@ PORTB |= LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRB &= ~LEDS_ALL_LEDS; + PORTB &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTB &= ~LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/STK525/Buttons.h b/LUFA/Drivers/Board/AVR8/STK525/Buttons.h index d67a51df1..fdabb9537 100644 --- a/LUFA/Drivers/Board/AVR8/STK525/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/STK525/Buttons.h @@ -74,6 +74,12 @@ PORTE |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/STK525/Joystick.h b/LUFA/Drivers/Board/AVR8/STK525/Joystick.h index dcf7f2eda..a1e2fd0ea 100644 --- a/LUFA/Drivers/Board/AVR8/STK525/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/STK525/Joystick.h @@ -91,11 +91,20 @@ #if !defined(__DOXYGEN__) static inline void Joystick_Init(void) { - DDRB &= ~(JOY_BMASK); - DDRE &= ~(JOY_EMASK); + DDRB &= ~JOY_BMASK; + DDRE &= ~JOY_EMASK; - PORTB |= JOY_BMASK; - PORTE |= JOY_EMASK; + PORTB |= JOY_BMASK; + PORTE |= JOY_EMASK; + } + + static inline void Joystick_Disable(void) + { + DDRB &= ~JOY_BMASK; + DDRE &= ~JOY_EMASK; + + PORTB &= ~JOY_BMASK; + PORTE &= ~JOY_EMASK; } static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/STK525/LEDs.h b/LUFA/Drivers/Board/AVR8/STK525/LEDs.h index 2c81fd48c..ca21f9eff 100644 --- a/LUFA/Drivers/Board/AVR8/STK525/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/STK525/LEDs.h @@ -89,6 +89,12 @@ PORTD &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/STK526/Buttons.h b/LUFA/Drivers/Board/AVR8/STK526/Buttons.h index e2000a92e..55826e05f 100644 --- a/LUFA/Drivers/Board/AVR8/STK526/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/STK526/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/STK526/Joystick.h b/LUFA/Drivers/Board/AVR8/STK526/Joystick.h index 7c024fb39..443d701de 100644 --- a/LUFA/Drivers/Board/AVR8/STK526/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/STK526/Joystick.h @@ -90,7 +90,14 @@ { DDRB &= ~JOY_BMASK; - PORTB |= JOY_BMASK; + PORTB |= JOY_BMASK; + } + + static inline void Joystick_Disable(void) + { + DDRB &= ~JOY_BMASK; + + PORTB &= ~JOY_BMASK; } static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/STK526/LEDs.h b/LUFA/Drivers/Board/AVR8/STK526/LEDs.h index b77c691b1..5aeb13fc6 100644 --- a/LUFA/Drivers/Board/AVR8/STK526/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/STK526/LEDs.h @@ -89,6 +89,12 @@ PORTD &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h b/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h index 1722fe7d3..8184fb902 100644 --- a/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h @@ -94,6 +94,12 @@ #endif } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { #if (BOARD == BOARD_TEENSY2) diff --git a/LUFA/Drivers/Board/AVR8/TUL/Buttons.h b/LUFA/Drivers/Board/AVR8/TUL/Buttons.h index 191caa9d2..ae5f8c8a2 100644 --- a/LUFA/Drivers/Board/AVR8/TUL/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/TUL/Buttons.h @@ -74,6 +74,12 @@ PORTE |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/TUL/LEDs.h b/LUFA/Drivers/Board/AVR8/TUL/LEDs.h index 4968a1888..def25fd16 100644 --- a/LUFA/Drivers/Board/AVR8/TUL/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/TUL/LEDs.h @@ -80,6 +80,12 @@ PORTF &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRF &= ~LEDS_ALL_LEDS; + PORTF &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTF |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h b/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h index 61ae9b8be..5146cc2e3 100644 --- a/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h b/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h index 53789038a..f3aca6ae7 100644 --- a/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h @@ -98,6 +98,12 @@ DDRD |= (LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT); } + static inline void LEDs_Disable(void) + { + DDRB &= ~LEDS_PORTB_LEDS; + DDRD &= ~(LEDS_PORTD_LEDS << LEDS_PORTD_MASK_SHIFT); + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTB |= (LEDMask & LEDS_PORTB_LEDS); diff --git a/LUFA/Drivers/Board/AVR8/UNO/LEDs.h b/LUFA/Drivers/Board/AVR8/UNO/LEDs.h index 0205b2dff..579a1b20b 100644 --- a/LUFA/Drivers/Board/AVR8/UNO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/UNO/LEDs.h @@ -83,6 +83,12 @@ PORTD |= LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD &= ~LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h b/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h index 4e1e50033..7d8984a2b 100644 --- a/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h @@ -83,6 +83,12 @@ PORTD |= BUTTONS_BUTTON1;
}
+ static inline void Buttons_Disable(void)
+ {
+ DDRD &= ~BUTTONS_BUTTON1;
+ PORTD &= ~BUTTONS_BUTTON1;
+ }
+
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Buttons_GetStatus(void)
{
diff --git a/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h b/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h index 541da264c..e236ded16 100644 --- a/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h @@ -104,6 +104,17 @@ #endif
}
+ static inline void LEDs_Disable(void)
+ {
+ #if (BOARD == BOARD_USB2AX)
+ DDRC &= ~LEDS_ALL_LEDS;
+ PORTC &= ~LEDS_ALL_LEDS;
+ #else
+ DDRD &= ~LEDS_ALL_LEDS;
+ PORTD &= ~LEDS_ALL_LEDS;
+ #endif
+ }
+
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
#if (BOARD == BOARD_USB2AX)
diff --git a/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h b/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h index 21c6a1f2a..617ca2741 100644 --- a/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h b/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h index cb4625836..82f105103 100644 --- a/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h @@ -80,6 +80,12 @@ PORTD |= LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD &= ~LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h b/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h index 018bf6b12..3aa19b109 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h @@ -74,6 +74,12 @@ PORTE |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRE &= ~BUTTONS_BUTTON1; + PORTE &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h b/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h index 5e80a5368..fa7f218e4 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h @@ -91,11 +91,20 @@ #if !defined(__DOXYGEN__) static inline void Joystick_Init(void) { - DDRB &= ~(JOY_BMASK); - DDRE &= ~(JOY_EMASK); + DDRB &= ~JOY_BMASK; + DDRE &= ~JOY_EMASK; - PORTB |= JOY_BMASK; - PORTE |= JOY_EMASK; + PORTB |= JOY_BMASK; + PORTE |= JOY_EMASK; + } + + static inline void Joystick_Disable(void) + { + DDRB &= ~JOY_BMASK; + DDRE &= ~JOY_EMASK; + + PORTB &= ~JOY_BMASK; + PORTE &= ~JOY_EMASK; } static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h b/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h index e4a7002a5..e4a4db112 100644 --- a/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h @@ -89,6 +89,12 @@ PORTD &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_ALL_LEDS; + PORTD &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTD |= LEDMask; diff --git a/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h b/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h index 20cb34054..530c3ce37 100644 --- a/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h +++ b/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h @@ -74,6 +74,12 @@ PORTD |= BUTTONS_BUTTON1; } + static inline void Buttons_Disable(void) + { + DDRD &= ~BUTTONS_BUTTON1; + PORTD &= ~BUTTONS_BUTTON1; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h b/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h index 00cfd2b43..368f833af 100644 --- a/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h @@ -86,6 +86,12 @@ PORTB &= ~LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRB &= ~LEDS_ALL_LEDS; + PORTB &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LedMask) { PORTB |= LedMask; diff --git a/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h b/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h index 3abe98eeb..870d7a364 100644 --- a/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h +++ b/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h @@ -87,6 +87,12 @@ PORTB |= LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + DDRB &= ~LEDS_ALL_LEDS; + PORTB &= ~LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTB &= ~LEDMask; diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h index f60dbb50b..3dd89a943 100644 --- a/LUFA/Drivers/Board/Buttons.h +++ b/LUFA/Drivers/Board/Buttons.h @@ -141,13 +141,16 @@ /* Pseudo-Functions for Doxygen: */ #if defined(__DOXYGEN__) - /** Initializes the BUTTONS driver, so that the current button position can be read. This sets the appropriate + /** Initializes the buttons driver, so that the current button position can be read. This sets the appropriate * I/O pins to an inputs with pull-ups enabled. * * This must be called before any Button driver functions are used. */ static inline void Buttons_Init(void); + /** Disables the buttons driver, releasing the I/O pins back to their default high-impedence input mode. */ + static inline void Buttons_Disable(void); + /** Returns a mask indicating which board buttons are currently pressed. * * \return Mask indicating which board buttons are currently pressed. diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h index 95e90fadf..452689cdb 100644 --- a/LUFA/Drivers/Board/Joystick.h +++ b/LUFA/Drivers/Board/Joystick.h @@ -126,6 +126,9 @@ */ static inline void Joystick_Init(void); + /** Disables the joystick driver, releasing the I/O pins back to their default high-impedence input mode. */ + static inline void Joystick_Disable(void); + /** Returns the current status of the joystick, as a mask indicating the direction the joystick is * currently facing in (multiple bits can be set). * diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index e1f6b4c5c..839a059c8 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -205,6 +205,9 @@ */ static inline void LEDs_Init(void); + /** Disables the board LED driver, releasing the I/O pins back to their default high-impedence input mode. */ + static inline void LEDs_Disable(void); + /** Turns on the LEDs specified in the given LED mask. * * \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file). diff --git a/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h b/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h index 10f02cf6a..300e37ca2 100644 --- a/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h +++ b/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h @@ -86,6 +86,12 @@ AVR32_GPIO.port[BUTTONS_PORT].puers = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); } + static inline void Buttons_Disable(void) + { + AVR32_GPIO.port[BUTTONS_PORT].gperc = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); + AVR32_GPIO.port[BUTTONS_PORT].puerc = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); + } + static inline uint32_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint32_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h b/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h index aaf729b02..4bd618552 100644 --- a/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h +++ b/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h @@ -93,6 +93,12 @@ AVR32_GPIO.port[JOY_PORT].gpers = JOY_MASK; }; + static inline void Joystick_Disable(void) + { + AVR32_GPIO.port[JOY_PORT].gperc = JOY_MASK; + AVR32_GPIO.port[JOY_PORT].gperc = JOY_MASK; + }; + static inline uint32_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint32_t Joystick_GetStatus(void) { diff --git a/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h b/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h index 6fd1ac8c2..96ae1a7b9 100644 --- a/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h +++ b/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h @@ -109,6 +109,13 @@ AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + AVR32_GPIO.port[LEDS_PORT].gperc = LEDS_ALL_LEDS; + AVR32_GPIO.port[LEDS_PORT].oderc = LEDS_ALL_LEDS; + AVR32_GPIO.port[LEDS_PORT].ovrc = LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint32_t LEDMask) { AVR32_GPIO.port[LEDS_PORT].ovrc = LEDMask; diff --git a/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h b/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h index 18c711706..3ce1afe9b 100644 --- a/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h +++ b/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h @@ -83,6 +83,12 @@ AVR32_GPIO.port[BUTTONS_PORT].puers = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); } + static inline void Buttons_Disable(void) + { + AVR32_GPIO.port[BUTTONS_PORT].gperc = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); + AVR32_GPIO.port[BUTTONS_PORT].puerc = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); + } + static inline uint32_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint32_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h b/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h index 0481f8335..733490995 100644 --- a/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h +++ b/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h @@ -98,6 +98,15 @@ AVR32_GPIO.port[JOY_PRESS_PORT].puers = JOY_PRESS_MASK; }; + static inline void Joystick_Disable(void) + { + AVR32_GPIO.port[JOY_MOVE_PORT].gperc = JOY_MOVE_MASK; + AVR32_GPIO.port[JOY_PRESS_PORT].gperc = JOY_PRESS_MASK; + + AVR32_GPIO.port[JOY_MOVE_PORT].puerc = JOY_MOVE_MASK; + AVR32_GPIO.port[JOY_PRESS_PORT].puerc = JOY_PRESS_MASK; + }; + static inline uint32_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint32_t Joystick_GetStatus(void) { diff --git a/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h b/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h index 6feadbce3..65a34813f 100644 --- a/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h +++ b/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h @@ -96,6 +96,13 @@ AVR32_GPIO.port[LEDS_PORT].ovrs = LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + AVR32_GPIO.port[LEDS_PORT].gperc = LEDS_ALL_LEDS; + AVR32_GPIO.port[LEDS_PORT].oderc = LEDS_ALL_LEDS; + AVR32_GPIO.port[LEDS_PORT].ovrc = LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint32_t LEDMask) { AVR32_GPIO.port[LEDS_PORT].ovrc = LEDMask; diff --git a/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h b/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h index 934f92265..597c8e9b5 100644 --- a/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h +++ b/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h @@ -80,6 +80,12 @@ AVR32_GPIO.port[BUTTONS_PORT].puers = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); } + static inline void Buttons_Disable(void) + { + AVR32_GPIO.port[BUTTONS_PORT].gperc = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); + AVR32_GPIO.port[BUTTONS_PORT].puerc = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); + } + static inline uint32_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint32_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h b/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h index 5813e892c..6d25626c8 100644 --- a/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h +++ b/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h @@ -101,6 +101,17 @@ AVR32_GPIO.port[3].ovrs = LEDS_LEDMASK3; } + static inline void LEDs_Disable(void) + { + AVR32_GPIO.port[2].gperc = LEDS_LEDMASK2; + AVR32_GPIO.port[2].oderc = LEDS_LEDMASK2; + AVR32_GPIO.port[2].ovrc = LEDS_LEDMASK2; + + AVR32_GPIO.port[3].gperc = LEDS_LEDMASK3; + AVR32_GPIO.port[3].oderc = LEDS_LEDMASK3; + AVR32_GPIO.port[3].ovrc = LEDS_LEDMASK3; + } + static inline void LEDs_TurnOnLEDs(const uint32_t LEDMask) { AVR32_GPIO.port[2].ovrc = (LEDMask & LEDS_LEDMASK2); diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h index 1665fa4b1..6f6b875e4 100644 --- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h +++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h @@ -84,6 +84,16 @@ PORTF_PIN2CTRL = PORT_OPC_PULLUP_gc; } + static inline void Buttons_Disable(void) + { + PORTE_OUTCLR = BUTTONS_BUTTON1; + PORTF_OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3); + + PORTE_PIN5CTRL = 0; + PORTF_PIN1CTRL = 0; + PORTF_PIN2CTRL = 0; + } + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t Buttons_GetStatus(void) { diff --git a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h index d555ac211..f4a5d0e3b 100644 --- a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h +++ b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h @@ -83,6 +83,12 @@ PORTR_OUTSET = LEDS_ALL_LEDS; } + static inline void LEDs_Disable(void) + { + PORTR_DIRCLR = LEDS_ALL_LEDS; + PORTR_OUTCLR = LEDS_ALL_LEDS; + } + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTR_OUTCLR = LEDMask; |