USB Host Shield 2.0
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
GitHub
USB_Host_Shield_2.0
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
};
157
enum
Angle
{
158
Pitch
= 0x01,
159
Roll
= 0x02,
160
};
161
enum
Status
{
162
// Note that the location is shiftet 9 when it's connected via USB
163
// Byte location | bit location
164
Plugged
= (38 << 8) | 0x02,
165
Unplugged
= (38 << 8) | 0x03,
166
167
Charging
= (39 << 8) | 0xEE,
168
NotCharging
= (39 << 8) | 0xF1,
169
Shutdown
= (39 << 8) | 0x01,
170
Dying
= (39 << 8) | 0x02,
171
Low
= (39 << 8) | 0x03,
172
High
= (39 << 8) | 0x04,
173
Full
= (39 << 8) | 0x05,
174
175
MoveCharging
= (21 << 8) | 0xEE,
176
MoveNotCharging
= (21 << 8) | 0xF1,
177
MoveShutdown
= (21 << 8) | 0x01,
178
MoveDying
= (21 << 8) | 0x02,
179
MoveLow
= (21 << 8) | 0x03,
180
MoveHigh
= (21 << 8) | 0x04,
181
MoveFull
= (21 << 8) | 0x05,
182
183
CableRumble
= (40 << 8) | 0x10,
//Opperating by USB and rumble is turned on
184
Cable
= (40 << 8) | 0x12,
//Opperating by USB and rumble is turned off
185
BluetoothRumble
= (40 << 8) | 0x14,
//Opperating by bluetooth and rumble is turned on
186
Bluetooth
= (40 << 8) | 0x16,
//Opperating by bluetooth and rumble is turned off
187
};
188
enum
Rumble
{
189
RumbleHigh
= 0x10,
190
RumbleLow
= 0x20,
191
};
192
193
#endif
Generated by
1.8.3.1