From 63a8f66d92b5d7018a4d962f4f7b23774a621771 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 6 May 2009 07:50:34 +0000 Subject: Changed HWB board driver to Buttons driver, to allow for the support of future boards with more than one mounted GPIO button. --- LUFA/ChangeLog.txt | 1 + LUFA/DriverStubs/Buttons.h | 87 +++++++++++++++++++++++++ LUFA/DriverStubs/HWB.h | 84 ------------------------ LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h | 84 ++++++++++++++++++++++++ LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h | 80 ----------------------- LUFA/Drivers/Board/Buttons.h | 105 ++++++++++++++++++++++++++++++ LUFA/Drivers/Board/HWB.h | 105 ------------------------------ LUFA/Drivers/Board/STK525/Buttons.h | 89 +++++++++++++++++++++++++ LUFA/Drivers/Board/STK525/Dataflash.h | 2 +- LUFA/Drivers/Board/STK525/HWB.h | 80 ----------------------- LUFA/Drivers/Board/STK526/Buttons.h | 89 +++++++++++++++++++++++++ LUFA/Drivers/Board/STK526/Dataflash.h | 2 +- LUFA/Drivers/Board/STK526/HWB.h | 79 ---------------------- LUFA/Drivers/Board/USBKEY/Buttons.h | 84 ++++++++++++++++++++++++ LUFA/Drivers/Board/USBKEY/Dataflash.h | 2 +- LUFA/Drivers/Board/USBKEY/HWB.h | 80 ----------------------- LUFA/MainPage.txt | 18 ++--- LUFA/MigrationInformation.txt | 1 + 18 files changed, 552 insertions(+), 520 deletions(-) create mode 100644 LUFA/DriverStubs/Buttons.h delete mode 100644 LUFA/DriverStubs/HWB.h create mode 100644 LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h delete mode 100644 LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h create mode 100644 LUFA/Drivers/Board/Buttons.h delete mode 100644 LUFA/Drivers/Board/HWB.h create mode 100644 LUFA/Drivers/Board/STK525/Buttons.h delete mode 100644 LUFA/Drivers/Board/STK525/HWB.h create mode 100644 LUFA/Drivers/Board/STK526/Buttons.h delete mode 100644 LUFA/Drivers/Board/STK526/HWB.h create mode 100644 LUFA/Drivers/Board/USBKEY/Buttons.h delete mode 100644 LUFA/Drivers/Board/USBKEY/HWB.h (limited to 'LUFA') diff --git a/LUFA/ChangeLog.txt b/LUFA/ChangeLog.txt index d538e35fd..98b82d35a 100644 --- a/LUFA/ChangeLog.txt +++ b/LUFA/ChangeLog.txt @@ -77,6 +77,7 @@ * - Fixed missing semicolon in the ATAVRUSBRF01 LED board driver code (thanks to Morten Lund) * - Changed LED board driver code to define dummy LED masks for the first four board LEDs, so that user code can be compiled for boards * with less than four LEDs without code modifications (thanks to Morten Lund) + * - Changed HWB board driver to Buttons driver, to allow for the support of future boards with more than one mounted GPIO button * * * \section Sec_ChangeLog090401 Version 090401 diff --git a/LUFA/DriverStubs/Buttons.h b/LUFA/DriverStubs/Buttons.h new file mode 100644 index 000000000..0d02e5c71 --- /dev/null +++ b/LUFA/DriverStubs/Buttons.h @@ -0,0 +1,87 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/* + This is a stub driver header file, for implementing custom board + layout hardware with compatible LUFA board specific drivers. If + the library is configured to use the BOARD_USER board mode, this + driver file should be completed and copied into the "/Board/" folder + inside the application's folder. + + This stub is for the board-specific component of the LUFA Buttons driver, + for the control of physical board-mounted GPIO pushbuttons. +*/ + +#ifndef __BUTTONS_USER_H__ +#define __BUTTONS_USER_H__ + + /* Includes: */ + #include + #include + + #include "../../../Common/Common.h" + + // TODO: Add any required includes here + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(INCLUDE_FROM_BUTTONS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Button mask for the first button on the board. */ + #define BUTTONS_BUTTON1 // TODO: Add mask for first board buton here + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(void) + { + // TODO: Initialize the appropriate port pins as an inputs here, with pull-ups + } + + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t Buttons_GetStatus(void) + { + // TODO: Return current button status here, debounced if required + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif diff --git a/LUFA/DriverStubs/HWB.h b/LUFA/DriverStubs/HWB.h deleted file mode 100644 index 4b7f20542..000000000 --- a/LUFA/DriverStubs/HWB.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - 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 - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/* - This is a stub driver header file, for implementing custom board - layout hardware with compatible LUFA board specific drivers. If - the library is configured to use the BOARD_USER board mode, this - driver file should be completed and copied into the "/Board/" folder - inside the application's folder. - - This stub is for the board-specific component of the LUFA HWB (Hardware - Button, a physical button on most Atmel USB boards) driver. This could - alternately be driven from any button connected to the USB AVR. -*/ - -#ifndef __HWB_USER_H__ -#define __HWB_USER_H__ - - /* Includes: */ - #include - #include - - #include "../../../Common/Common.h" - - // TODO: Add any required includes here - - /* Enable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - extern "C" { - #endif - - /* Preprocessor Checks: */ - #if !defined(INCLUDE_FROM_HWB_H) - #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead. - #endif - - /* Public Interface - May be used in end-application: */ - /* Inline Functions: */ - #if !defined(__DOXYGEN__) - static inline void HWB_Init(void) - { - // TODO: Initialize the appropriate port pin as an input here, with pull-up - } - - static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - static inline bool HWB_GetStatus(void) - { - // TODO: Return current button status here, debounced if required - } - #endif - - /* Disable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - } - #endif - -#endif diff --git a/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h b/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h new file mode 100644 index 000000000..29cc4e362 --- /dev/null +++ b/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h @@ -0,0 +1,84 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Board specific Buttons driver header for the ATAVRUSBRF01. + * + * \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. + */ + +#ifndef __BUTTONS_ATAVRUSBRF01_H__ +#define __BUTTONS_ATAVRUSBRF01_H__ + + /* Includes: */ + #include + #include + + #include "../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(INCLUDE_FROM_BUTTONS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Button mask for the first button on the board. */ + #define BUTTONS_BUTTON1 (1 << 7) + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(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) + { + return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + diff --git a/LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h b/LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h deleted file mode 100644 index 87426de16..000000000 --- a/LUFA/Drivers/Board/ATAVRUSBRF01/HWB.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - 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 - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Board specific HWB driver header for the ATAVRUSBRF01. - * - * \note This file should not be included directly. It is automatically included as needed by the HWB driver - * dispatch header located in LUFA/Drivers/Board/HWB.h. - */ - -#ifndef __HWB_ATAVRUSBRF01_H__ -#define __HWB_ATAVRUSBRF01_H__ - - /* Includes: */ - #include - #include - - #include "../../../Common/Common.h" - - /* Enable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - extern "C" { - #endif - - /* Preprocessor Checks: */ - #if !defined(INCLUDE_FROM_HWB_H) - #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead. - #endif - - /* Public Interface - May be used in end-application: */ - /* Inline Functions: */ - #if !defined(__DOXYGEN__) - static inline void HWB_Init(void) - { - DDRD &= ~(1 << 7); - PORTD |= (1 << 7); - } - - static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - static inline bool HWB_GetStatus(void) - { - return (!(PIND & (1 << 7))); - } - #endif - - /* Disable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - } - #endif - -#endif - diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h new file mode 100644 index 000000000..46d147345 --- /dev/null +++ b/LUFA/Drivers/Board/Buttons.h @@ -0,0 +1,105 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * This file is the master dispatch header file for the board-specific Buttons driver, for boards containing + * physical pushbuttons connected to the AVR's GPIO pins. + * + * User code should include this file, which will in turn include the correct Button driver header file for the + * currently selected board. + * + * If the BOARD value is set to BOARD_USER, this will include the /Board/Buttons.h file in the user project + * directory. + */ + +/** \ingroup Group_BoardDrivers + * @defgroup Group_Buttons Buttons Driver - LUFA/Drivers/Board/Buttons.h + * + * \section Sec_Dependencies Module Source Dependencies + * The following files must be built with any user project that uses this module: + * - None + * + * \section Module Description + * Functions, macros, variables, enums and types related to the control of physical board GPIO buttons. + * + * If the BOARD value is set to BOARD_USER, this will include the /Board/Dataflash.h file in the user project + * directory. Otherwise, it will include the appropriate built in board driver header file. + * + * @{ + */ + +#ifndef __BUTTONS_H__ +#define __BUTTONS_H__ + + /* Macros: */ + #if !defined(__DOXYGEN__) + #define INCLUDE_FROM_BUTTONS_H + #define INCLUDE_FROM_BOARD_DRIVER + #endif + + /* Includes: */ + #include "../../Common/Common.h" + + #if !defined(BOARD) + #error BOARD must be set in makefile to a value specified in BoardTypes.h. + #elif (BOARD == BOARD_USBKEY) + #include "USBKEY/BUTTONS.h" + #elif (BOARD == BOARD_STK525) + #include "STK525/BUTTONS.h" + #elif (BOARD == BOARD_STK526) + #include "STK526/BUTTONS.h" + #elif (BOARD == BOARD_ATAVRUSBRF01) + #include "ATAVRUSBRF01/BUTTONS.h" + #elif (BOARD == BOARD_USER) + #include "Board/BUTTONS.h" + #else + #error The selected board does not contain any GPIO buttons. + #endif + + /* Pseudo-Functions for Doxygen: */ + #if defined(__DOXYGEN__) + /** 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); + + /** Returns a mask indicating which board buttons are currently pressed. + * + * \return Mask indicating which board buttons are currently pressed + */ + static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + #endif + +#endif + +/** @} */ diff --git a/LUFA/Drivers/Board/HWB.h b/LUFA/Drivers/Board/HWB.h deleted file mode 100644 index f6221afd3..000000000 --- a/LUFA/Drivers/Board/HWB.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - 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 - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * This file is the master dispatch header file for the board-specific HWB driver, for boards containing a - * physical pushbutton connected to the AVR's HWB IO pin. - * - * User code should include this file, which will in turn include the correct HWB driver header file for the - * currently selected board. - * - * If the BOARD value is set to BOARD_USER, this will include the /Board/HWB.h file in the user project - * directory. - */ - -/** \ingroup Group_BoardDrivers - * @defgroup Group_HWB HWB Driver - LUFA/Drivers/Board/HWB.h - * - * \section Sec_Dependencies Module Source Dependencies - * The following files must be built with any user project that uses this module: - * - None - * - * \section Module Description - * Functions, macros, variables, enums and types related to the control of board HWB. - * - * If the BOARD value is set to BOARD_USER, this will include the /Board/Dataflash.h file in the user project - * directory. Otherwise, it will include the appropriate built in board driver header file. - * - * @{ - */ - -#ifndef __HWB_H__ -#define __HWB_H__ - - /* Macros: */ - #if !defined(__DOXYGEN__) - #define INCLUDE_FROM_HWB_H - #define INCLUDE_FROM_BOARD_DRIVER - #endif - - /* Includes: */ - #include "../../Common/Common.h" - - #if !defined(BOARD) - #error BOARD must be set in makefile to a value specified in BoardTypes.h. - #elif (BOARD == BOARD_USBKEY) - #include "USBKEY/HWB.h" - #elif (BOARD == BOARD_STK525) - #include "STK525/HWB.h" - #elif (BOARD == BOARD_STK526) - #include "STK526/HWB.h" - #elif (BOARD == BOARD_ATAVRUSBRF01) - #include "ATAVRUSBRF01/HWB.h" - #elif (BOARD == BOARD_USER) - #include "Board/HWB.h" - #else - #error The selected board does not contain a HWB. - #endif - - /* Pseudo-Functions for Doxygen: */ - #if defined(__DOXYGEN__) - /** Initializes the HWB driver, so that the current button position can be read. This sets the appropriate - * I/O pin to an input with pull-up enabled. - * - * This must be called before any HWB functions are used. - */ - static inline void HWB_Init(void); - - /** Returns the current position of the HWB button on the board. - * - * \return Boolean true if the button is currently pressed, false otherwise - */ - static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - #endif - -#endif - -/** @} */ diff --git a/LUFA/Drivers/Board/STK525/Buttons.h b/LUFA/Drivers/Board/STK525/Buttons.h new file mode 100644 index 000000000..dc7aca733 --- /dev/null +++ b/LUFA/Drivers/Board/STK525/Buttons.h @@ -0,0 +1,89 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Board specific Buttons driver header for the STK525. + * + * \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. + */ + +#ifndef __BUTTONS_STK525_H__ +#define __BUTTONS_STK525_H__ + + /* Includes: */ + #include + #include + + #include "../../../Common/Common.h" + + /* Includes: */ + #include + #include + + #include "../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(INCLUDE_FROM_BUTTONS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Button mask for the first button on the board. */ + #define BUTTONS_BUTTON1 (1 << 2) + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(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) + { + return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif diff --git a/LUFA/Drivers/Board/STK525/Dataflash.h b/LUFA/Drivers/Board/STK525/Dataflash.h index b2ea1b8e9..bc9ab9fbd 100644 --- a/LUFA/Drivers/Board/STK525/Dataflash.h +++ b/LUFA/Drivers/Board/STK525/Dataflash.h @@ -30,7 +30,7 @@ /** \file * - * Board specific HWB driver header for the STK525. + * Board specific Dataflash driver header for the STK525. * * \note This file should not be included directly. It is automatically included as needed by the dataflash driver * dispatch header located in LUFA/Drivers/Board/Dataflash.h. diff --git a/LUFA/Drivers/Board/STK525/HWB.h b/LUFA/Drivers/Board/STK525/HWB.h deleted file mode 100644 index 2200453ee..000000000 --- a/LUFA/Drivers/Board/STK525/HWB.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - 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 - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Board specific HWB driver header for the STK525. - * - * \note This file should not be included directly. It is automatically included as needed by the HWB driver - * dispatch header located in LUFA/Drivers/Board/HWB.h. - */ - -#ifndef __HWB_STK525_H__ -#define __HWB_STK525_H__ - - /* Includes: */ - #include - #include - - #include "../../../Common/Common.h" - - /* Enable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - extern "C" { - #endif - - /* Preprocessor Checks: */ - #if !defined(INCLUDE_FROM_HWB_H) - #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead. - #endif - - /* Public Interface - May be used in end-application: */ - /* Inline Functions: */ - #if !defined(__DOXYGEN__) - static inline void HWB_Init(void) - { - DDRE &= ~(1 << 2); - PORTE |= (1 << 2); - } - - static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - static inline bool HWB_GetStatus(void) - { - return (!(PINE & (1 << 2))); - } - #endif - - /* Disable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - } - #endif - -#endif - diff --git a/LUFA/Drivers/Board/STK526/Buttons.h b/LUFA/Drivers/Board/STK526/Buttons.h new file mode 100644 index 000000000..fba578cb2 --- /dev/null +++ b/LUFA/Drivers/Board/STK526/Buttons.h @@ -0,0 +1,89 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Board specific Buttons driver header for the STK526. + * + * \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. + */ + +#ifndef __BUTTONS_STK526_H__ +#define __BUTTONS_STK526_H__ + + /* Includes: */ + #include + #include + + #include "../../../Common/Common.h" + + /* Includes: */ + #include + #include + + #include "../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(INCLUDE_FROM_BUTTONS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Button mask for the first button on the board. */ + #define BUTTONS_BUTTON1 (1 << 2) + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(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) + { + return ((PIND & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif diff --git a/LUFA/Drivers/Board/STK526/Dataflash.h b/LUFA/Drivers/Board/STK526/Dataflash.h index 65c5e202c..cb8193e56 100644 --- a/LUFA/Drivers/Board/STK526/Dataflash.h +++ b/LUFA/Drivers/Board/STK526/Dataflash.h @@ -30,7 +30,7 @@ /** \file * - * Board specific HWB driver header for the STK525. + * Board specific Dataflash driver header for the STK525. * * \note This file should not be included directly. It is automatically included as needed by the dataflash driver * dispatch header located in LUFA/Drivers/Board/Dataflash.h. diff --git a/LUFA/Drivers/Board/STK526/HWB.h b/LUFA/Drivers/Board/STK526/HWB.h deleted file mode 100644 index 6f1861bc1..000000000 --- a/LUFA/Drivers/Board/STK526/HWB.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - 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 - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Board specific HWB driver header for the STK526. - * - * \note This file should not be included directly. It is automatically included as needed by the HWB driver - * dispatch header located in LUFA/Drivers/Board/HWB.h. - */ - -#ifndef __HWB_STK526_H__ -#define __HWB_STK526_H__ - - /* Includes: */ - #include - #include - - #include "../../../Common/Common.h" - - /* Enable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - extern "C" { - #endif - - /* Preprocessor Checks: */ - #if !defined(INCLUDE_FROM_HWB_H) - #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead. - #endif - - /* Public Interface - May be used in end-application: */ - /* Inline Functions: */ - #if !defined(__DOXYGEN__) - static inline void HWB_Init(void) - { - DDRD &= ~(1 << 7); - PORTD |= (1 << 7); - } - - static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - static inline bool HWB_GetStatus(void) - { - return (!(PIND & (1 << 7))); - } - #endif - - /* Disable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - } - #endif - -#endif diff --git a/LUFA/Drivers/Board/USBKEY/Buttons.h b/LUFA/Drivers/Board/USBKEY/Buttons.h new file mode 100644 index 000000000..78c5b5662 --- /dev/null +++ b/LUFA/Drivers/Board/USBKEY/Buttons.h @@ -0,0 +1,84 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2009. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com +*/ + +/* + Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * + * Board specific Buttons driver header for the USBKEY. + * + * \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. + */ + +#ifndef __BUTTONS_USBKEY_H__ +#define __BUTTONS_USBKEY_H__ + + /* Includes: */ + #include + #include + + #include "../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(INCLUDE_FROM_BUTTONS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Buttons.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Button mask for the first button on the board. */ + #define BUTTONS_BUTTON1 (1 << 2) + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void Buttons_Init(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) + { + return ((PINE & BUTTONS_BUTTON1) ^ BUTTONS_BUTTON1); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + diff --git a/LUFA/Drivers/Board/USBKEY/Dataflash.h b/LUFA/Drivers/Board/USBKEY/Dataflash.h index cae62fd49..d4bfdc943 100644 --- a/LUFA/Drivers/Board/USBKEY/Dataflash.h +++ b/LUFA/Drivers/Board/USBKEY/Dataflash.h @@ -30,7 +30,7 @@ /** \file * - * Board specific HWB driver header for the STK525. + * Board specific Dataflash driver header for the STK525. * * \note This file should not be included directly. It is automatically included as needed by the dataflash driver * dispatch header located in LUFA/Drivers/Board/Dataflash.h. diff --git a/LUFA/Drivers/Board/USBKEY/HWB.h b/LUFA/Drivers/Board/USBKEY/HWB.h deleted file mode 100644 index 13af186a0..000000000 --- a/LUFA/Drivers/Board/USBKEY/HWB.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2009. - - dean [at] fourwalledcubicle [dot] com - www.fourwalledcubicle.com -*/ - -/* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - 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 - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * - * Board specific HWB driver header for the USBKEY. - * - * \note This file should not be included directly. It is automatically included as needed by the HWB driver - * dispatch header located in LUFA/Drivers/Board/HWB.h. - */ - -#ifndef __HWB_USBKEY_H__ -#define __HWB_USBKEY_H__ - - /* Includes: */ - #include - #include - - #include "../../../Common/Common.h" - - /* Enable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - extern "C" { - #endif - - /* Preprocessor Checks: */ - #if !defined(INCLUDE_FROM_HWB_H) - #error Do not include this file directly. Include LUFA/Drivers/Board/HWB.h instead. - #endif - - /* Public Interface - May be used in end-application: */ - /* Inline Functions: */ - #if !defined(__DOXYGEN__) - static inline void HWB_Init(void) - { - DDRE &= ~(1 << 2); - PORTE |= (1 << 2); - } - - static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - static inline bool HWB_GetStatus(void) - { - return (!(PINE & (1 << 2))); - } - #endif - - /* Disable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - } - #endif - -#endif - diff --git a/LUFA/MainPage.txt b/LUFA/MainPage.txt index 1f18d0f41..9dc8a18d4 100644 --- a/LUFA/MainPage.txt +++ b/LUFA/MainPage.txt @@ -15,15 +15,15 @@ * microcontrollers, released under the MIT license. * * Currently supported AVR models: - * - AT90USB1286 - * - AT90USB1287 - * - AT90USB646 - * - AT90USB647 - * - AT90USB162 - * - AT90USB82 - * - ATMEGA16U4 - * - ATMEGA32U6 - * - ATMEGA32U4 + * - AT90USB1286 (USB Host and Device) + * - AT90USB1287 (USB Host and Device) + * - AT90USB646 (USB Device Only) + * - AT90USB647 (USB Device Only) + * - AT90USB162 (USB Device Only) + * - AT90USB82 (USB Device Only) + * - ATMEGA16U4 (USB Device Only) + * - ATMEGA32U6 (USB Device Only) + * - ATMEGA32U4 (USB Device Only) * * Currently supported Atmel boards: * - AT90USBKEY diff --git a/LUFA/MigrationInformation.txt b/LUFA/MigrationInformation.txt index 0e384f930..6439419f3 100644 --- a/LUFA/MigrationInformation.txt +++ b/LUFA/MigrationInformation.txt @@ -17,6 +17,7 @@ * BUTTLOADTAG elements, or download and extract ButtLoadTag.h header from the ButtLoad project. * - The Drivers/AT90USBXXX directory has been renamed to Drivers/Peripheral. * - The Serial_Stream driver has been renamed to SerialStream to remain consistent with the rest of the library naming scheme. + * - The HWB driver has changed to the Buttons driver. See the board Buttons driver documentation for the new API. * * Dual Role Mode * - The USB_PowerOnFail even has been renamed to USB_InitFailure. -- cgit v1.2.3