Fixed missing semicolon in the ATAVRUSBRF01 LED board driver code, changed LED board...
[pub/USBasp.git] / LUFA / Drivers / Board / HWB.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2009.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
7 */
8
9 /*
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, and distribute this software
13 and its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 /** \file
32 *
33 * This file is the master dispatch header file for the board-specific HWB driver, for boards containing a
34 * physical pushbutton connected to the AVR's HWB IO pin.
35 *
36 * User code should include this file, which will in turn include the correct HWB driver header file for the
37 * currently selected board.
38 *
39 * If the BOARD value is set to BOARD_USER, this will include the /Board/HWB.h file in the user project
40 * directory.
41 */
42
43 /** \ingroup Group_BoardDrivers
44 * @defgroup Group_HWB HWB Driver - LUFA/Drivers/Board/HWB.h
45 *
46 * \section Sec_Dependencies Module Source Dependencies
47 * The following files must be built with any user project that uses this module:
48 * - None
49 *
50 * \section Module Description
51 * Functions, macros, variables, enums and types related to the control of board HWB.
52 *
53 * If the BOARD value is set to BOARD_USER, this will include the /Board/Dataflash.h file in the user project
54 * directory. Otherwise, it will include the appropriate built in board driver header file.
55 *
56 * @{
57 */
58
59 #ifndef __HWB_H__
60 #define __HWB_H__
61
62 /* Macros: */
63 #if !defined(__DOXYGEN__)
64 #define INCLUDE_FROM_HWB_H
65 #define INCLUDE_FROM_BOARD_DRIVER
66 #endif
67
68 /* Includes: */
69 #include "../../Common/Common.h"
70
71 #if !defined(BOARD)
72 #error BOARD must be set in makefile to a value specified in BoardTypes.h.
73 #elif (BOARD == BOARD_USBKEY)
74 #include "USBKEY/HWB.h"
75 #elif (BOARD == BOARD_STK525)
76 #include "STK525/HWB.h"
77 #elif (BOARD == BOARD_STK526)
78 #include "STK526/HWB.h"
79 #elif (BOARD == BOARD_ATAVRUSBRF01)
80 #include "ATAVRUSBRF01/HWB.h"
81 #elif (BOARD == BOARD_USER)
82 #include "Board/HWB.h"
83 #else
84 #error The selected board does not contain a HWB.
85 #endif
86
87 /* Pseudo-Functions for Doxygen: */
88 #if defined(__DOXYGEN__)
89 /** Initializes the HWB driver, so that the current button position can be read. This sets the appropriate
90 * I/O pin to an input with pull-up enabled.
91 *
92 * This must be called before any HWB functions are used.
93 */
94 static inline void HWB_Init(void);
95
96 /** Returns the current position of the HWB button on the board.
97 *
98 * \return Boolean true if the button is currently pressed, false otherwise
99 */
100 static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
101 #endif
102
103 #endif
104
105 /** @} */