forked from beantowel/HID-descriptor-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rptStructureDef.h
278 lines (253 loc) · 7.41 KB
/
rptStructureDef.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#ifndef __USB_PID_Def
#define __USB_PID_Def
#ifdef __cplusplus
extern "C" {
#endif
#include "stdint.h"
#pragma pack(push)
#pragma pack(1)
#define ID_PID_PID_State_Report 2
#define ID_PID_Set_Effect_Report 1
#define ID_PID_Set_Envelope_Report 2
#define ID_PID_Set_Condition_Report 3
#define ID_PID_Set_Periodic_Report 4
#define ID_PID_Set_Constant_Force_Report 5
#define ID_PID_Set_Ramp_Force_Report 6
#define ID_PID_Effect_Operation_Report 10
#define ID_PID_PID_Block_Free_Report 11
#define ID_PID_PID_Device_Control 12
#define ID_PID_Device_Gain_Report 13
#define ID_PID_Create_New_Effect_Report 5
#define ID_PID_PID_Block_Load_Report 6
#define ID_PID_PID_Pool_Report 7
#define Mask_PID_Device_Paused 0x1
#define Mask_PID_Actuators_Enabled 0x2
#define Mask_PID_Safety_Switch 0x4
#define Mask_PID_Actuator_Override_Switch 0x8
#define Mask_PID_Actuator_Power 0x10
#define Mask_PID_Effect_Playing 0x20
#define Mask_X_ID 0x1
#define Mask_Y_ID 0x2
#define Mask_PID_Device_Managed_Pool 0x1
#define Mask_PID_Shared_Parameter_Blocks 0x2
enum PID_Effect_Type_Enum {
PID_ET_Constant_Force = 1,
PID_ET_Ramp = 2,
PID_ET_Square = 3,
PID_ET_Sine = 4,
PID_ET_Triangle = 5,
PID_ET_Sawtooth_Up = 6,
PID_ET_Sawtooth_Down = 7,
PID_ET_Spring = 8,
PID_ET_Damper = 9,
PID_ET_Inertia = 10,
PID_ET_Friction = 11,
};
enum PID_Effect_Operation_Enum {
PID_Op_Effect_Start = 1,
PID_Op_Effect_Start_Solo = 2,
PID_Op_Effect_Stop = 3,
};
enum PID_PID_Device_Control_Enum {
PID_DC_Enable_Actuators = 1,
PID_DC_Disable_Actuators = 2,
PID_DC_Stop_All_Effects = 3,
PID_DC_Device_Reset = 4,
PID_DC_Device_Pause = 5,
PID_DC_Device_Continue = 6,
};
enum PID_Block_Load_Status_Enum {
PID_Block_Load_Success = 1,
PID_Block_Load_Full = 2,
PID_Block_Load_Error = 3,
};
typedef struct _PID_PID_State_Report {
//Report_ID:2
uint8_t vars_0;
//pid_device_paused,pid_actuators_enabled,pid_safety_switch,pid_actuator_override_switch,pid_actuator_power,pid_effect_playing,
//Check Pads
//Logical_Maximum:1
//2-pads added
//Logical_Maximum:1
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
} PID_PID_State_Report;
typedef struct _PID_Set_Effect_Report {
//Report_ID:1
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
struct {
enum PID_Effect_Type_Enum pid_effect_type_enum_0;
//Logical_Maximum:11
//Logical_Minimum:1
} PID_Effect_Type;
uint16_t pid_duration;
uint16_t pid_trigger_repeat_interval;
uint16_t pid_sample_period;
//Logical_Maximum:32767
//Unit:Eng_Lin_Time
//Unit_Exponent:-3
uint8_t pid_gain;
//Logical_Maximum:255
uint8_t pid_trigger_button;
//Logical_Maximum:8
//Logical_Minimum:1
struct {
uint8_t vars_0;
//x_id,y_id,
//Check Pads
//Logical_Maximum:1
//6-pads added
//Logical_Maximum:1
} PID_Axes_Enable;
uint8_t pid_direction_enable;
//Logical_Maximum:1
struct {
uint8_t instance_1;
uint8_t instance_2;
//Logical_Maximum:180
//Unit_Exponent:-2
} PID_Direction;
} PID_Set_Effect_Report;
typedef struct _PID_Set_Envelope_Report {
//Report_ID:2
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
uint16_t pid_attack_level;
uint16_t pid_fade_level;
//Logical_Maximum:10000
uint16_t pid_attack_time;
uint16_t pid_fade_time;
//Logical_Maximum:32767
//Unit:Eng_Lin_Time
//Unit_Exponent:-3
} PID_Set_Envelope_Report;
typedef struct _PID_Set_Condition_Report {
//Report_ID:3
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
uint8_t pid_parameter_block_offset;
//Logical_Maximum:1
int16_t pid_cp_offset;
int16_t pid_dead_band;
int16_t pid_positive_coefficient;
int16_t pid_negative_coefficient;
//Logical_Maximum:10000
//Logical_Minimum:-10000
uint16_t pid_positive_saturation;
uint16_t pid_negative_saturation;
//Logical_Maximum:10000
} PID_Set_Condition_Report;
typedef struct _PID_Set_Periodic_Report {
//Report_ID:4
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
uint16_t pid_magnitude;
//Logical_Maximum:10000
int16_t pid_offset;
//Logical_Maximum:10000
//Logical_Minimum:-10000
uint8_t pid_phase;
//Logical_Maximum:180
//Unit:Eng_Rot_Angular_Pos
//Unit_Exponent:-2
uint16_t pid_period;
//Logical_Maximum:32767
//Unit:Eng_Lin_Time
//Unit_Exponent:-3
} PID_Set_Periodic_Report;
typedef struct _PID_Set_Constant_Force_Report {
//Report_ID:5
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
int16_t pid_magnitude;
//Logical_Maximum:10000
//Logical_Minimum:-10000
} PID_Set_Constant_Force_Report;
typedef struct _PID_Set_Ramp_Force_Report {
//Report_ID:6
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
int8_t pid_ramp_start;
int8_t pid_ramp_end;
//Logical_Maximum:127
//Logical_Minimum:-128
} PID_Set_Ramp_Force_Report;
typedef struct _PID_Effect_Operation_Report {
//Report_ID:10
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
struct {
enum PID_Effect_Operation_Enum pid_effect_operation_enum_0;
//Logical_Maximum:3
//Logical_Minimum:1
} PID_Effect_Operation;
uint8_t pid_loop_count;
//Logical_Maximum:255
} PID_Effect_Operation_Report;
typedef struct _PID_PID_Block_Free_Report {
//Report_ID:11
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
} PID_PID_Block_Free_Report;
typedef struct _PID_PID_Device_Control {
//Report_ID:12
enum PID_PID_Device_Control_Enum pid_pid_device_control_enum_0;
//Logical_Maximum:6
//Logical_Minimum:1
} PID_PID_Device_Control;
typedef struct _PID_Device_Gain_Report {
//Report_ID:13
uint8_t pid_device_gain;
//Logical_Maximum:255
} PID_Device_Gain_Report;
typedef struct _PID_Create_New_Effect_Report {
//Report_ID:5
struct {
enum PID_Effect_Type_Enum pid_effect_type_enum_0;
//Logical_Maximum:11
//Logical_Minimum:1
} PID_Effect_Type;
uint16_t byte_count;
//Logical_Maximum:511
} PID_Create_New_Effect_Report;
typedef struct _PID_PID_Block_Load_Report {
//Report_ID:6
uint8_t pid_effect_block_index;
//Logical_Maximum:20
//Logical_Minimum:1
struct {
enum PID_Block_Load_Status_Enum pid_block_load_status_enum_0;
//Logical_Maximum:3
//Logical_Minimum:1
} PID_Block_Load_Status;
uint16_t pid_ram_pool_available;
//Logical_Maximum:65535
} PID_PID_Block_Load_Report;
typedef struct _PID_PID_Pool_Report {
//Report_ID:7
uint16_t pid_ram_pool_size;
//Logical_Maximum:65535
uint8_t pid_simultaneous_effects_max;
//Logical_Maximum:255
uint8_t vars_0;
//pid_device_managed_pool,pid_shared_parameter_blocks,
//Check Pads
//Logical_Maximum:1
//6-pads added
//Logical_Maximum:1
} PID_PID_Pool_Report;
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* __USB_PID_Def */