Clean up CORE build system mode makefile.
[pub/USBasp.git] / LUFA / Drivers / Board / Joystick.h
index 649b128..2f90a9c 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   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
 
   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.
  *
  *  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.
  *  directory. Otherwise, it will include the appropriate built in board driver header file.
  *
  *  For possible \c BOARD makefile values, see \ref Group_BoardTypes.
  *  application.
  *
  *  \code
  *  application.
  *
  *  \code
- *      // Initialise the board Joystick driver before first use
+ *      // Initialize the board Joystick driver before first use
  *      Joystick_Init();
  *      Joystick_Init();
- *
+ *      
  *      printf("Waiting for joystick movement...\r\n");
  *      printf("Waiting for joystick movement...\r\n");
- *
+ *      
  *      // Loop until a the joystick has been moved
  *      uint8_t JoystickMovement;
  *      while (!(JoystickMovement = Joystick_GetStatus())) {};
  *      // 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");
  *      // 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_LEFT | JOY_RIGHT))
  *        printf("%s ", (JoystickMovement & JOY_LEFT) ? "Left" : "Right");
- *
- *      if (JoystickMovement & JOY_PRESSED)
+ *      
+ *      if (JoystickMovement & JOY_PRESS)
  *        printf("Pressed");
  *  \endcode
  *
  *        printf("Pressed");
  *  \endcode
  *
 #define __JOYSTICK_H__
 
        /* Macros: */
 #define __JOYSTICK_H__
 
        /* Macros: */
-       #if !defined(__DOXYGEN__)
                #define __INCLUDE_FROM_JOYSTICK_H
                #define __INCLUDE_FROM_JOYSTICK_H
-               #define INCLUDE_FROM_JOYSTICK_H
-       #endif
 
        /* Includes: */
 
        /* Includes: */
-       #include "../../Common/Common.h"
-
-       #if (BOARD == BOARD_NONE)
-               #error The Board Joystick driver cannot be used if the makefile BOARD option is not set.
-       #elif (BOARD == BOARD_USBKEY)
-               #include "USBKEY/Joystick.h"
-       #elif (BOARD == BOARD_STK525)
-               #include "STK525/Joystick.h"
-       #elif (BOARD == BOARD_STK526)
-               #include "STK526/Joystick.h"
-       #elif (BOARD == BOARD_BUMBLEB)
-               #include "BUMBLEB/Joystick.h"
-       #elif (BOARD == BOARD_EVK527)
-               #include "EVK527/Joystick.h"
-       #elif (BOARD == BOARD_EVK1101)
-               #include "EVK1101/Joystick.h"
-       #else
-               #include "Board/Joystick.h"
-       #endif
+               #include "../../Common/Common.h"
+
+               #if (BOARD == BOARD_NONE)
+                       #error The Board Joystick driver cannot be used if the makefile BOARD option is not set.
+               #elif (BOARD == BOARD_USBKEY)
+                       #include "AVR8/USBKEY/Joystick.h"
+               #elif (BOARD == BOARD_STK525)
+                       #include "AVR8/STK525/Joystick.h"
+               #elif (BOARD == BOARD_STK526)
+                       #include "AVR8/STK526/Joystick.h"
+               #elif (BOARD == BOARD_BUMBLEB)
+                       #include "AVR8/BUMBLEB/Joystick.h"
+               #elif (BOARD == BOARD_EVK527)
+                       #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__)
 
        /* Pseudo-Functions for Doxygen: */
        #if defined(__DOXYGEN__)
-               /** Initialises the joystick driver so that the joystick position can be read. This sets the appropriate
+               /** 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);
 
                 *  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.
                 */
                /** 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 uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
+               static inline uint_reg_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
        #endif
 
 #endif
        #endif
 
 #endif