diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-01-29 14:33:36 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-01-29 14:33:36 +0000 |
commit | 5563da6a626a7301e5064a8df8b3a9b03421f8aa (patch) | |
tree | 0d5ffd18c3d061f7b91443417ce61ff07b02af3e /LUFA/Drivers/Board/AVR8/STK525 | |
parent | a147cee95f5373902242e7b34b92f7103fc05ae4 (diff) | |
download | lufa-5563da6a626a7301e5064a8df8b3a9b03421f8aa.tar.gz lufa-5563da6a626a7301e5064a8df8b3a9b03421f8aa.tar.bz2 lufa-5563da6a626a7301e5064a8df8b3a9b03421f8aa.zip |
Added new LEDs_Disable(), Buttons_Disable() and Joystick_Disable() functions to the board hardware drivers.
Diffstat (limited to 'LUFA/Drivers/Board/AVR8/STK525')
-rw-r--r-- | LUFA/Drivers/Board/AVR8/STK525/Buttons.h | 6 | ||||
-rw-r--r-- | LUFA/Drivers/Board/AVR8/STK525/Joystick.h | 17 | ||||
-rw-r--r-- | LUFA/Drivers/Board/AVR8/STK525/LEDs.h | 6 |
3 files changed, 25 insertions, 4 deletions
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; |