1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** USBX Component                                                        */
17 /**                                                                       */
18 /**   User Specific                                                       */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  PORT SPECIFIC C INFORMATION                            RELEASE        */
27 /*                                                                        */
28 /*    ux_user.h                                           PORTABLE C      */
29 /*                                                           6.3.0        */
30 /*                                                                        */
31 /*  AUTHOR                                                                */
32 /*                                                                        */
33 /*    Chaoqiong Xiao, Microsoft Corporation                               */
34 /*                                                                        */
35 /*  DESCRIPTION                                                           */
36 /*                                                                        */
37 /*    This file contains user defines for configuring USBX in specific    */
38 /*    ways. This file will have an effect only if the application and     */
39 /*    USBX library are built with UX_INCLUDE_USER_DEFINE_FILE defined.    */
40 /*    Note that all the defines in this file may also be made on the      */
41 /*    command line when building USBX library and application objects.    */
42 /*                                                                        */
43 /*  RELEASE HISTORY                                                       */
44 /*                                                                        */
45 /*    DATE              NAME                      DESCRIPTION             */
46 /*                                                                        */
47 /*  05-19-2020     Chaoqiong Xiao           Initial Version 6.0           */
48 /*  09-30-2020     Chaoqiong Xiao           Modified comment(s),          */
49 /*                                            resulting in version 6.1    */
50 /*  02-02-2021     Xiuwen Cai               Modified comment(s), added    */
51 /*                                            compile option for using    */
52 /*                                            packet pool from NetX,      */
53 /*                                            resulting in version 6.1.4  */
54 /*  04-02-2021     Chaoqiong Xiao           Modified comment(s),          */
55 /*                                            added DFU_UPLOAD option,    */
56 /*                                            added macro to enable       */
57 /*                                            device bi-dir-endpoints,    */
58 /*                                            added macro to disable CDC- */
59 /*                                            ACM transmission support,   */
60 /*                                            resulting in version 6.1.6  */
61 /*  06-02-2021     Xiuwen Cai               Modified comment(s), added    */
62 /*                                            transfer timeout value      */
63 /*                                            options,                    */
64 /*                                            resulting in version 6.1.7  */
65 /*  08-02-2021     Wen Wang                 Modified comment(s),          */
66 /*                                            fixed spelling error,       */
67 /*                                            resulting in version 6.1.8  */
68 /*  10-15-2021     Chaoqiong Xiao           Modified comment(s),          */
69 /*                                            added option for assert,    */
70 /*                                            resulting in version 6.1.9  */
71 /*  01-31-2022     Chaoqiong Xiao           Modified comment(s),          */
72 /*                                            added standalone support,   */
73 /*                                            added option for device     */
74 /*                                            audio feedback endpoint,    */
75 /*                                            added option for MTP,       */
76 /*                                            added options for HID       */
77 /*                                            interrupt OUT support,      */
78 /*                                            added option to validate    */
79 /*                                            class code in enumeration,  */
80 /*                                            resulting in version 6.1.10 */
81 /*  07-29-2022     Chaoqiong Xiao           Modified comment(s),          */
82 /*                                            added audio class features, */
83 /*                                            added device CDC_ACM and    */
84 /*                                            printer write auto ZLP,     */
85 /*                                            resulting in version 6.1.12 */
86 /*  10-31-2022     Chaoqiong Xiao           Modified comment(s),          */
87 /*                                            deprecated ECM pool option, */
88 /*                                            added align minimal config, */
89 /*                                            added host stack instance   */
90 /*                                            creation strategy control,  */
91 /*                                            resulting in version 6.2.0  */
92 /*  03-08-2023     Chaoqiong Xiao           Modified comment(s),          */
93 /*                                            added option to disable dev */
94 /*                                            alternate setting support,  */
95 /*                                            added option to disable dev */
96 /*                                            framework initialize scan,  */
97 /*                                            added option to reference   */
98 /*                                            names by pointer to chars,  */
99 /*                                            added option to enable      */
100 /*                                            basic USBX error checking,  */
101 /*                                            resulting in version 6.2.1  */
102 /*  10-31-2023     Xiuwen Cai, CQ Xiao      Modified comment(s),          */
103 /*                                            refined memory management,  */
104 /*                                            added zero copy support     */
105 /*                                            in many device classes,     */
106 /*                                            added a new mode to manage  */
107 /*                                            endpoint buffer in classes, */
108 /*                                            added option for get string */
109 /*                                            requests with zero wIndex,  */
110 /*                                            resulting in version 6.3.0  */
111 /*                                                                        */
112 /**************************************************************************/
113 
114 #ifndef UX_USER_H
115 #define UX_USER_H
116 
117 
118 /* Define various build options for the USBX port.  The application should either make changes
119    here by commenting or un-commenting the conditional compilation defined OR supply the defines
120    though the compiler's equivalent of the -D option.  */
121 
122 /* Define USBX Generic Thread Stack Size.  */
123 /* #define UX_THREAD_STACK_SIZE                                (2 * 1024) */
124 
125 /* Define USBX Host Enum Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE */
126 /*
127 #define UX_HOST_ENUM_THREAD_STACK_SIZE                      UX_THREAD_STACK_SIZE
128 */
129 
130 
131 /* Define USBX Host HCD Thread Stack Size.  The default is to use UX_THREAD_STACK_SIZE */
132 /*
133 #define UX_HOST_HCD_THREAD_STACK_SIZE                       UX_THREAD_STACK_SIZE
134 */
135 
136 /* Define USBX Host HNP Polling Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE */
137 /*
138 #define UX_HOST_HNP_POLLING_THREAD_STACK                    UX_THREAD_STACK_SIZE
139 */
140 
141 /* Override various options with default values already assigned in ux_api.h or ux_port.h. Please
142    also refer to ux_port.h for descriptions on each of these options.  */
143 
144 /* Defined, this value represents minimal allocated memory alignment in number of bytes.
145    The default is UX_ALIGN_8 (0x07) to align allocated memory to 8 bytes.  */
146 /* #define UX_ALIGN_MIN UX_ALIGN_8  */
147 
148 /* Defined, this value represents how many ticks per seconds for a specific hardware platform.
149    The default is 1000 indicating 1 tick per millisecond.  */
150 
151 /* #define UX_PERIODIC_RATE 1000
152 */
153 #define UX_PERIODIC_RATE (TX_TIMER_TICKS_PER_SECOND)
154 
155 /* Define control transfer timeout value in millisecond.
156    The default is 10000 milliseconds.  */
157 /*
158 #define UX_CONTROL_TRANSFER_TIMEOUT                         10000
159 */
160 
161 /* Define non control transfer timeout value in millisecond.
162    The default is 50000 milliseconds.  */
163 /*
164 #define UX_NON_CONTROL_TRANSFER_TIMEOUT                     50000
165 */
166 
167 
168 /* Defined, this value is the maximum number of classes that can be loaded by USBX. This value
169    represents the class container and not the number of instances of a class. For instance, if a
170    particular implementation of USBX needs the hub class, the printer class, and the storage
171    class, then the UX_MAX_CLASSES value can be set to 3 regardless of the number of devices
172    that belong to these classes.  */
173 
174 /* #define UX_MAX_CLASSES  3
175 */
176 
177 
178 /* Defined, this value is the maximum number of classes in the device stack that can be loaded by
179    USBX.  */
180 
181 /* #define UX_MAX_SLAVE_CLASS_DRIVER    1
182 */
183 
184 /* Defined, this value is the maximum number of interfaces in the device framework.  */
185 
186 /* #define UX_MAX_SLAVE_INTERFACES    16
187 */
188 
189 /* Defined, this value represents the number of different host controllers available in the system.
190    For USB 1.1 support, this value will usually be 1. For USB 2.0 support, this value can be more
191    than 1. This value represents the number of concurrent host controllers running at the same time.
192    If for instance there are two instances of OHCI running, or one EHCI and one OHCI controller
193    running, the UX_MAX_HCD should be set to 2.  */
194 
195 /* #define UX_MAX_HCD  1
196 */
197 
198 
199 /* Defined, this value represents the maximum number of devices that can be attached to the USB.
200    Normally, the theoretical maximum number on a single USB is 127 devices. This value can be
201    scaled down to conserve memory. Note that this value represents the total number of devices
202    regardless of the number of USB buses in the system.  */
203 
204 /* #define UX_MAX_DEVICES  127
205 */
206 
207 
208 /* Defined, this value represents the current number of SCSI logical units represented in the device
209    storage class driver.  */
210 
211 /* #define UX_MAX_SLAVE_LUN    1
212 */
213 
214 
215 /* Defined, this value represents the maximum number of SCSI logical units represented in the
216    host storage class driver.  */
217 
218 /* #define UX_MAX_HOST_LUN 1
219 */
220 
221 
222 /* Defined, this value represents the maximum number of bytes received on a control endpoint in
223    the device stack. The default is 256 bytes but can be reduced in memory constrained environments.  */
224 
225 /* #define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256
226 */
227 
228 /* Defined, this value represents the endpoint buffer owner.
229    0 - The default, endpoint buffer is managed by core stack. Each endpoint takes UX_SLAVE_REQUEST_DATA_MAX_LENGTH bytes.
230    1 - Endpoint buffer managed by classes. In this case not all endpoints consume UX_SLAVE_REQUEST_DATA_MAX_LENGTH bytes.
231 */
232 
233 #define UX_DEVICE_ENDPOINT_BUFFER_OWNER      0
234 
235 /* Defined, it enables device CDC ACM zero copy for bulk in/out endpoints (write/read).
236     Enabled, the endpoint buffer is not allocated in class, application must
237     provide the buffer for read/write, and the buffer must meet device controller driver (DCD)
238     buffer requirements (e.g., aligned and cache safe).
239     It only works if UX_DEVICE_ENDPOINT_BUFFER_OWNER is 1 (endpoint buffer managed by class).
240  */
241 /* #define UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY  */
242 
243 /* Defined, it enables device HID zero copy and flexible queue support (works if HID owns endpoint buffer).
244     Enabled, the internal queue buffer is directly used for transfer, the APIs are kept to keep
245     backword compatibility, to AVOID KEEPING BUFFERS IN APPLICATION.
246     Flexible queue introduces initialization parameter _event_max_number and _event_max_length,
247     so each HID function could have different queue settings.
248     _event_max_number could be 2 ~ UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE.
249     Max of _event_max_length could be UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH.
250     If the initialization parameters are invalid (are 0s or exceed upper mentioned definition),
251     UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE and UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH are used to
252     calculate and allocate the queue.
253  */
254 /* #define UX_DEVICE_CLASS_HID_ZERO_COPY  */
255 
256 /* Defined, it enables device CDC_ECM zero copy support (works if CDC_ECM owns endpoint buffer).
257     Enabled, it requires that the NX IP default packet pool is in cache safe area, and buffer max
258     size is larger than UX_DEVICE_CLASS_CDC_ECM_ETHERNET_PACKET_SIZE (1536).
259  */
260 /* #define UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY  */
261 
262 /* Defined, it enables device RNDIS zero copy support (works if RNDIS owns endpoint buffer).
263     Enabled, it requires that the NX IP default packet pool is in cache safe area, and buffer max
264     size is larger than UX_DEVICE_CLASS_RNDIS_MAX_PACKET_TRANSFER_SIZE (1600).
265  */
266 /* #define UX_DEVICE_CLASS_RNDIS_ZERO_COPY  */
267 
268 /* Defined, it enables zero copy support (works if PRINTER owns endpoint buffer).
269     Defined, it enables zero copy for bulk in/out endpoints (write/read). In this case, the endpoint
270     buffer is not allocated in class, application must provide the buffer for read/write, and the
271     buffer must meet device controller driver (DCD) buffer requirements (e.g., aligned and cache
272     safe if buffer is for DMA).
273  */
274 /* #define UX_DEVICE_CLASS_PRINTER_ZERO_COPY  */
275 
276 
277 /* Defined, this value represents the maximum number of bytes that can be received or transmitted
278    on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default
279    is 4096 bytes but can be reduced in memory constrained environments. For cd-rom support in the storage
280    class, this value cannot be less than 2048.  */
281 
282 #define UX_SLAVE_REQUEST_DATA_MAX_LENGTH    (1024 * 2)
283 
284 /* Defined, this enables processing of Get String Descriptor requests with zero Language ID.
285    The first language ID in the language ID framwork will be used if the request has a zero
286    Language ID.  */
287 /* #define UX_DEVICE_ENABLE_GET_STRING_WITH_ZERO_LANGUAGE_ID  */
288 
289 /* Defined, this value includes code to handle storage Multi-Media Commands (MMC). E.g., DVD-ROM.
290 */
291 
292 /* #define UX_SLAVE_CLASS_STORAGE_INCLUDE_MMC   */
293 
294 
295 /* Defined, this value represents the maximum number of bytes that a storage payload can send/receive.
296    The default is 8K bytes but can be reduced in memory constrained environments.  */
297 #define UX_HOST_CLASS_STORAGE_MEMORY_BUFFER_SIZE            (1024 * 8)
298 
299 /* Define USBX Mass Storage Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE. */
300 
301 /* #define UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE             UX_THREAD_STACK_SIZE
302  */
303 
304 /* Defined, this value represents the maximum number of Ed, regular TDs and Isochronous TDs. These values
305    depend on the type of host controller and can be reduced in memory constrained environments.  */
306 
307 #define UX_MAX_ED                                           80
308 #define UX_MAX_TD                                           128
309 #define UX_MAX_ISO_TD                                       1
310 
311 /* Defined, this value represents the maximum size of the HID decompressed buffer. This cannot be determined
312    in advance so we allocate a big block, usually 4K but for simple HID devices like keyboard and mouse
313    it can be reduced a lot. */
314 
315 #define UX_HOST_CLASS_HID_DECOMPRESSION_BUFFER              4096
316 
317 /* Defined, this value represents the maximum number of HID usages for a HID device.
318    Default is 2048 but for simple HID devices like keyboard and mouse it can be reduced a lot. */
319 
320 #define UX_HOST_CLASS_HID_USAGES                            2048
321 
322 
323 /* By default, each key in each HID report from the device is reported by ux_host_class_hid_keyboard_key_get
324    (a HID report from the device is received whenever there is a change in a key state i.e. when a key is pressed
325    or released. The report contains every key that is down). There are limitations to this method such as not being
326    able to determine when a key has been released.
327 
328    Defined, this value causes ux_host_class_hid_keyboard_key_get to only report key changes i.e. key presses
329    and key releases. */
330 
331 /* #define UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE */
332 
333 /* Works when UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE is defined.
334 
335    Defined, this value causes ux_host_class_hid_keyboard_key_get to only report key pressed/down changes;
336    key released/up changes are not reported.
337  */
338 
339 /* #define UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE_REPORT_KEY_DOWN_ONLY */
340 
341 /* Works when UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE is defined.
342 
343    Defined, this value causes ux_host_class_hid_keyboard_key_get to report lock key (CapsLock/NumLock/ScrollLock) changes.
344  */
345 
346 /* #define UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE_REPORT_LOCK_KEYS */
347 
348 /* Works when UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE is defined.
349 
350    Defined, this value causes ux_host_class_hid_keyboard_key_get to report modifier key (Ctrl/Alt/Shift/GUI) changes.
351  */
352 
353 /* #define UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE_REPORT_MODIFIER_KEYS */
354 
355 
356 /* Defined, this value represents the maximum number of media for the host storage class.
357    Default is 8 but for memory constrained resource systems this can ne reduced to 1. */
358 
359 #define UX_HOST_CLASS_STORAGE_MAX_MEDIA                     2
360 
361 /* Defined, this value includes code to handle storage devices that use the CB
362    or CBI protocol (such as floppy disks). It is off by default because these
363    protocols are obsolete, being superseded by the Bulk Only Transport (BOT) protocol
364    which virtually all modern storage devices use.
365 */
366 
367 /* #define UX_HOST_CLASS_STORAGE_INCLUDE_LEGACY_PROTOCOL_SUPPORT */
368 
369 /* Defined, this value forces the memory allocation scheme to enforce alignment
370    of memory with the UX_SAFE_ALIGN field.
371 */
372 
373 /* #define UX_ENFORCE_SAFE_ALIGNMENT   */
374 
375 /* Defined, this value represents the number of packets in the CDC_ECM device class.
376    The default is 16.
377 */
378 
379 #define UX_DEVICE_CLASS_CDC_ECM_NX_PKPOOL_ENTRIES           4
380 
381 /* Defined, this value represents the number of packets in the CDC_ECM host class.
382    The default is 16.
383 */
384 
385 /* #define UX_HOST_CLASS_CDC_ECM_NX_PKPOOL_ENTRIES             16 */
386 
387 /* Defined, this value represents the number of milliseconds to wait for packet
388    allocation until invoking the application's error callback and retrying.
389    The default is 1000 milliseconds.
390 */
391 
392 /* #define UX_HOST_CLASS_CDC_ECM_PACKET_POOL_WAIT           10 */
393 
394 /* Defined, this value represents the number of milliseconds to wait for packet
395    pool availability checking loop.
396    The default is 100 milliseconds.
397 */
398 
399 /* #define UX_HOST_CLASS_CDC_ECM_PACKET_POOL_INSTANCE_WAIT  10 */
400 
401 /* Defined, this enables CDC ECM class to use the packet pool from NetX instance.
402    It's deprecated, packet pool from NetX instance is always used now.
403  */
404 
405 /* #define UX_HOST_CLASS_CDC_ECM_USE_PACKET_POOL_FROM_NETX */
406 
407 /* Defined, this value represents the number of milliseconds to wait for packet
408    allocation until invoking the application's error callback and retrying.
409 */
410 
411 /* #define UX_DEVICE_CLASS_CDC_ECM_PACKET_POOL_WAIT         10 */
412 
413 /* Defined, this value represents the the maximum length of HID reports on the
414    device.
415  */
416 
417 /* #define UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH          64 */
418 
419 /* Defined, this value represents the the maximum number of HID events/reports
420    that can be queued at once.
421  */
422 
423 /* #define UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE             8  */
424 
425 
426 /* Defined, this macro will disable DFU_UPLOAD support.  */
427 
428 /* #define UX_DEVICE_CLASS_DFU_UPLOAD_DISABLE  */
429 
430 /* Defined, this macro will enable DFU_GETSTATUS and DFU_GETSTATE in dfuERROR.  */
431 
432 /* #define UX_DEVICE_CLASS_DFU_ERROR_GET_ENABLE  */
433 
434 /* Defined, this macro will change status mode.
435    0 - simple mode,
436        status is queried from application in dfuDNLOAD-SYNC and dfuMANIFEST-SYNC state,
437        no bwPollTimeout.
438    1 - status is queried from application once requested,
439        b0-3 : media status
440        b4-7 : bStatus
441        b8-31: bwPollTimeout
442        bwPollTimeout supported.
443 */
444 
445 /* #define UX_DEVICE_CLASS_DFU_STATUS_MODE                  (1)  */
446 
447 /* Defined, this value represents the default DFU status bwPollTimeout.
448    The value is 3 bytes long (max 0xFFFFFFu).
449    By default the bwPollTimeout is 1 (means 1ms).
450  */
451 
452 /* #define UX_DEVICE_CLASS_DFU_STATUS_POLLTIMEOUT           (1)  */
453 
454 /* Defined, this macro will enable custom request process callback.  */
455 
456 /* #define UX_DEVICE_CLASS_DFU_CUSTOM_REQUEST_ENABLE   */
457 
458 /* Defined, this macro disables CDC ACM non-blocking transmission support.  */
459 
460 /* #define UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE  */
461 
462 /* Defined, device HID interrupt OUT transfer is supported.  */
463 
464 /* #define UX_DEVICE_CLASS_HID_INTERRUPT_OUT_SUPPORT  */
465 
466 /* defined, this macro enables device audio feedback endpoint support.  */
467 
468 /* #define UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT  */
469 
470 /* Works if UX_DEVICE_ENDPOINT_BUFFER_OWNER is 1.
471      Defined, it represents feedback endpoint buffer size.
472      It should be larger than feedback endpoint max packet size in framework.  */
473 /* #define UX_DEVICE_CLASS_AUDIO_FEEDBACK_ENDPOINT_BUFFER_SIZE    8            */
474 
475 /* Defined, class _write is pending ZLP automatically (complete transfer) after buffer is sent.  */
476 
477 /* #define UX_DEVICE_CLASS_CDC_ACM_WRITE_AUTO_ZLP  */
478 /* #define UX_DEVICE_CLASS_PRINTER_WRITE_AUTO_ZLP  */
479 
480 /* defined, this macro enables device audio interrupt endpoint support.  */
481 
482 /* define UX_DEVICE_CLASS_AUDIO_INTERRUPT_SUPPORT  */
483 
484 /* Defined, this macro enables device bi-directional-endpoint support.  */
485 
486 /* #define UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT  */
487 
488 /* Defined, this macro disables interface alternate setting support.
489    Device stalls
490  */
491 /* UX_DEVICE_ALTERNATE_SETTING_SUPPORT_DISABLE  */
492 
493 
494 /* Defined, this macro disables device framework scan, where max number of endpoints (except EP0)
495    and max number of interfaces are calculated at runtime, as a base to allocate memory for
496    interfaces and endpoints structures and their buffers.
497    Undefined, the following two macros must be defined to initialize memory structures.
498  */
499 /* #define UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE  */
500 
501 /* Works if UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE is defined.
502    This value represents max number of endpoints (except EP0) activated at the same time.
503  */
504 /* #define UX_MAX_DEVICE_ENDPOINTS                         2  */
505 
506 /* Works if UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE is defined.
507    This value represents max number of interfaces activated at the same time.
508  */
509 /* #define UX_MAX_DEVICE_INTERFACES                        1  */
510 
511 
512 /* Defined, this macro enables device/host PIMA MTP support.  */
513 
514 /* #define UX_PIMA_WITH_MTP_SUPPORT  */
515 
516 /* Defined, this macro enables host device class code validation.
517    Only following USB-IF allowed device class code is allowed:
518    0x00, 0x02 (CDC Control), 0x09 (Hub), 0x11 (Billboard), 0xDC (Diagnostic), 0xEF (MISC), 0xFF (Vendor)
519    Refer to https://www.usb.org/defined-class-codes for more details.
520  */
521 
522 /* #define UX_HOST_DEVICE_CLASS_CODE_VALIDATION_ENABLE  */
523 
524 
525 /* Defined, host HID interrupt OUT transfer is supported.  */
526 
527 /* #define UX_HOST_CLASS_HID_INTERRUPT_OUT_SUPPORT  */
528 
529 /* Define HID report transfer timeout value in millisecond.
530    The default is 10000 milliseconds.  */
531 
532 /* #define UX_HOST_CLASS_HID_REPORT_TRANSFER_TIMEOUT               10000 */
533 
534 /* Defined, host audio UAC 2.0 is supported.  */
535 /* #define UX_HOST_CLASS_AUDIO_2_SUPPORT  */
536 
537 /* Defined, host audio optional feedback endpoint is supported.  */
538 /* #define UX_HOST_CLASS_AUDIO_FEEDBACK_SUPPORT  */
539 
540 /* Defined, host audio optional interrupt endpoint is support.  */
541 /* #define UX_HOST_CLASS_AUDIO_INTERRUPT_SUPPORT  */
542 
543 /* Defined, this value controls host configuration instance creation, include all
544    interfaces and endpoints physical resources.
545    Possible settings:
546     UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_ALL (0) - The default, create all inside configuration.
547     UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_OWNED (1) - Create things owned by class driver.
548    Not defined, default setting is applied.
549  */
550 /* #define UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_CONTROL UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_OWNED */
551 
552 /* Defined, the _name in structs are referenced by pointer instead of by contents.
553    By default the _name is an array of string that saves characters, the contents are compared to confirm match.
554    If referenced by pointer the address pointer to const string is saved, the pointers are compared to confirm match.
555  */
556 /* #define UX_NAME_REFERENCED_BY_POINTER  */
557 
558 /* Defined, this value will only enable the host side of usbx.  */
559 /* #define UX_HOST_SIDE_ONLY   */
560 
561 /* Defined, this value will only enable the device side of usbx.  */
562 /* #define UX_DEVICE_SIDE_ONLY   */
563 
564 /* Defined, this value will include the OTG polling thread. OTG can only be active if both host/device are present.
565 */
566 
567 #ifndef UX_HOST_SIDE_ONLY
568 #ifndef UX_DEVICE_SIDE_ONLY
569 
570 /* #define UX_OTG_SUPPORT */
571 
572 #endif
573 #endif
574 
575 /* Defined, this macro will enable the standalone mode of usbx.  */
576 /* #define UX_STANDALONE  */
577 
578 /* Defined, this macro will remove the FileX dependency of host storage.
579    In this mode, sector access is offered instead of directly FileX FX_MEDIA support.
580    Use following APIs for media obtain and access:
581    - ux_host_class_storage_media_get : get instance of UX_HOST_CLASS_STORAGE_MEDIA
582    - ux_host_class_storage_media_lock : lock specific media for further read/write
583    - ux_host_class_storage_media_read : read sectors on locked media
584    - ux_host_class_storage_media_write : write sectors on locked media
585    - ux_host_class_storage_media_unlock : unlock media
586    Note it's forced defined/enabled in standalone mode of usbx.
587 */
588 /* #define UX_HOST_CLASS_STORAGE_NO_FILEX  */
589 
590 /* Defined, this value represents the maximum size of single transfers for the SCSI data phase.
591    By default it's 1024.
592 */
593 
594 #define UX_HOST_CLASS_STORAGE_MAX_TRANSFER_SIZE             (1024 * 1)
595 
596 /* Defined, this value represents the size of the log pool.
597 */
598 #define UX_DEBUG_LOG_SIZE                                   (1024 * 16)
599 
600 /* Defined, this macro represents the non-blocking function to return time tick.
601    This macro is used only in standalone mode.
602    The tick rate is defined by UX_PERIODIC_RATE.
603    If it's not defined, or TX is not included, a external function must be
604    implement in application:
605       extern  ULONG       _ux_utility_time_get(VOID);
606 */
607 /* #define _ux_utility_time_get() tx_time_get()  */
608 
609 /* Defined, this macro represents the non-blocking function to disable interrupts
610    and return old interrupt setting flags.
611    If it's not defined, or TX is not included, a external function must be
612    implement in application:
613       extern ALIGN_TYPE   _ux_utility_interrupt_disable(VOID);
614 */
615 /* #define _ux_utility_interrupt_disable() _tx_thread_interrupt_disable()  */
616 
617 /* Defined, this macro represents the non-blocking function to restore interrupts.
618    If it's not defined, or TX is not included, a external function must be
619    implement in application:
620       extern VOID         _ux_utility_interrupt_restore(ALIGN_TYPE);
621 */
622 /* #define _ux_utility_interrupt_restore(flags) _tx_thread_interrupt_restore(flags)  */
623 
624 /* Defined, this enables the assert checks inside usbx.  */
625 #define UX_ENABLE_ASSERT
626 
627 /* Defined, this defines the assert action taken when failure detected. By default
628    it halts without any output.  */
629 /* #define UX_ASSERT_FAIL  for (;;) {tx_thread_sleep(UX_WAIT_FOREVER); }  */
630 
631 
632 /* Defined, this option enables the basic USBX error checking. This define is typically used
633    when the application is debugging and removed after the application is fully debugged.  */
634 /*
635 #define UX_ENABLE_ERROR_CHECKING
636 */
637 
638 
639 /* DEBUG includes and macros for a specific platform go here.  */
640 #ifdef UX_INCLUDE_USER_DEFINE_BSP
641 #include "usb_bsp.h"
642 #include "usbh_hcs.h"
643 #include "usbh_stdreq.h"
644 #include "usbh_core.h"
645 #endif
646 
647 #endif
648 
649