X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f01a05415c03b0dd61297849ece2cfcce7f8d3e8..a5abb0eb3f368f0f090ebfd7f9fc22e94466f31e:/LUFA/Drivers/Board/Joystick.h diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h index c517a752b..2f90a9ca3 100644 --- a/LUFA/Drivers/Board/Joystick.h +++ b/LUFA/Drivers/Board/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2012 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 @@ -55,7 +55,7 @@ * Hardware Joystick driver. This module provides an easy to use interface to control the hardware digital Joystick * located on many boards. * - * If the \c BOARD value is set to \c BOARD_USER, this will include the \c /Board/Dataflash.h file in the user project + * If the \c BOARD value is set to \c BOARD_USER, this will include the \c /Board/Joystick.h file in the user project * directory. Otherwise, it will include the appropriate built in board driver header file. * * For possible \c BOARD makefile values, see \ref Group_BoardTypes. @@ -67,23 +67,23 @@ * \code * // Initialize the board Joystick driver before first use * Joystick_Init(); - * + * * printf("Waiting for joystick movement...\r\n"); - * + * * // Loop until a the joystick has been moved * uint8_t JoystickMovement; * while (!(JoystickMovement = Joystick_GetStatus())) {}; - * + * * // Display which direction the joystick was moved in * printf("Joystick moved:\r\n"); * * if (JoystickMovement & (JOY_UP | JOY_DOWN)) * printf("%s ", (JoystickMovement & JOY_UP) ? "Up" : "Down"); - * + * * if (JoystickMovement & (JOY_LEFT | JOY_RIGHT)) * printf("%s ", (JoystickMovement & JOY_LEFT) ? "Left" : "Right"); - * - * if (JoystickMovement & JOY_PRESSED) + * + * if (JoystickMovement & JOY_PRESS) * printf("Pressed"); * \endcode * @@ -113,25 +113,30 @@ #include "AVR8/EVK527/Joystick.h" #elif (BOARD == BOARD_EVK1101) #include "UC3/EVK1101/Joystick.h" + #elif (BOARD == BOARD_EVK1100) + #include "UC3/EVK1100/Joystick.h" #else #include "Board/Joystick.h" #endif - /* Pseudo-Functions for Doxygen: */ - #if defined(__DOXYGEN__) - /** Initializes the joystick driver so that the joystick position can be read. This sets the appropriate - * I/O pins to inputs with their pull-ups enabled. - */ - static inline void Joystick_Init(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). - * - * \return Mask indicating the joystick direction - see corresponding board specific Joystick.h file - * for direction masks. - */ - static inline uint_reg_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; - #endif + /* Pseudo-Functions for Doxygen: */ + #if defined(__DOXYGEN__) + /** Initializes the joystick driver so that the joystick position can be read. This sets the appropriate + * I/O pins to inputs with their pull-ups enabled. + */ + static inline void Joystick_Init(void); + + /** Disables the joystick driver, releasing the I/O pins back to their default high-impedance 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). + * + * \return Mask indicating the joystick direction - see corresponding board specific Joystick.h file + * for direction masks. + */ + static inline uint_reg_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT; + #endif #endif