Select one of the symbols to view example projects that use it.
 
Outline
...
...
...
...
...
...
#define UX_DEVICE_CLASS_HID_H
#define UX_DEVICE_CLASS_HID_RECEIVER_THREAD_STACK_SIZE
#define UX_DEVICE_CLASS_HID_THREAD_STACK_SIZE
#define UX_DEVICE_CLASS_HID_CLASS
#define UX_DEVICE_CLASS_HID_SUBCLASS
#define UX_DEVICE_CLASS_HID_PROTOCOL
#define UX_DEVICE_CLASS_HID_COMMAND_GET_REPORT
#define UX_DEVICE_CLASS_HID_COMMAND_GET_IDLE
#define UX_DEVICE_CLASS_HID_COMMAND_GET_PROTOCOL
#define UX_DEVICE_CLASS_HID_COMMAND_SET_REPORT
#define UX_DEVICE_CLASS_HID_COMMAND_SET_IDLE
#define UX_DEVICE_CLASS_HID_COMMAND_SET_PROTOCOL
#define UX_DEVICE_CLASS_HID_DESCRIPTOR_HID
#define UX_DEVICE_CLASS_HID_DESCRIPTOR_REPORT
#define UX_DEVICE_CLASS_HID_DESCRIPTOR_PHYSICAL
#define UX_DEVICE_CLASS_HID_REPORT_TYPE_INPUT
#define UX_DEVICE_CLASS_HID_REPORT_TYPE_OUTPUT
#define UX_DEVICE_CLASS_HID_REPORT_TYPE_FEATURE
#define UX_DEVICE_CLASS_HID_PROTOCOL_BOOT
#define UX_DEVICE_CLASS_HID_PROTOCOL_REPORT
#define UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH
#define UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE
#define UX_DEVICE_CLASS_HID_NEW_EVENT
#define UX_DEVICE_CLASS_HID_NEW_IDLE_RATE
#define UX_DEVICE_CLASS_HID_EVENTS_MASK
#define UX_DEVICE_CLASS_HID_RECEIVER_RESTART
#define UX_DEVICE_CLASS_HID_EVENTS_ALL_MASK
UX_SLAVE_CLASS_HID_EVENT_STRUCT
UX_SLAVE_CLASS_HID_STRUCT
UX_DEVICE_CLASS_HID_RECEIVED_EVENT_STRUCT
UX_DEVICE_CLASS_HID_RECEIVER_STRUCT
UX_SLAVE_CLASS_HID_PARAMETER_STRUCT
_ux_device_class_hid_descriptor_send(UX_SLAVE_CLASS_HID *, ULONG, ULONG, ULONG);
_ux_device_class_hid_activate(UX_SLAVE_CLASS_COMMAND *);
_ux_device_class_hid_deactivate(UX_SLAVE_CLASS_COMMAND *);
_ux_device_class_hid_control_request(UX_SLAVE_CLASS_COMMAND *);
_ux_device_class_hid_entry(UX_SLAVE_CLASS_COMMAND *);
_ux_device_class_hid_interrupt_thread(ULONG);
_ux_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *);
_ux_device_class_hid_uninitialize(UX_SLAVE_CLASS_COMMAND *);
_ux_device_class_hid_event_set(UX_SLAVE_CLASS_HID *, UX_SLAVE_CLASS_HID_EVENT *);
_ux_device_class_hid_event_get(UX_SLAVE_CLASS_HID *, UX_SLAVE_CLASS_HID_EVENT *);
_ux_device_class_hid_report_set(UX_SLAVE_CLASS_HID *, ULONG, ULONG, ULONG);
_ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *, ULONG, ULONG, ULONG);
_ux_device_class_hid_tasks_run(void *);
_ux_device_class_hid_read(UX_SLAVE_CLASS_HID *, UCHAR *, ULONG, ULONG *);
_ux_device_class_hid_receiver_thread(ULONG);
_ux_device_class_hid_receiver_initialize(UX_SLAVE_CLASS_HID *, UX_SLAVE_CLASS_HID_PARAMETER *, UX_DEVICE_CLASS_HID_RECEIVER **);
_ux_device_class_hid_receiver_uninitialize(UX_DEVICE_CLASS_HID_RECEIVER *);
_ux_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *, UX_DEVICE_CLASS_HID_RECEIVED_EVENT *);
_ux_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *);
#define ux_device_class_hid_entry
#define ux_device_class_hid_event_set
#define ux_device_class_hid_event_get
#define ux_device_class_hid_report_set
#define ux_device_class_hid_report_get
#define ux_device_class_hid_protocol_get
#define ux_device_class_hid_read
#define ux_device_class_hid_receiver_initialize
#define ux_device_class_hid_receiver_event_get
#define ux_device_class_hid_receiver_event_free
Files
loading...
SourceVuSTM32 Libraries and Samplesusbxcommon/usbx_device_classes/inc/ux_device_class_hid.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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/**************************************************************************/ /* */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ /* */ /* This software is licensed under the Microsoft Software License */ /* Terms for Microsoft Azure RTOS. Full text of the license can be */ /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ /* and in the root directory of this software. */ /* */... /**************************************************************************/ ... /**************************************************************************/ /**************************************************************************/ /** */ /** USBX Component */ /** */ /** HID Class */ /** */... /**************************************************************************/ /**************************************************************************/ ... /**************************************************************************/ /* */ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_hid.h PORTABLE C */ /* 6.1.10 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This file contains all the header and extern functions used by the */ /* USBX HID class. */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* used UX prefix to refer to */ /* TX symbols instead of using */ /* them directly, */ /* resulting in version 6.1 */ /* 12-31-2020 Chaoqiong Xiao Modified comment(s), */ /* added Get/Set Protocol */ /* request support, */ /* resulting in version 6.1.3 */ /* 08-02-2021 Chaoqiong Xiao Modified comment(s), */ /* added extern "C" keyword */ /* for compatibility with C++, */ /* resulting in version 6.1.8 */ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* added interrupt OUT support,*/ /* resulting in version 6.1.10 */ /* */... /**************************************************************************/ #ifndef UX_DEVICE_CLASS_HID_H #define UX_DEVICE_CLASS_HID_H /* Determine if a C++ compiler is being used. If so, ensure that standard C is used to process the API information. *//* ... */ #ifdef __cplusplus /* Yes, C++ compiler is present. Use standard C. */ extern "C" { #endif /* Device HID Compile Options. */ /* If defined, interrupt OUT transfer is supported. */ /* #define UX_DEVICE_CLASS_HID_INTERRUPT_OUT_SUPPORT */ /* Use UX general thread stack size for receiver thread. */ #define UX_DEVICE_CLASS_HID_RECEIVER_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE /* Use UX general thread stack size for HID class thread. */ #define UX_DEVICE_CLASS_HID_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE /* Define HID Class constants. */ #define UX_DEVICE_CLASS_HID_CLASS 0x03 #define UX_DEVICE_CLASS_HID_SUBCLASS 0X00 #define UX_DEVICE_CLASS_HID_PROTOCOL 0X00 /* Define HID Class commands. */ #define UX_DEVICE_CLASS_HID_COMMAND_GET_REPORT 0x01 #define UX_DEVICE_CLASS_HID_COMMAND_GET_IDLE 0x02 #define UX_DEVICE_CLASS_HID_COMMAND_GET_PROTOCOL 0x03 #define UX_DEVICE_CLASS_HID_COMMAND_SET_REPORT 0x09 #define UX_DEVICE_CLASS_HID_COMMAND_SET_IDLE 0x0A #define UX_DEVICE_CLASS_HID_COMMAND_SET_PROTOCOL 0x0B /* Define HID Class Descriptor types. */ #define UX_DEVICE_CLASS_HID_DESCRIPTOR_HID 0x21 #define UX_DEVICE_CLASS_HID_DESCRIPTOR_REPORT 0x22 #define UX_DEVICE_CLASS_HID_DESCRIPTOR_PHYSICAL 0x23 /* Define HID Report Types. */ #define UX_DEVICE_CLASS_HID_REPORT_TYPE_INPUT 0x1 #define UX_DEVICE_CLASS_HID_REPORT_TYPE_OUTPUT 0x2 #define UX_DEVICE_CLASS_HID_REPORT_TYPE_FEATURE 0x3 /* Define HID Protocols. */ #define UX_DEVICE_CLASS_HID_PROTOCOL_BOOT 0 #define UX_DEVICE_CLASS_HID_PROTOCOL_REPORT 1 19 defines /* Define HID event info structure. */ #ifndef UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH #define UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH 32 #endif /* Ensure the event buffer can fit inside the control endpoint's data buffer. */ #if UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH #error "Error: the event buffer cannot fit inside the control endpoint's data buffer. Reduce UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH such that it is less than or equal to UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH." #endif /* Ensure the event buffer can fit inside the interrupt endpoint's data buffer. */ #if UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH > UX_SLAVE_REQUEST_DATA_MAX_LENGTH #error "Error: the event buffer cannot fit inside the interrupt endpoint's data buffer. Reduce UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH such that it is less than or equal to UX_SLAVE_REQUEST_DATA_MAX_LENGTH." #endif #ifndef UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE #define UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE 16 #endif #define UX_DEVICE_CLASS_HID_NEW_EVENT 1u #define UX_DEVICE_CLASS_HID_NEW_IDLE_RATE 2u #define UX_DEVICE_CLASS_HID_EVENTS_MASK 3u /* Mask _NEW_EVENT and _NEW_IDLE_RATE */ #define UX_DEVICE_CLASS_HID_RECEIVER_RESTART 4u #define UX_DEVICE_CLASS_HID_EVENTS_ALL_MASK 7u /* Mask all event flags. */ 5 defines typedef struct UX_SLAVE_CLASS_HID_EVENT_STRUCT { ULONG ux_device_class_hid_event_report_id; ULONG ux_device_class_hid_event_report_type; UCHAR ux_device_class_hid_event_buffer[UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH]; ULONG ux_device_class_hid_event_length; ...} UX_SLAVE_CLASS_HID_EVENT; /* Define HID structure. */ typedef struct UX_SLAVE_CLASS_HID_STRUCT { UX_SLAVE_INTERFACE *ux_slave_class_hid_interface; UX_SLAVE_ENDPOINT *ux_device_class_hid_interrupt_endpoint; UINT ux_device_class_hid_state; UINT (*ux_device_class_hid_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, UX_SLAVE_CLASS_HID_EVENT *); UINT (*ux_device_class_hid_get_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, UX_SLAVE_CLASS_HID_EVENT *); VOID (*ux_slave_class_hid_instance_activate)(VOID *); VOID (*ux_slave_class_hid_instance_deactivate)(VOID *); UCHAR *ux_device_class_hid_report_address; ULONG ux_device_class_hid_report_id; ULONG ux_device_class_hid_report_length; #if !defined(UX_DEVICE_STANDALONE) UX_EVENT_FLAGS_GROUP ux_device_class_hid_event_flags_group; #else UINT ux_device_class_hid_event_state; ULONG ux_device_class_hid_event_wait_start; UX_SLAVE_CLASS_HID_EVENT ux_device_class_hid_event;/* ... */ #endif ULONG ux_device_class_hid_event_idle_rate; ULONG ux_device_class_hid_event_wait_timeout; ULONG ux_device_class_hid_protocol; UX_SLAVE_CLASS_HID_EVENT *ux_device_class_hid_event_array; UX_SLAVE_CLASS_HID_EVENT *ux_device_class_hid_event_array_head; UX_SLAVE_CLASS_HID_EVENT *ux_device_class_hid_event_array_tail; UX_SLAVE_CLASS_HID_EVENT *ux_device_class_hid_event_array_end; #if defined(UX_DEVICE_CLASS_HID_INTERRUPT_OUT_SUPPORT) UX_SLAVE_ENDPOINT *ux_device_class_hid_read_endpoint; struct UX_DEVICE_CLASS_HID_RECEIVER_STRUCT *ux_device_class_hid_receiver; #if !defined(UX_DEVICE_STANDALONE) UX_MUTEX ux_device_class_hid_read_mutex; #else UCHAR *ux_device_class_hid_read_buffer; UCHAR ux_device_class_hid_read_requested_length; UCHAR ux_device_class_hid_read_actual_length; UCHAR ux_device_class_hid_read_transfer_length; UINT ux_device_class_hid_read_state;/* ... */ #endif/* ... */ #endif ...} UX_SLAVE_CLASS_HID; /* HID interrupt OUT support extensions. */ typedef struct UX_DEVICE_CLASS_HID_RECEIVED_EVENT_STRUCT { ULONG ux_device_class_hid_received_event_length; UCHAR *ux_device_class_hid_received_event_data; ...} UX_DEVICE_CLASS_HID_RECEIVED_EVENT; typedef struct UX_DEVICE_CLASS_HID_RECEIVER_STRUCT { VOID (*ux_device_class_hid_receiver_uninitialize)(struct UX_DEVICE_CLASS_HID_RECEIVER_STRUCT *receiver); ULONG ux_device_class_hid_receiver_event_buffer_size; UX_DEVICE_CLASS_HID_RECEIVED_EVENT *ux_device_class_hid_receiver_events; UX_DEVICE_CLASS_HID_RECEIVED_EVENT *ux_device_class_hid_receiver_events_end; UX_DEVICE_CLASS_HID_RECEIVED_EVENT *ux_device_class_hid_receiver_event_read_pos; UX_DEVICE_CLASS_HID_RECEIVED_EVENT *ux_device_class_hid_receiver_event_save_pos; #if !defined(UX_DEVICE_STANDALONE) UX_THREAD ux_device_class_hid_receiver_thread; #else VOID (*ux_device_class_hid_receiver_tasks_run)(struct UX_SLAVE_CLASS_HID_STRUCT *hid); #endif ...} UX_DEVICE_CLASS_HID_RECEIVER; /* Define HID initialization command structure. */ typedef struct UX_SLAVE_CLASS_HID_PARAMETER_STRUCT { VOID (*ux_slave_class_hid_instance_activate)(VOID *); VOID (*ux_slave_class_hid_instance_deactivate)(VOID *); UCHAR *ux_device_class_hid_parameter_report_address; ULONG ux_device_class_hid_parameter_report_id; ULONG ux_device_class_hid_parameter_report_length; UINT (*ux_device_class_hid_parameter_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, UX_SLAVE_CLASS_HID_EVENT *); UINT (*ux_device_class_hid_parameter_get_callback)(struct UX_SLAVE_CLASS_HID_STRUCT *hid, UX_SLAVE_CLASS_HID_EVENT *); #if defined(UX_DEVICE_CLASS_HID_INTERRUPT_OUT_SUPPORT) UINT (*ux_device_class_hid_parameter_receiver_initialize)(UX_SLAVE_CLASS_HID *hid, struct UX_SLAVE_CLASS_HID_PARAMETER_STRUCT *parameter, UX_DEVICE_CLASS_HID_RECEIVER **receiver); ULONG ux_device_class_hid_parameter_receiver_event_max_number; ULONG ux_device_class_hid_parameter_receiver_event_max_length;/* ... */ #endif ...} UX_SLAVE_CLASS_HID_PARAMETER; /* Define HID Class function prototypes. */ UINT _ux_device_class_hid_descriptor_send(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, ULONG request_index, ULONG host_length); UINT _ux_device_class_hid_activate(UX_SLAVE_CLASS_COMMAND *command); UINT _ux_device_class_hid_deactivate(UX_SLAVE_CLASS_COMMAND *command); UINT _ux_device_class_hid_control_request(UX_SLAVE_CLASS_COMMAND *command); UINT _ux_device_class_hid_entry(UX_SLAVE_CLASS_COMMAND *command); VOID _ux_device_class_hid_interrupt_thread(ULONG hid_class); UINT _ux_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command); UINT _ux_device_class_hid_uninitialize(UX_SLAVE_CLASS_COMMAND *command); UINT _ux_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid, UX_SLAVE_CLASS_HID_EVENT *hid_event); UINT _ux_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid, UX_SLAVE_CLASS_HID_EVENT *hid_event); UINT _ux_device_class_hid_report_set(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, ULONG request_index, ULONG host_length); UINT _ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, ULONG request_index, ULONG host_length); UINT _ux_device_class_hid_tasks_run(VOID *class_instance); UINT _ux_device_class_hid_read(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer, ULONG requested_length, ULONG *actual_length); VOID _ux_device_class_hid_receiver_thread(ULONG hid_class); UINT _ux_device_class_hid_receiver_initialize(UX_SLAVE_CLASS_HID *hid, UX_SLAVE_CLASS_HID_PARAMETER *parameter, UX_DEVICE_CLASS_HID_RECEIVER **receiver); VOID _ux_device_class_hid_receiver_uninitialize(UX_DEVICE_CLASS_HID_RECEIVER *receiver); UINT _ux_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid, UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event); UINT _ux_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid); /* Define Device HID Class API prototypes. */ #define ux_device_class_hid_entry _ux_device_class_hid_entry #define ux_device_class_hid_event_set _ux_device_class_hid_event_set #define ux_device_class_hid_event_get _ux_device_class_hid_event_get #define ux_device_class_hid_report_set _ux_device_class_hid_report_set #define ux_device_class_hid_report_get _ux_device_class_hid_report_get #define ux_device_class_hid_protocol_get(hid) (hid -> ux_device_class_hid_protocol) #define ux_device_class_hid_read _ux_device_class_hid_read #define ux_device_class_hid_receiver_initialize _ux_device_class_hid_receiver_initialize #define ux_device_class_hid_receiver_event_get _ux_device_class_hid_receiver_event_get #define ux_device_class_hid_receiver_event_free _ux_device_class_hid_receiver_event_free 10 defines /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. *//* ... */ #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ ...#endif
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.