USB Host Shield 2.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PS3Enums.h
Go to the documentation of this file.
1 /* Copyright (C) 2012 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 _ps3enums_h
19 #define _ps3enums_h
20 
21 #include "controllerEnums.h"
22 
24 const uint8_t LEDS[] PROGMEM = {
25  0x01, // LED1
26  0x02, // LED2
27  0x04, // LED3
28  0x08, // LED4
29 
30  0x09, // LED5
31  0x0A, // LED6
32  0x0C, // LED7
33  0x0D, // LED8
34  0x0E, // LED9
35  0x0F // LED10
36 };
37 
43 const uint32_t BUTTONS[] PROGMEM = {
44  0x10, // UP
45  0x20, // RIGHT
46  0x40, // DOWN
47  0x80, // LEFT
48 
49  0x01, // SELECT
50  0x08, // START
51  0x02, // L3
52  0x04, // R3
53 
54  0x0100, // L2
55  0x0200, // R2
56  0x0400, // L1
57  0x0800, // R1
58 
59  0x1000, // TRIANGLE
60  0x2000, // CIRCLE
61  0x4000, // CROSS
62  0x8000, // SQUARE
63 
64  0x010000, // PS
65  0x080000, // MOVE - covers 12 bits - we only need to read the top 8
66  0x100000 // T - covers 12 bits - we only need to read the top 8
67 };
68 
74 const uint8_t ANALOGBUTTONS[] PROGMEM = {
75  23, // UP_ANALOG
76  24, // RIGHT_ANALOG
77  25, // DOWN_ANALOG
78  26, // LEFT_ANALOG
79  0, 0, 0, 0, // Skip SELECT, L3, R3 and START
80 
81  27, // L2_ANALOG
82  28, // R2_ANALOG
83  29, // L1_ANALOG
84  30, // R1_ANALOG
85  31, // TRIANGLE_ANALOG
86  32, // CIRCLE_ANALOG
87  33, // CROSS_ANALOG
88  34, // SQUARE_ANALOG
89  0, 0, // Skip PS and MOVE
90 
91  // Playstation Move Controller
92  15 // T_ANALOG - Both at byte 14 (last reading) and byte 15 (current reading)
93 };
94 
96 enum Colors {
98  Red = 0xFF0000,
100  Green = 0xFF00,
102  Blue = 0xFF,
103 
105  Yellow = 0xFFEB04,
107  Lightblue = 0xFFFF,
109  Purble = 0xFF00FF,
110 
112  White = 0xFFFFFF,
114  Off = 0x00,
115 };
116 
122 enum Sensor {
124  aX = 50,
126  aY = 52,
128  aZ = 54,
130  gZ = 56,
131 
133  aXmove = 28,
135  aZmove = 30,
137  aYmove = 32,
138 
140  gXmove = 40,
142  gZmove = 42,
144  gYmove = 44,
145 
147  tempMove = 46,
148 
150  mXmove = 47,
152  mZmove = 49,
154  mYmove = 50,
155 };
156 
158 enum Angle {
159  Pitch = 0x01,
160  Roll = 0x02,
161 };
162 
163 enum Status {
164  // Note that the location is shiftet 9 when it's connected via USB
165  // Byte location | bit location
166  Plugged = (38 << 8) | 0x02,
167  Unplugged = (38 << 8) | 0x03,
168 
169  Charging = (39 << 8) | 0xEE,
170  NotCharging = (39 << 8) | 0xF1,
171  Shutdown = (39 << 8) | 0x01,
172  Dying = (39 << 8) | 0x02,
173  Low = (39 << 8) | 0x03,
174  High = (39 << 8) | 0x04,
175  Full = (39 << 8) | 0x05,
176 
177  MoveCharging = (21 << 8) | 0xEE,
178  MoveNotCharging = (21 << 8) | 0xF1,
179  MoveShutdown = (21 << 8) | 0x01,
180  MoveDying = (21 << 8) | 0x02,
181  MoveLow = (21 << 8) | 0x03,
182  MoveHigh = (21 << 8) | 0x04,
183  MoveFull = (21 << 8) | 0x05,
184 
185  CableRumble = (40 << 8) | 0x10, //Opperating by USB and rumble is turned on
186  Cable = (40 << 8) | 0x12, //Opperating by USB and rumble is turned off
187  BluetoothRumble = (40 << 8) | 0x14, //Opperating by bluetooth and rumble is turned on
188  Bluetooth = (40 << 8) | 0x16, //Opperating by bluetooth and rumble is turned off
189 };
190 
191 enum Rumble {
192  RumbleHigh = 0x10,
193  RumbleLow = 0x20,
194 };
195 
196 #endif