Commit 5563da6a authored by Dean Camera's avatar Dean Camera
Browse files

Added new LEDs_Disable(), Buttons_Disable() and Joystick_Disable() functions...

Added new LEDs_Disable(), Buttons_Disable() and Joystick_Disable() functions to the board hardware drivers.
parent a147cee9
......@@ -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)
{
......
......@@ -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)
{
......
......@@ -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
......
......@@ -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)
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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);
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment