aboutsummaryrefslogtreecommitdiff
path: root/lib/usbhost/USB_Host_Shield_2.0/controllerEnums.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/usbhost/USB_Host_Shield_2.0/controllerEnums.h')
-rw-r--r--lib/usbhost/USB_Host_Shield_2.0/controllerEnums.h204
1 files changed, 204 insertions, 0 deletions
diff --git a/lib/usbhost/USB_Host_Shield_2.0/controllerEnums.h b/lib/usbhost/USB_Host_Shield_2.0/controllerEnums.h
new file mode 100644
index 000000000..0169c763c
--- /dev/null
+++ b/lib/usbhost/USB_Host_Shield_2.0/controllerEnums.h
@@ -0,0 +1,204 @@
1/* Copyright (C) 2013 Kristian Lauszus, TKJ Electronics. All rights reserved.
2
3 This software may be distributed and modified under the terms of the GNU
4 General Public License version 2 (GPL2) as published by the Free Software
5 Foundation and appearing in the file GPL2.TXT included in the packaging of
6 this file. Please note that GPL2 Section 2[b] requires that all works based
7 on this software must also be made publicly available under the terms of
8 the GPL2 ("Copyleft").
9
10 Contact information
11 -------------------
12
13 Kristian Lauszus, TKJ Electronics
14 Web : http://www.tkjelectronics.com
15 e-mail : kristianl@tkjelectronics.com
16 */
17
18#ifndef _controllerenums_h
19#define _controllerenums_h
20
21/**
22 * This header file is used to store different enums for the controllers,
23 * This is necessary so all the different libraries can be used at once.
24 */
25
26/** Enum used to turn on the LEDs on the different controllers. */
27enum LEDEnum {
28 OFF = 0,
29 LED1 = 1,
30 LED2 = 2,
31 LED3 = 3,
32 LED4 = 4,
33
34 LED5 = 5,
35 LED6 = 6,
36 LED7 = 7,
37 LED8 = 8,
38 LED9 = 9,
39 LED10 = 10,
40 /** Used to blink all LEDs on the Xbox controller */
41 ALL = 5,
42};
43
44/** Used to set the colors of the Move and PS4 controller. */
45enum ColorsEnum {
46 /** r = 255, g = 0, b = 0 */
47 Red = 0xFF0000,
48 /** r = 0, g = 255, b = 0 */
49 Green = 0xFF00,
50 /** r = 0, g = 0, b = 255 */
51 Blue = 0xFF,
52
53 /** r = 255, g = 235, b = 4 */
54 Yellow = 0xFFEB04,
55 /** r = 0, g = 255, b = 255 */
56 Lightblue = 0xFFFF,
57 /** r = 255, g = 0, b = 255 */
58 Purble = 0xFF00FF,
59
60 /** r = 255, g = 255, b = 255 */
61 White = 0xFFFFFF,
62 /** r = 0, g = 0, b = 0 */
63 Off = 0x00,
64};
65
66enum RumbleEnum {
67 RumbleHigh = 0x10,
68 RumbleLow = 0x20,
69};
70
71/** This enum is used to read all the different buttons on the different controllers */
72enum ButtonEnum {
73 /**@{*/
74 /** These buttons are available on all the the controllers */
75 UP = 0,
76 RIGHT = 1,
77 DOWN = 2,
78 LEFT = 3,
79 /**@}*/
80
81 /**@{*/
82 /** Wii buttons */
83 PLUS = 5,
84 TWO = 6,
85 ONE = 7,
86 MINUS = 8,
87 HOME = 9,
88 Z = 10,
89 C = 11,
90 B = 12,
91 A = 13,
92 /**@}*/
93
94 /**@{*/
95 /** These are only available on the Wii U Pro Controller */
96 L = 16,
97 R = 17,
98 ZL = 18,
99 ZR = 19,
100 /**@}*/
101
102 /**@{*/
103 /** PS3 controllers buttons */
104 SELECT = 4,
105 START = 5,
106 L3 = 6,
107 R3 = 7,
108
109 L2 = 8,
110 R2 = 9,
111 L1 = 10,
112 R1 = 11,
113 TRIANGLE = 12,
114 CIRCLE = 13,
115 CROSS = 14,
116 SQUARE = 15,
117
118 PS = 16,
119
120 MOVE = 17, // Covers 12 bits - we only need to read the top 8
121 T = 18, // Covers 12 bits - we only need to read the top 8
122 /**@}*/
123
124 /** PS4 controllers buttons - SHARE and OPTIONS are present instead of SELECT and START */
125 SHARE = 4,
126 OPTIONS = 5,
127 TOUCHPAD = 17,
128 /**@}*/
129
130 /**@{*/
131 /** Xbox buttons */
132 BACK = 4,
133 X = 14,
134 Y = 15,
135 XBOX = 16,
136 SYNC = 17,
137 BLACK = 8, // Available on the original Xbox controller
138 WHITE = 9, // Available on the original Xbox controller
139 /**@}*/
140
141 /** PS Buzz controllers */
142 RED = 0,
143 YELLOW = 1,
144 GREEN = 2,
145 ORANGE = 3,
146 BLUE = 4,
147 /**@}*/
148};
149
150/** Joysticks on the PS3 and Xbox controllers. */
151enum AnalogHatEnum {
152 /** Left joystick x-axis */
153 LeftHatX = 0,
154 /** Left joystick y-axis */
155 LeftHatY = 1,
156 /** Right joystick x-axis */
157 RightHatX = 2,
158 /** Right joystick y-axis */
159 RightHatY = 3,
160};
161
162/**
163 * Sensors inside the Sixaxis Dualshock 3, Move controller and PS4 controller.
164 * <B>Note:</B> that the location is shifted 9 when it's connected via USB on the PS3 controller.
165 */
166enum SensorEnum {
167 /** Accelerometer values */
168 aX = 50, aY = 52, aZ = 54,
169 /** Gyro z-axis */
170 gZ = 56,
171 gX, gY, // These are not available on the PS3 controller
172
173 /** Accelerometer x-axis */
174 aXmove = 28,
175 /** Accelerometer z-axis */
176 aZmove = 30,
177 /** Accelerometer y-axis */
178 aYmove = 32,
179
180 /** Gyro x-axis */
181 gXmove = 40,
182 /** Gyro z-axis */
183 gZmove = 42,
184 /** Gyro y-axis */
185 gYmove = 44,
186
187 /** Temperature sensor */
188 tempMove = 46,
189
190 /** Magnetometer x-axis */
191 mXmove = 47,
192 /** Magnetometer z-axis */
193 mZmove = 49,
194 /** Magnetometer y-axis */
195 mYmove = 50,
196};
197
198/** Used to get the angle calculated using the PS3 controller and PS4 controller. */
199enum AngleEnum {
200 Pitch = 0x01,
201 Roll = 0x02,
202};
203
204#endif