Added new LEDs_Disable(), Buttons_Disable() and Joystick_Disable() functions to the board hardware drivers.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user