// 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)
{
// 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)
{
// 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
* - 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)
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;
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)
{
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);
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)
{
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;
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;
#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)
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)
{
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;
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;
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)
{
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;
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)
{
#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;
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;
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)
{
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;
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;
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)
{
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;
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)
{
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;
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)
{
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;
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);
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;
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)
{
#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;
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;
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)
{
{
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;
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;
#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)
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)
{
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;
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)
{
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);
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;
PORTD |= BUTTONS_BUTTON1;\r
}\r
\r
+ static inline void Buttons_Disable(void)\r
+ {\r
+ DDRD &= ~BUTTONS_BUTTON1;\r
+ PORTD &= ~BUTTONS_BUTTON1;\r
+ }\r
+\r
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;\r
static inline uint8_t Buttons_GetStatus(void)\r
{\r
#endif \r
}\r
\r
+ static inline void LEDs_Disable(void)\r
+ {\r
+ #if (BOARD == BOARD_USB2AX)\r
+ DDRC &= ~LEDS_ALL_LEDS;\r
+ PORTC &= ~LEDS_ALL_LEDS; \r
+ #else\r
+ DDRD &= ~LEDS_ALL_LEDS;\r
+ PORTD &= ~LEDS_ALL_LEDS; \r
+ #endif \r
+ }\r
+\r
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)\r
{\r
#if (BOARD == BOARD_USB2AX)\r
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)
{
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;
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)
{
#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;
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;
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)
{
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;
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;
/* 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.
*/
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).
*
*/
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).
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)
{
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)
{
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;
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)
{
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)
{
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;
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)
{
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);
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)
{
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;