Skip to content

Commit 2d357c5

Browse files
committed
Release 6.2.1 on 08 Mar 2023. Expand to see details.
e180182e Update owners a6785db8 Update for release. bc77918b Improve host audio sampling set and check (fixed a memory issue). 97d66e5d Add optimization options to ux_user.h eea2c732 USBX device printer error checking support. 1760cc8c USBX device audio error checking support a39f2f26 Fixed a macro name issue in device audio 1.0 83278dd8 Supported multiple report IDs in host HID. c548fe33 Fixed host CDC-ACM capability get. b64f8cdb Fix vendor request handling.
1 parent 813361a commit 2d357c5

File tree

58 files changed

+1694
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1694
-148
lines changed

common/core/inc/ux_api.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* APPLICATION INTERFACE DEFINITION RELEASE */
2727
/* */
2828
/* ux_api.h PORTABLE C */
29-
/* 6.2.0 */
29+
/* 6.2.1 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -128,6 +128,11 @@
128128
/* added interface instance */
129129
/* creation strategy control, */
130130
/* resulting in version 6.2.0 */
131+
/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
132+
/* accepted UX_MAX_CLASSES as */
133+
/* max class driver configure, */
134+
/* added a new error code, */
135+
/* resulting in version 6.2.1 */
131136
/* */
132137
/**************************************************************************/
133138

@@ -255,6 +260,13 @@ typedef signed char SCHAR;
255260
#define UX_MAX_SLAVE_INTERFACES 16
256261
#endif
257262

263+
/* Define USBX max number of classes (1 ~ n). */
264+
#ifndef UX_MAX_CLASSES
265+
#define UX_MAX_CLASSES 2
266+
#endif
267+
#ifndef UX_MAX_CLASS_DRIVER
268+
#define UX_MAX_CLASS_DRIVER UX_MAX_CLASSES
269+
#endif
258270

259271
/* Define USBX max number of devices (1 ~ n). */
260272
#ifndef UX_MAX_DEVICES
@@ -295,7 +307,7 @@ typedef signed char SCHAR;
295307
#define AZURE_RTOS_USBX
296308
#define USBX_MAJOR_VERSION 6
297309
#define USBX_MINOR_VERSION 2
298-
#define USBX_PATCH_VERSION 0
310+
#define USBX_PATCH_VERSION 1
299311

300312
/* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */
301313

@@ -1417,6 +1429,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL
14171429
#define UX_INVALID_PARAMETER 0xfa
14181430
#define UX_ABORTED 0xf9
14191431
#define UX_MATH_OVERFLOW 0xf8
1432+
#define UX_INVALID_BUILD_OPTION 0xf7
14201433

14211434
#define UX_TOO_MANY_DEVICES 0x11
14221435
#define UX_MEMORY_INSUFFICIENT 0x12

common/core/inc/ux_user_sample.h

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* PORT SPECIFIC C INFORMATION RELEASE */
2727
/* */
2828
/* ux_user.h PORTABLE C */
29-
/* 6.2.0 */
29+
/* 6.2.1 */
3030
/* */
3131
/* AUTHOR */
3232
/* */
@@ -89,6 +89,16 @@
8989
/* added host stack instance */
9090
/* creation strategy control, */
9191
/* 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 */
92102
/* */
93103
/**************************************************************************/
94104

@@ -409,6 +419,30 @@
409419

410420
/* #define UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT */
411421

422+
/* Defined, this macro disables interface alternate setting support.
423+
Device stalls
424+
*/
425+
/* UX_DEVICE_ALTERNATE_SETTING_SUPPORT_DISABLE */
426+
427+
428+
/* Defined, this macro disables device framework scan, where max number of endpoints (except EP0)
429+
and max number of interfaces are calculated at runtime, as a base to allocate memory for
430+
interfaces and endpoints structures and their buffers.
431+
Undefined, the following two macros must be defined to initialize memory structures.
432+
*/
433+
/* #define UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE */
434+
435+
/* Works if UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE is defined.
436+
This value represents max number of endpoints (except EP0) activated at the same time.
437+
*/
438+
/* #define UX_MAX_DEVICE_ENDPOINTS 2 */
439+
440+
/* Works if UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE is defined.
441+
This value represents max number of interfaces activated at the same time.
442+
*/
443+
/* #define UX_MAX_DEVICE_INTERFACES 1 */
444+
445+
412446
/* Defined, this macro enables device/host PIMA MTP support. */
413447

414448
/* #define UX_PIMA_WITH_MTP_SUPPORT */
@@ -421,6 +455,7 @@
421455

422456
/* #define UX_HOST_DEVICE_CLASS_CODE_VALIDATION_ENABLE */
423457

458+
424459
/* Defined, host HID interrupt OUT transfer is supported. */
425460

426461
/* #define UX_HOST_CLASS_HID_INTERRUPT_OUT_SUPPORT */
@@ -448,6 +483,12 @@
448483
*/
449484
/* #define UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_CONTROL UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_OWNED */
450485

486+
/* Defined, the _name in structs are referenced by pointer instead of by contents.
487+
By default the _name is an array of string that saves characters, the contents are compared to confirm match.
488+
If referenced by pointer the address pointer to const string is saved, the pointers are compared to confirm match.
489+
*/
490+
/* #define UX_NAME_REFERENCED_BY_POINTER */
491+
451492
/* Defined, this value will only enable the host side of usbx. */
452493
/* #define UX_HOST_SIDE_ONLY */
453494

@@ -522,6 +563,13 @@
522563
/* #define UX_ASSERT_FAIL for (;;) {tx_thread_sleep(UX_WAIT_FOREVER); } */
523564

524565

566+
/* Defined, this option enables the basic USBX error checking. This define is typically used
567+
when the application is debugging and removed after the application is fully debugged. */
568+
/*
569+
#define UX_ENABLE_ERROR_CHECKING
570+
*/
571+
572+
525573
/* DEBUG includes and macros for a specific platform go here. */
526574
#ifdef UX_INCLUDE_USER_DEFINE_BSP
527575
#include "usb_bsp.h"

common/core/src/ux_device_stack_control_request_process.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/* FUNCTION RELEASE */
3434
/* */
3535
/* _ux_device_stack_control_request_process PORTABLE C */
36-
/* 6.1.12 */
36+
/* 6.2.1 */
3737
/* AUTHOR */
3838
/* */
3939
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -91,6 +91,9 @@
9191
/* fixed parameter/variable */
9292
/* names conflict C++ keyword, */
9393
/* resulting in version 6.1.12 */
94+
/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
95+
/* fixed vendor request issue, */
96+
/* resulting in version 6.2.1 */
9497
/* */
9598
/**************************************************************************/
9699
UINT _ux_device_stack_control_request_process(UX_SLAVE_TRANSFER *transfer_request)
@@ -144,7 +147,8 @@ ULONG application_data_length;
144147
{
145148

146149
/* Check the request demanded and compare it to the application registered one. */
147-
if (request == _ux_system_slave -> ux_system_slave_device_vendor_request)
150+
if (_ux_system_slave -> ux_system_slave_device_vendor_request_function != UX_NULL &&
151+
request == _ux_system_slave -> ux_system_slave_device_vendor_request)
148152
{
149153

150154
/* This is a Microsoft extended function. It happens before the device is configured.

common/usbx_device_classes/inc/ux_device_class_audio.h

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* COMPONENT DEFINITION RELEASE */
2727
/* */
2828
/* ux_device_class_audio.h PORTABLE C */
29-
/* 6.2.0 */
29+
/* 6.2.1 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -62,6 +62,9 @@
6262
/* 10-31-2022 Yajun Xia Modified comment(s), */
6363
/* added standalone support, */
6464
/* resulting in version 6.2.0 */
65+
/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
66+
/* added error checks support, */
67+
/* resulting in version 6.2.1 */
6568
/* */
6669
/**************************************************************************/
6770

@@ -85,6 +88,13 @@ extern "C" {
8588
/* Compile option: if defined, audio interrupt endpoint is supported. */
8689
/* #define UX_DEVICE_CLASS_AUDIO_INTERRUPT_SUPPORT */
8790

91+
/* Internal option: enable the basic USBX error checking. This define is typically used
92+
while debugging application. */
93+
#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING)
94+
#define UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING
95+
#endif
96+
97+
8898

8999
/* Define Audio Class OS related constants. */
90100
#define UX_DEVICE_CLASS_AUDIO_FEEDBACK_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
@@ -514,12 +524,85 @@ VOID _ux_device_class_audio_interrupt_thread_entry(ULONG audio_inst);
514524
UINT _ux_device_class_audio_interrupt_task_function(UX_DEVICE_CLASS_AUDIO *audio);
515525
UINT _ux_device_class_audio_interrupt_send(UX_DEVICE_CLASS_AUDIO *audio, UCHAR *int_data);
516526

517-
#if defined(UX_DEVICE_STANDALONE)
518527
UINT _ux_device_class_audio_tasks_run(VOID *instance);
519-
#endif
528+
529+
530+
UINT _uxe_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command);
531+
532+
UINT _uxe_device_class_audio_ioctl(UX_DEVICE_CLASS_AUDIO *audio, ULONG ioctl_function,
533+
VOID *parameter);
534+
535+
UINT _uxe_device_class_audio_stream_get(UX_DEVICE_CLASS_AUDIO *audio, ULONG stream_index, UX_DEVICE_CLASS_AUDIO_STREAM **stream);
536+
537+
VOID _uxe_device_class_audio_write_thread_entry(ULONG audio_stream);
538+
VOID _uxe_device_class_audio_read_thread_entry(ULONG audio_stream);
539+
UINT _uxe_device_class_audio_write_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream);
540+
UINT _uxe_device_class_audio_read_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream);
541+
UINT _uxe_device_class_audio_reception_start(UX_DEVICE_CLASS_AUDIO_STREAM *audio);
542+
UINT _uxe_device_class_audio_sample_read8(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR *sample);
543+
UINT _uxe_device_class_audio_sample_read16(UX_DEVICE_CLASS_AUDIO_STREAM *audio, USHORT *sample);
544+
UINT _uxe_device_class_audio_sample_read24(UX_DEVICE_CLASS_AUDIO_STREAM *audio, ULONG *sample);
545+
UINT _uxe_device_class_audio_sample_read32(UX_DEVICE_CLASS_AUDIO_STREAM *audio, ULONG *sample);
546+
547+
UINT _uxe_device_class_audio_read_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR **frame_data, ULONG *frame_length);
548+
UINT _uxe_device_class_audio_read_frame_free(UX_DEVICE_CLASS_AUDIO_STREAM *audio);
549+
550+
UINT _uxe_device_class_audio_transmission_start(UX_DEVICE_CLASS_AUDIO_STREAM *audio);
551+
UINT _uxe_device_class_audio_frame_write(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR *frame, ULONG length);
552+
553+
UINT _uxe_device_class_audio_write_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR **buffer, ULONG *max_length);
554+
UINT _uxe_device_class_audio_write_frame_commit(UX_DEVICE_CLASS_AUDIO_STREAM *audio, ULONG length);
555+
556+
UINT _uxe_device_class_audio_feedback_set(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR *encoded_feedback);
557+
UINT _uxe_device_class_audio_feedback_get(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR *encoded_feedback);
558+
ULONG _uxe_device_class_audio_speed_get(UX_DEVICE_CLASS_AUDIO_STREAM *audio);
559+
560+
VOID _uxe_device_class_audio_interrupt_thread_entry(ULONG audio_inst);
561+
UINT _uxe_device_class_audio_interrupt_task_function(UX_DEVICE_CLASS_AUDIO *audio);
562+
UINT _uxe_device_class_audio_interrupt_send(UX_DEVICE_CLASS_AUDIO *audio, UCHAR *int_data);
563+
520564

521565
/* Define Device Class Audio API prototypes. */
522566

567+
#if defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING)
568+
569+
#define ux_device_class_audio_entry _ux_device_class_audio_entry
570+
571+
#define ux_device_class_audio_read_thread_entry _ux_device_class_audio_read_thread_entry
572+
#define ux_device_class_audio_write_thread_entry _ux_device_class_audio_write_thread_entry
573+
574+
#define ux_device_class_audio_read_task_function _ux_device_class_audio_read_task_function
575+
#define ux_device_class_audio_write_task_function _ux_device_class_audio_write_task_function
576+
577+
#define ux_device_class_audio_stream_get _uxe_device_class_audio_stream_get
578+
579+
#define ux_device_class_audio_reception_start _uxe_device_class_audio_reception_start
580+
#define ux_device_class_audio_sample_read8 _uxe_device_class_audio_sample_read8
581+
#define ux_device_class_audio_sample_read16 _uxe_device_class_audio_sample_read16
582+
#define ux_device_class_audio_sample_read24 _uxe_device_class_audio_sample_read24
583+
#define ux_device_class_audio_sample_read32 _uxe_device_class_audio_sample_read32
584+
585+
#define ux_device_class_audio_read_frame_get _uxe_device_class_audio_read_frame_get
586+
#define ux_device_class_audio_read_frame_free _uxe_device_class_audio_read_frame_free
587+
588+
#define ux_device_class_audio_transmission_start _uxe_device_class_audio_transmission_start
589+
#define ux_device_class_audio_frame_write _uxe_device_class_audio_frame_write
590+
591+
#define ux_device_class_audio_write_frame_get _uxe_device_class_audio_write_frame_get
592+
#define ux_device_class_audio_write_frame_commit _uxe_device_class_audio_write_frame_commit
593+
594+
#define ux_device_class_audio_ioctl _uxe_device_class_audio_ioctl
595+
596+
#define ux_device_class_audio_speed_get _ux_device_class_audio_speed_get
597+
#define ux_device_class_audio_feedback_thread_entry _ux_device_class_audio_feedback_thread_entry
598+
#define ux_device_class_audio_feedback_task_function _ux_device_class_audio_feedback_task_function
599+
#define ux_device_class_audio_feedback_get _uxe_device_class_audio_feedback_get
600+
#define ux_device_class_audio_feedback_set _uxe_device_class_audio_feedback_set
601+
602+
#define ux_device_class_audio_interrupt_send _uxe_device_class_audio_interrupt_send
603+
604+
#else
605+
523606
#define ux_device_class_audio_entry _ux_device_class_audio_entry
524607

525608
#define ux_device_class_audio_read_thread_entry _ux_device_class_audio_read_thread_entry
@@ -555,6 +638,8 @@ UINT _ux_device_class_audio_tasks_run(VOID *instance);
555638

556639
#define ux_device_class_audio_interrupt_send _ux_device_class_audio_interrupt_send
557640

641+
#endif
642+
558643
/* Determine if a C++ compiler is being used. If so, complete the standard
559644
C conditional started above. */
560645
#ifdef __cplusplus

common/usbx_device_classes/inc/ux_device_class_audio10.h

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* COMPONENT DEFINITION RELEASE */
2727
/* */
2828
/* ux_device_class_audio10.h PORTABLE C */
29-
/* 6.1.12 */
29+
/* 6.2.1 */
3030
/* AUTHOR */
3131
/* */
3232
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -53,6 +53,10 @@
5353
/* 07-29-2022 Chaoqiong Xiao Modified comment(s), */
5454
/* added sampling control, */
5555
/* resulting in version 6.1.12 */
56+
/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */
57+
/* added error checks support, */
58+
/* fixed a macro name, */
59+
/* resulting in version 6.2.1 */
5660
/* */
5761
/**************************************************************************/
5862

@@ -70,6 +74,13 @@ extern "C" {
7074
#endif
7175

7276

77+
/* Internal option: enable the basic USBX error checking. This define is typically used
78+
while debugging application. */
79+
#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING)
80+
#define UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING
81+
#endif
82+
83+
7384
/* Define Audio Class specific AC interface descriptor subclasses. */
7485

7586
#define UX_DEVICE_CLASS_AUDIO10_AC_UNDEFINED 0x00
@@ -377,7 +388,7 @@ typedef struct UX_DEVICE_CLASS_AUDIO10_CONTROL_STRUCT
377388

378389
#define UX_DEVICE_CLASS_AUDIO10_CONTROL_MUTE_CHANGED 1u
379390
#define UX_DEVICE_CLASS_AUDIO10_CONTROL_VOLUME_CHANGED 2u
380-
#define UX_DEVICE_CLASS_AUDIO20_CONTROL_FREQUENCY_CHANGED 4u
391+
#define UX_DEVICE_CLASS_AUDIO10_CONTROL_FREQUENCY_CHANGED 4u
381392

382393
typedef struct UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP_STRUCT
383394
{
@@ -389,8 +400,20 @@ UINT _ux_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio,
389400
UX_SLAVE_TRANSFER *transfer_request,
390401
UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP *group);
391402

403+
UINT _uxe_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio,
404+
UX_SLAVE_TRANSFER *transfer_request,
405+
UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP *group);
406+
407+
#if defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING)
408+
409+
#define ux_device_class_audio10_control_process _uxe_device_class_audio10_control_process
410+
411+
#else
412+
392413
#define ux_device_class_audio10_control_process _ux_device_class_audio10_control_process
393414

415+
#endif
416+
394417
/* Determine if a C++ compiler is being used. If so, complete the standard
395418
C conditional started above. */
396419
#ifdef __cplusplus

0 commit comments

Comments
 (0)