X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/aae20139b90521cf1d1b17fdcb3ff9d42ecdf937..a85fa30bf1ee319d3d58f7970a4b1ef7e39d92ba:/LUFA/Drivers/Board/EVK1101/Buttons.h diff --git a/LUFA/Drivers/Board/EVK1101/Buttons.h b/LUFA/Drivers/Board/EVK1101/Buttons.h index b827787c7..416569461 100644 --- a/LUFA/Drivers/Board/EVK1101/Buttons.h +++ b/LUFA/Drivers/Board/EVK1101/Buttons.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2010. + Copyright (C) Dean Camera, 2009. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -29,24 +29,22 @@ */ /** \file - * - * Board specific Buttons driver header for the EVK1101. + * \brief Board specific Buttons driver header for the Atmel EVK1101. + * \copydetails Group_Buttons_EVK1101 * * \note This file should not be included directly. It is automatically included as needed by the Buttons driver * dispatch header located in LUFA/Drivers/Board/Buttons.h. */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_EVK1101 EVK1101 - * - * Board specific Buttons driver header for the EVK1101. + * \defgroup Group_Buttons_EVK1101 EVK1101 + * \brief Board specific Buttons driver header for the Atmel EVK1101. * - * \note This file should not be included directly. It is automatically included as needed by the Buttons driver - * dispatch header located in LUFA/Drivers/Board/Buttons.h. + * Board specific Buttons driver header for the Atmel EVK1101. * * @{ */ - + #ifndef __BUTTONS_EVK1101_H__ #define __BUTTONS_EVK1101_H__ @@ -66,26 +64,32 @@ #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. #endif + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define BUTTONS_PORT 1 + #endif + /* Public Interface - May be used in end-application: */ /* Macros: */ - /** Button mask for the first button on the board. */ - #define BUTTONS_BUTTON1 (1UL << 2) - - /** Button mask for the second button on the board. */ - #define BUTTONS_BUTTON2 (1UL << 3) + /** Mask of the first button on the board */ + #define BUTTONS_BUTTON1 (1UL << 2) + + /** Mask of the second button on the board */ + #define BUTTONS_BUTTON2 (1UL << 3) /* Inline Functions: */ #if !defined(__DOXYGEN__) static inline void Buttons_Init(void) { - AVR32_GPIO.port[1].gpers = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); - AVR32_GPIO.port[1].puers = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); + AVR32_GPIO.port[BUTTONS_PORT].gpers = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); + AVR32_GPIO.port[BUTTONS_PORT].puers = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2); } static inline uint32_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; static inline uint32_t Buttons_GetStatus(void) { - return (~AVR32_GPIO.port[1].pvr & (BUTTONS_BUTTON1 | BUTTONS_BUTTON2)); + return (~(AVR32_GPIO.port[JOY_MOVE_PORT].pvr & (BUTTONS_BUTTON1 | BUTTONS_BUTTON2))); } #endif