3 Copyright (C) Dean Camera, 2009.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
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.
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
32 This is a stub driver header file, for implementing custom board
33 layout hardware with compatible LUFA board specific drivers. If
34 the library is configured to use the BOARD_USER board mode, this
35 driver file should be completed and copied into the "/Board/" folder
36 inside the application's folder.
38 This stub is for the board-specific component of the LUFA Joystick
39 driver, a small surface mount four-way (plus button) digital joystick
40 on most USB AVR boards.
43 #ifndef __JOYSTICK_USER_H__
44 #define __JOYSTICK_USER_H__
49 #include "../../../Common/Common.h"
51 // TODO: Add any required includes here
53 /* Enable C linkage for C++ Compilers: */
54 #if defined(__cplusplus)
58 /* Preprocessor Checks: */
59 #if !defined(INCLUDE_FROM_JOYSTICK_H)
60 #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
63 /* Public Interface - May be used in end-application: */
65 /** Mask for the joystick being pushed in the left direction. */
66 #define JOY_LEFT // TODO: Add mask to indicate joystick left position here
68 /** Mask for the joystick being pushed in the right direction. */
69 #define JOY_RIGHT // TODO: Add mask to indicate joystick right position here
71 /** Mask for the joystick being pushed in the upward direction. */
72 #define JOY_UP // TODO: Add mask to indicate joystick up position here
74 /** Mask for the joystick being pushed in the downward direction. */
75 #define JOY_DOWN // TODO: Add mask to indicate joystick down position here
77 /** Mask for the joystick being pushed inward. */
78 #define JOY_PRESS // TODO: Add mask to indicate joystick pressed position here
80 /* Inline Functions: */
81 #if !defined(__DOXYGEN__)
82 static inline void Joystick_Init(void)
84 // TODO: Initialize joystick port pins as inputs with pull-ups
87 static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT
;
88 static inline uint8_t Joystick_GetStatus(void)
90 // TODO: Return current joystick position data which can be obtained by masking against the JOY_* macros
94 /* Disable C linkage for C++ Compilers: */
95 #if defined(__cplusplus)