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 
23 const uint8_t LEDS[] PROGMEM = {
24  0x01, // LED1
25  0x02, // LED2
26  0x04, // LED3
27  0x08, // LED4
28 
29  0x09, // LED5
30  0x0A, // LED6
31  0x0C, // LED7
32  0x0D, // LED8
33  0x0E, // LED9
34  0x0F // LED10
35 };
36 const uint32_t BUTTONS[] PROGMEM = {
37  0x10, // UP
38  0x20, // RIGHT
39  0x40, // DOWN
40  0x80, // LEFT
41 
42  0x01, // SELECT
43  0x02, // L3
44  0x04, // R3
45  0x08, // START
46 
47  0x0100, // L2
48  0x0200, // R2
49  0x0400, // L1
50  0x0800, // R1
51 
52  0x1000, // TRIANGLE
53  0x2000, // CIRCLE
54  0x4000, // CROSS
55  0x8000, // SQUARE
56 
57  0x010000, // PS
58  0x080000, // MOVE - covers 12 bits - we only need to read the top 8
59  0x100000 // T - covers 12 bits - we only need to read the top 8
60 };
61 
62 const uint8_t ANALOGBUTTONS[] PROGMEM = {
63  // Note that the location is shiftet 9 when it's connected via USB
64  // Sixaxis Dualshcock 3 & Navigation controller
65  23, // UP_ANALOG
66  24, // RIGHT_ANALOG
67  25, // DOWN_ANALOG
68  26, // LEFT_ANALOG
69  0,0,0,0, // Skip SELECT, L3, R3 and START
70 
71  27, // L2_ANALOG
72  28, // R2_ANALOG
73  29, // L1_ANALOG
74  30, // R1_ANALOG
75  31, // TRIANGLE_ANALOG
76  32, // CIRCLE_ANALOG
77  33, // CROSS_ANALOG
78  34, // SQUARE_ANALOG
79  0,0, // Skip PS and MOVE
80 
81  // Playstation Move Controller
82  15 // T_ANALOG - Both at byte 14 (last reading) and byte 15 (current reading)
83 };
84 
85 enum Colors {
86  // Used to set the colors of the move controller
87  Red = 0xFF0000, // r = 255, g = 0, b = 0
88  Green = 0xFF00, // r = 0, g = 255, b = 0
89  Blue = 0xFF, // r = 0, g = 0, b = 255
90 
91  Yellow = 0xFFEB04, // r = 255, g = 235, b = 4
92  Lightblue = 0xFFFF, // r = 0, g = 255, b = 255
93  Purble = 0xFF00FF, // r = 255, g = 0, b = 255
94 
95  White = 0xFFFFFF, // r = 255, g = 255, b = 255
96  Off = 0x00, // r = 0, g = 0, b = 0
97 };
98 enum Sensor {
99  // Note that the location is shiftet 9 when it's connected via USB
100  // Sensors inside the Sixaxis Dualshock 3 controller
101  aX = 50,
102  aY = 52,
103  aZ = 54,
104  gZ = 56,
105 
106  // Sensors inside the Move Motion controller
107  aXmove = 28,
108  aZmove = 30,
109  aYmove = 32,
110 
111  gXmove = 40,
112  gZmove = 42,
113  gYmove = 44,
114 
115  tempMove = 46,
116 
117  mXmove = 47,
118  mZmove = 49,
119  mYmove = 50,
120 };
121 enum Angle {
122  // Used to get the angle calculated using atan2
123  Pitch = 0x01,
124  Roll = 0x02,
125 };
126 enum Status {
127  // Note that the location is shiftet 9 when it's connected via USB
128  // Byte location | bit location
129  Plugged = (38 << 8) | 0x02,
130  Unplugged = (38 << 8) | 0x03,
131 
132  Charging = (39 << 8) | 0xEE,
133  NotCharging = (39 << 8) | 0xF1,
134  Shutdown = (39 << 8) | 0x01,
135  Dying = (39 << 8) | 0x02,
136  Low = (39 << 8) | 0x03,
137  High = (39 << 8) | 0x04,
138  Full = (39 << 8) | 0x05,
139 
140  MoveCharging = (21 << 8) | 0xEE,
141  MoveNotCharging = (21 << 8) | 0xF1,
142  MoveShutdown = (21 << 8) | 0x01,
143  MoveDying = (21 << 8) | 0x02,
144  MoveLow = (21 << 8) | 0x03,
145  MoveHigh = (21 << 8) | 0x04,
146  MoveFull = (21 << 8) | 0x05,
147 
148  CableRumble = (40 << 8) | 0x10,//Opperating by USB and rumble is turned on
149  Cable = (40 << 8) | 0x12,//Opperating by USB and rumble is turned off
150  BluetoothRumble = (40 << 8) | 0x14,//Opperating by bluetooth and rumble is turned on
151  Bluetooth = (40 << 8) | 0x16,//Opperating by bluetooth and rumble is turned off
152 };
153 enum Rumble {
154  RumbleHigh = 0x10,
155  RumbleLow = 0x20,
156 };
157 
158 #endif