1 /********************************************************************
3 * Parts of the DirectX code are from a tutorial by Microsoft
4 * which can be found in the Microsoft DirectX SDK June 2010.
5 * Copyright (c) Microsoft Corporation. All rights reserved.
8 * The rest of the code is COPYRIGHT PARROT 2010
10 ********************************************************************
11 * PARROT - A.R.Drone SDK Windows Client Example
12 *-----------------------------------------------------------------*/
15 * @brief Header file for the DirectInput gamepad management system.
17 * @author Stephane Piskorski <stephane.piskorski.ext@parrot.fr>
20 *******************************************************************/
29 #define GAMEPAD_LOGICTECH_ID 0x046dc21a
50 extern input_device_t dx_gamepad;
51 extern input_device_t dx_keyboard;
54 C_RESULT open_gamepad(void);
55 C_RESULT update_gamepad(void);
56 C_RESULT close_gamepad(void);
58 #define RADIO_GP_ID 0x061c0010
68 typedef enum _ANALOGIC_RADIO_COMMAND_GP
76 } ANALOGIC_RADIO_COMMAND_GP;
78 #define NUM_A_GP_MIN GP_ROLL
79 #define NUM_A_GP_MAX GP_MAX
81 #define OFFSET_PITCH_GP 127
82 #define OFFSET_ROLL_GP 127
83 #define OFFSET_YAW_GP 127
84 #define OFFSET_GAZ_GP 198
86 #define NUM_PITCH_GP -3
91 #define DEC_PITCH_GP 1
97 typedef enum _BUTTON_RADIO_COMMAND_GP
99 GP_BOARD_LEFT = 0, // switch above left joystick
100 GP_SIDE_RIGHT = 1, // right corner switch
101 GP_IMPULSE = 2, // Red button
102 GP_SIDE_LEFT_DOWN = 3, // left corner switch, down position
103 GP_SIDE_LEFT_UP = 4, // left corner switch, up position
105 } BUTTON_RADIO_COMMAND_GP;
107 #define NUM_B_GP_MIN GP_BOARD_LEFT
108 #define NUM_B_GP_MAX GP_MAX
109 extern input_device_t radioGP;
112 C_RESULT open_dx_gamepad(void);
113 C_RESULT update_dx_gamepad(void);
114 C_RESULT close_dx_gamepad(void);
116 C_RESULT open_dx_keyboard(void);
117 C_RESULT update_dx_keyboard(void);
118 C_RESULT close_dx_keyboard(void);
121 #endif // _GAMEPAD_H_