|
1 | 1 | /*************************************************************************** |
2 | | - * Copyright (c) 2024 Microsoft Corporation |
3 | | - * |
| 2 | + * Copyright (c) 2024 Microsoft Corporation |
| 3 | + * |
4 | 4 | * This program and the accompanying materials are made available under the |
5 | 5 | * terms of the MIT License which is available at |
6 | 6 | * https://opensource.org/licenses/MIT. |
7 | | - * |
| 7 | + * |
8 | 8 | * SPDX-License-Identifier: MIT |
9 | 9 | **************************************************************************/ |
10 | 10 |
|
11 | 11 |
|
12 | 12 | /**************************************************************************/ |
13 | 13 | /**************************************************************************/ |
14 | | -/** */ |
| 14 | +/** */ |
15 | 15 | /** USBX Component */ |
16 | 16 | /** */ |
17 | 17 | /** User Specific */ |
|
20 | 20 | /**************************************************************************/ |
21 | 21 |
|
22 | 22 |
|
23 | | -/**************************************************************************/ |
24 | | -/* */ |
25 | | -/* PORT SPECIFIC C INFORMATION RELEASE */ |
26 | | -/* */ |
27 | | -/* ux_user.h PORTABLE C */ |
| 23 | +/**************************************************************************/ |
| 24 | +/* */ |
| 25 | +/* PORT SPECIFIC C INFORMATION RELEASE */ |
| 26 | +/* */ |
| 27 | +/* ux_user.h PORTABLE C */ |
28 | 28 | /* 6.3.0 */ |
29 | 29 | /* */ |
30 | 30 | /* AUTHOR */ |
31 | 31 | /* */ |
32 | 32 | /* Chaoqiong Xiao, Microsoft Corporation */ |
33 | 33 | /* */ |
34 | 34 | /* DESCRIPTION */ |
35 | | -/* */ |
36 | | -/* This file contains user defines for configuring USBX in specific */ |
37 | | -/* ways. This file will have an effect only if the application and */ |
38 | | -/* USBX library are built with UX_INCLUDE_USER_DEFINE_FILE defined. */ |
39 | | -/* Note that all the defines in this file may also be made on the */ |
40 | | -/* command line when building USBX library and application objects. */ |
41 | | -/* */ |
42 | | -/* RELEASE HISTORY */ |
43 | | -/* */ |
44 | | -/* DATE NAME DESCRIPTION */ |
45 | | -/* */ |
| 35 | +/* */ |
| 36 | +/* This file contains user defines for configuring USBX in specific */ |
| 37 | +/* ways. This file will have an effect only if the application and */ |
| 38 | +/* USBX library are built with UX_INCLUDE_USER_DEFINE_FILE defined. */ |
| 39 | +/* Note that all the defines in this file may also be made on the */ |
| 40 | +/* command line when building USBX library and application objects. */ |
| 41 | +/* */ |
| 42 | +/* RELEASE HISTORY */ |
| 43 | +/* */ |
| 44 | +/* DATE NAME DESCRIPTION */ |
| 45 | +/* */ |
46 | 46 | /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ |
47 | 47 | /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ |
48 | 48 | /* resulting in version 6.1 */ |
|
115 | 115 |
|
116 | 116 |
|
117 | 117 | /* Define various build options for the USBX port. The application should either make changes |
118 | | - here by commenting or un-commenting the conditional compilation defined OR supply the defines |
| 118 | + here by commenting or un-commenting the conditional compilation defined OR supply the defines |
119 | 119 | though the compiler's equivalent of the -D option. */ |
120 | 120 |
|
121 | 121 | /* Define USBX Generic Thread Stack Size. */ |
122 | 122 | /* #define UX_THREAD_STACK_SIZE (2 * 1024) */ |
123 | 123 |
|
124 | 124 | /* Define USBX Host Enum Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE */ |
125 | | -/* |
126 | | -#define UX_HOST_ENUM_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE |
| 125 | +/* |
| 126 | +#define UX_HOST_ENUM_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE |
127 | 127 | */ |
128 | 128 |
|
129 | 129 |
|
|
137 | 137 | #define UX_HOST_HNP_POLLING_THREAD_STACK UX_THREAD_STACK_SIZE |
138 | 138 | */ |
139 | 139 |
|
140 | | -/* Override various options with default values already assigned in ux_api.h or ux_port.h. Please |
| 140 | +/* Override various options with default values already assigned in ux_api.h or ux_port.h. Please |
141 | 141 | also refer to ux_port.h for descriptions on each of these options. */ |
142 | 142 |
|
143 | 143 | /* Defined, this value represents minimal allocated memory alignment in number of bytes. |
144 | 144 | The default is UX_ALIGN_8 (0x07) to align allocated memory to 8 bytes. */ |
145 | 145 | /* #define UX_ALIGN_MIN UX_ALIGN_8 */ |
146 | 146 |
|
147 | | -/* Defined, this value represents how many ticks per seconds for a specific hardware platform. |
| 147 | +/* Defined, this value represents how many ticks per seconds for a specific hardware platform. |
148 | 148 | The default is 1000 indicating 1 tick per millisecond. */ |
149 | 149 |
|
150 | 150 | /* #define UX_PERIODIC_RATE 1000 |
|
167 | 167 | /* Defined, this value is the maximum number of classes that can be loaded by USBX. This value |
168 | 168 | represents the class container and not the number of instances of a class. For instance, if a |
169 | 169 | particular implementation of USBX needs the hub class, the printer class, and the storage |
170 | | - class, then the UX_MAX_CLASSES value can be set to 3 regardless of the number of devices |
| 170 | + class, then the UX_MAX_CLASSES value can be set to 3 regardless of the number of devices |
171 | 171 | that belong to these classes. */ |
172 | 172 |
|
173 | 173 | /* #define UX_MAX_CLASSES 3 |
|
185 | 185 | /* #define UX_MAX_SLAVE_INTERFACES 16 |
186 | 186 | */ |
187 | 187 |
|
188 | | -/* Defined, this value represents the number of different host controllers available in the system. |
189 | | - For USB 1.1 support, this value will usually be 1. For USB 2.0 support, this value can be more |
190 | | - than 1. This value represents the number of concurrent host controllers running at the same time. |
| 188 | +/* Defined, this value represents the number of different host controllers available in the system. |
| 189 | + For USB 1.1 support, this value will usually be 1. For USB 2.0 support, this value can be more |
| 190 | + than 1. This value represents the number of concurrent host controllers running at the same time. |
191 | 191 | If for instance there are two instances of OHCI running, or one EHCI and one OHCI controller |
192 | 192 | running, the UX_MAX_HCD should be set to 2. */ |
193 | 193 |
|
|
196 | 196 |
|
197 | 197 |
|
198 | 198 | /* Defined, this value represents the maximum number of devices that can be attached to the USB. |
199 | | - Normally, the theoretical maximum number on a single USB is 127 devices. This value can be |
200 | | - scaled down to conserve memory. Note that this value represents the total number of devices |
| 199 | + Normally, the theoretical maximum number on a single USB is 127 devices. This value can be |
| 200 | + scaled down to conserve memory. Note that this value represents the total number of devices |
201 | 201 | regardless of the number of USB buses in the system. */ |
202 | 202 |
|
203 | 203 | /* #define UX_MAX_DEVICES 127 |
|
213 | 213 |
|
214 | 214 | /* Defined, this value represents the maximum number of SCSI logical units represented in the |
215 | 215 | host storage class driver. */ |
216 | | - |
| 216 | + |
217 | 217 | /* #define UX_MAX_HOST_LUN 1 |
218 | 218 | */ |
219 | 219 |
|
|
274 | 274 |
|
275 | 275 |
|
276 | 276 | /* Defined, this value represents the maximum number of bytes that can be received or transmitted |
277 | | - on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default |
278 | | - is 4096 bytes but can be reduced in memory constrained environments. For cd-rom support in the storage |
| 277 | + on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default |
| 278 | + is 4096 bytes but can be reduced in memory constrained environments. For cd-rom support in the storage |
279 | 279 | class, this value cannot be less than 2048. */ |
280 | 280 |
|
281 | 281 | #define UX_SLAVE_REQUEST_DATA_MAX_LENGTH (1024 * 2) |
282 | 282 |
|
283 | | -/* Defined, this enables processing of Get String Descriptor requests with zero Language ID. |
| 283 | +/* Defined, this enables processing of Get String Descriptor requests with zero Language ID. |
284 | 284 | The first language ID in the language ID framwork will be used if the request has a zero |
285 | 285 | Language ID. */ |
286 | 286 | /* #define UX_DEVICE_ENABLE_GET_STRING_WITH_ZERO_LANGUAGE_ID */ |
|
297 | 297 |
|
298 | 298 | /* Define USBX Mass Storage Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE. */ |
299 | 299 |
|
300 | | -/* #define UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE |
| 300 | +/* #define UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE |
301 | 301 | */ |
302 | 302 |
|
303 | 303 | /* Defined, this value represents the maximum number of Ed, regular TDs and Isochronous TDs. These values |
|
313 | 313 |
|
314 | 314 | #define UX_HOST_CLASS_HID_DECOMPRESSION_BUFFER 4096 |
315 | 315 |
|
316 | | -/* Defined, this value represents the maximum number of HID usages for a HID device. |
| 316 | +/* Defined, this value represents the maximum number of HID usages for a HID device. |
317 | 317 | Default is 2048 but for simple HID devices like keyboard and mouse it can be reduced a lot. */ |
318 | 318 |
|
319 | 319 | #define UX_HOST_CLASS_HID_USAGES 2048 |
320 | 320 |
|
321 | 321 |
|
322 | | -/* By default, each key in each HID report from the device is reported by ux_host_class_hid_keyboard_key_get |
| 322 | +/* By default, each key in each HID report from the device is reported by ux_host_class_hid_keyboard_key_get |
323 | 323 | (a HID report from the device is received whenever there is a change in a key state i.e. when a key is pressed |
324 | 324 | or released. The report contains every key that is down). There are limitations to this method such as not being |
325 | 325 | able to determine when a key has been released. |
|
352 | 352 | /* #define UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE_REPORT_MODIFIER_KEYS */ |
353 | 353 |
|
354 | 354 |
|
355 | | -/* Defined, this value represents the maximum number of media for the host storage class. |
| 355 | +/* Defined, this value represents the maximum number of media for the host storage class. |
356 | 356 | Default is 8 but for memory constrained resource systems this can ne reduced to 1. */ |
357 | 357 |
|
358 | 358 | #define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2 |
359 | 359 |
|
360 | 360 | /* Defined, this value includes code to handle storage devices that use the CB |
361 | | - or CBI protocol (such as floppy disks). It is off by default because these |
| 361 | + or CBI protocol (such as floppy disks). It is off by default because these |
362 | 362 | protocols are obsolete, being superseded by the Bulk Only Transport (BOT) protocol |
363 | 363 | which virtually all modern storage devices use. |
364 | 364 | */ |
|
415 | 415 |
|
416 | 416 | /* #define UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH 64 */ |
417 | 417 |
|
418 | | -/* Defined, this value represents the the maximum number of HID events/reports |
419 | | - that can be queued at once. |
| 418 | +/* Defined, this value represents the the maximum number of HID events/reports |
| 419 | + that can be queued at once. |
420 | 420 | */ |
421 | 421 |
|
422 | 422 | /* #define UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE 8 */ |
|
485 | 485 | /* #define UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT */ |
486 | 486 |
|
487 | 487 | /* Defined, this macro disables interface alternate setting support. |
488 | | - Device stalls |
| 488 | + Device stalls |
489 | 489 | */ |
490 | 490 | /* UX_DEVICE_ALTERNATE_SETTING_SUPPORT_DISABLE */ |
491 | 491 |
|
|
563 | 563 | /* Defined, this value will include the OTG polling thread. OTG can only be active if both host/device are present. |
564 | 564 | */ |
565 | 565 |
|
566 | | -#ifndef UX_HOST_SIDE_ONLY |
567 | | -#ifndef UX_DEVICE_SIDE_ONLY |
| 566 | +#ifndef UX_HOST_SIDE_ONLY |
| 567 | +#ifndef UX_DEVICE_SIDE_ONLY |
568 | 568 |
|
569 | 569 | /* #define UX_OTG_SUPPORT */ |
570 | 570 |
|
571 | | -#endif |
572 | | -#endif |
| 571 | +#endif |
| 572 | +#endif |
573 | 573 |
|
574 | 574 | /* Defined, this macro will enable the standalone mode of usbx. */ |
575 | 575 | /* #define UX_STANDALONE */ |
|
592 | 592 |
|
593 | 593 | #define UX_HOST_CLASS_STORAGE_MAX_TRANSFER_SIZE (1024 * 1) |
594 | 594 |
|
| 595 | +/* Defined, this option enables error log. */ |
| 596 | + |
| 597 | +/* #define UX_ENABLE_DEBUG_LOG */ |
| 598 | + |
595 | 599 | /* Defined, this value represents the size of the log pool. |
596 | 600 | */ |
597 | 601 | #define UX_DEBUG_LOG_SIZE (1024 * 16) |
|
641 | 645 | #include "usbh_hcs.h" |
642 | 646 | #include "usbh_stdreq.h" |
643 | 647 | #include "usbh_core.h" |
644 | | -#endif |
| 648 | +#endif |
645 | 649 |
|
646 | | -#endif |
| 650 | +#endif |
647 | 651 |
|
0 commit comments