-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusb_device_descriptor.c
More file actions
1226 lines (1147 loc) · 59 KB
/
usb_device_descriptor.c
File metadata and controls
1226 lines (1147 loc) · 59 KB
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
* Copyright 2016, 2019 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "usb_device_config.h"
#include "usb.h"
#include "usb_device.h"
#include "usb_device_class.h"
#include "usb_device_audio.h"
#include "usb_audio_config.h"
#include "usb_device_descriptor.h"
#include "tdm2usb.h"
#include "usb_device_strings.h"
/**
* +-------------------+
* <- EP 2 IN (data) [SOURCE] +----+ CLOCK_SOURCE (6) +----+
* +--------------+ | +-------------------+ |
* USB | | I2S | |
* PC <-------+ IN <-------+ DEV +---------v----------+ +----------v----------+
* | | RX | INPUT_TERMINAL (2) +------>+ OUTPUT_TERMINAL (4) |
* +--------------+ | Microphone | | USB Streaming |
* GENERATOR +--------------------+ +---------------------+
*
*
* <- EP 1 IN (feedback) +-------------------+
* -> EP 1 OUT (data) [SINK] +----+ CLOCK_SOURCE (5) +----+
* +--------------+ | +-------------------+ |
* USB | | I2S | |
* PC +-------> OUT +-------> DEV +---------v----------+ +----------v----------+
* | | TX | INPUT_TERMINAL (1) +------>+ OUTPUT_TERMINAL (3) |
* +--------------+ | USB Streaming | | Speaker |
* SPEAKER +--------------------+ +---------------------+
*
* ...................................................................................................
*
* +------------------------------+------------------------------+
* | | |
* | Source | Sink |
* | | |
* +----------------------------------------------------------------------------+
* | | | |
* | Asynchronous | Free running Fs | Free running Fs |
* | | | |
* | | Provides implicit | Provides explicit |
* | | feedforward (data stream) | feedback (isochronous pipe) |
* | | | |
* +----------------------------------------------------------------------------+
* | | | |
* | Synchronous | Fs locked to SOF | Fs locked to SOF |
* | | | | <--- (with programmable PLL)
* | | Uses implicit feedback (SOF) | Uses implicit feedback (SOF) |
* | | | |
* +----------------------------------------------------------------------------+
* | | | |
* | Adaptive | Fs locked to sink | Fs locked to data flow |
* | | | |
* | | Uses explicit feedback | Uses implicit feedforward |
* | | (isochronous pipe) | (data stream) |
* | | | |
* +--------------+------------------------------+------------------------------+
*
* GENERATOR [source]: - Synch EP
* - USB_DEVICE_AUDIO_USE_SYNC_MODE not set
* - No feedback EP
*
* SPEAKER [sink]: - Asynch EP
* - USB_DEVICE_AUDIO_USE_SYNC_MODE set by default
* - Feedback EP only when USB_DEVICE_AUDIO_USE_SYNC_MODE is NOT set
*/
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Prototypes
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
/* Audio device stream endpoint information */
usb_device_endpoint_struct_t g_UsbDeviceAudiodeviceInEndpoints[USB_AUDIO_STREAM_IN_ENDPOINT_COUNT] = {
/* Audio device ISO IN pipe */
{
USB_AUDIO_STREAM_IN_ENDPOINT_TYPE,
USB_AUDIO_STREAM_IN_ENDPOINT | (USB_IN << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT),
USB_ENDPOINT_ISOCHRONOUS,
FS_ISO_IN_ENDP_PACKET_SIZE + (AUDIO_FORMAT_CHANNELS * AUDIO_FORMAT_SIZE),
FS_ISO_IN_ENDP_INTERVAL,
},
};
usb_device_endpoint_struct_t g_UsbDeviceAudiodeviceOutEndpoints[USB_AUDIO_STREAM_OUT_ENDPOINT_COUNT] = {
/* Audio device ISO OUT pipe */
{
USB_AUDIO_STREAM_OUT_ENDPOINT_TYPE,
USB_AUDIO_STREAM_OUT_ENDPOINT | (USB_OUT << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT),
USB_ENDPOINT_ISOCHRONOUS,
FS_ISO_OUT_ENDP_PACKET_SIZE + (AUDIO_FORMAT_CHANNELS * AUDIO_FORMAT_SIZE),
FS_ISO_OUT_ENDP_INTERVAL,
},
{
USB_AUDIO_STREAM_IN_FEEDBACK_ENDPOINT_TYPE,
USB_AUDIO_STREAM_IN_FEEDBACK_ENDPOINT | (USB_IN << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT),
USB_ENDPOINT_ISOCHRONOUS,
FS_ISO_IN_FEEDBACK_ENDP_PACKET_SIZE,
FS_ISO_IN_FEEDBACK_ENDP_INTERVAL,
},
};
/* Audio device control endpoint information */
usb_device_endpoint_struct_t g_UsbDeviceAudioControlEndpoints[USB_AUDIO_CONTROL_ENDPOINT_COUNT] = {
{
USB_AUDIO_CONTROL_ENDPOINT_TYPE,
USB_AUDIO_CONTROL_ENDPOINT | (USB_IN << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT),
USB_ENDPOINT_INTERRUPT,
FS_INTERRUPT_IN_PACKET_SIZE,
FS_INTERRUPT_IN_INTERVAL,
},
};
/* Audio device entity struct */
usb_device_audio_entity_struct_t g_UsbDeviceAudioEntity[] = {
{
USB_AUDIO_IN_CONTROL_CLOCK_SOURCE_ENTITY_ID,
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_CLOCK_SOURCE_UNIT,
0U,
},
{
USB_AUDIO_OUT_CONTROL_CLOCK_SOURCE_ENTITY_ID,
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_CLOCK_SOURCE_UNIT,
0U,
},
{
USB_AUDIO_IN_CONTROL_INPUT_TERMINAL_ID,
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_INPUT_TERMINAL,
0U,
},
{
USB_AUDIO_OUT_CONTROL_INPUT_TERMINAL_ID,
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_INPUT_TERMINAL,
0U,
},
{
USB_AUDIO_IN_CONTROL_OUTPUT_TERMINAL_ID,
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_OUTPUT_TERMINAL,
0U,
},
{
USB_AUDIO_OUT_CONTROL_OUTPUT_TERMINAL_ID,
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_OUTPUT_TERMINAL,
0U,
},
};
/* Audio device entity information */
usb_device_audio_entities_struct_t g_UsbDeviceAudioEntities = {
g_UsbDeviceAudioEntity,
sizeof(g_UsbDeviceAudioEntity) / sizeof(usb_device_audio_entity_struct_t),
};
/* Audio device control interface information */
usb_device_interface_struct_t g_UsbDeviceAudioControInterface[] = {{
USB_AUDIO_CONTROL_INTERFACE_ALTERNATE_0,
{
USB_AUDIO_CONTROL_ENDPOINT_COUNT,
g_UsbDeviceAudioControlEndpoints,
},
&g_UsbDeviceAudioEntities,
}};
/* Audio device stream interface information */
usb_device_interface_struct_t g_UsbDeviceAudioStreamInInterface[] = {
{
USB_AUDIO_STREAM_INTERFACE_ALTERNATE_0,
{
0U,
NULL,
},
NULL,
},
{
USB_AUDIO_STREAM_INTERFACE_ALTERNATE_1,
{
USB_AUDIO_STREAM_IN_ENDPOINT_COUNT,
g_UsbDeviceAudiodeviceInEndpoints,
},
NULL,
},
};
/* Audio device stream interface information */
usb_device_interface_struct_t g_UsbDeviceAudioStreamOutInterface[] = {
{
USB_AUDIO_STREAM_INTERFACE_ALTERNATE_0,
{
0U,
NULL,
},
NULL,
},
{
USB_AUDIO_STREAM_INTERFACE_ALTERNATE_1,
{
USB_AUDIO_STREAM_OUT_ENDPOINT_COUNT,
g_UsbDeviceAudiodeviceOutEndpoints,
},
NULL,
},
};
/* Define interfaces for audio device */
usb_device_interfaces_struct_t g_UsbDeviceAudioInterfaces[USB_AUDIO_INTERFACE_COUNT] = {
{
USB_AUDIO_INTERFACE_CONTROL,
USB_AUDIO_CLASS, /* Audio class code */
USB_SUBCLASS_AUDIOCONTROL, /* Audio control subclass code */
USB_AUDIO_PROTOCOL, /* Audio protocol code */
USB_AUDIO_CONTROL_INTERFACE_INDEX, /* The interface number of the Audio control */
g_UsbDeviceAudioControInterface, /* The handle of Audio control */
sizeof(g_UsbDeviceAudioControInterface) / sizeof(usb_device_interface_struct_t),
},
{
USB_AUDIO_INTERFACE_STREAM_IN,
USB_AUDIO_CLASS, /* Audio class code */
USB_SUBCLASS_AUDIOSTREAM, /* Audio stream subclass code */
USB_AUDIO_PROTOCOL, /* Audio protocol code */
USB_AUDIO_STREAM_IN_INTERFACE_INDEX, /* The interface number of the Audio control */
g_UsbDeviceAudioStreamInInterface, /* The handle of Audio stream */
sizeof(g_UsbDeviceAudioStreamInInterface) / sizeof(usb_device_interface_struct_t),
},
{
USB_AUDIO_INTERFACE_STREAM_OUT,
USB_AUDIO_CLASS, /* Audio class code */
USB_SUBCLASS_AUDIOSTREAM, /* Audio stream subclass code */
USB_AUDIO_PROTOCOL, /* Audio protocol code */
USB_AUDIO_STREAM_OUT_INTERFACE_INDEX, /* The interface number of the Audio control */
g_UsbDeviceAudioStreamOutInterface, /* The handle of Audio stream */
sizeof(g_UsbDeviceAudioStreamOutInterface) / sizeof(usb_device_interface_struct_t),
}};
/* Define configurations for audio device */
usb_device_interface_list_t g_UsbDeviceAudioInterfaceList[USB_DEVICE_CONFIGURATION_COUNT] = {
{
USB_AUDIO_INTERFACE_COUNT,
g_UsbDeviceAudioInterfaces,
},
};
/* Define class information for audio device */
usb_device_class_struct_t g_UsbDeviceAudioClass = {
g_UsbDeviceAudioInterfaceList,
kUSB_DeviceClassTypeAudio,
USB_DEVICE_CONFIGURATION_COUNT,
};
/**
* Device Descriptor:
* bLength 18
* bDescriptorType 1
* bcdUSB 2.00
* bDeviceClass 0
* bDeviceSubClass 0
* bDeviceProtocol 0
* bMaxPacketSize0 64
* idVendor 0x1fc9 NXP Semiconductors
* idProduct 0x0097
* bcdDevice 1.01
* iManufacturer 1 NXP SEMICONDUCTORS
* iProduct 2 USB AUDIO DEMO
* iSerial 0
* bNumConfigurations 1
*/
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceDescriptor[] = {
USB_DESCRIPTOR_LENGTH_DEVICE, /* Size of this descriptor in bytes */
USB_DESCRIPTOR_TYPE_DEVICE, /* DEVICE Descriptor Type */
USB_SHORT_GET_LOW(USB_DEVICE_SPECIFIC_BCD_VERSION),
USB_SHORT_GET_HIGH(USB_DEVICE_SPECIFIC_BCD_VERSION), /* USB Specification Release Number in
Binary-Coded Decimal (i.e., 2.10 is 210H). */
USB_DEVICE_CLASS, /* Class code (assigned by the USB-IF). */
USB_DEVICE_SUBCLASS, /* Subclass code (assigned by the USB-IF). */
USB_DEVICE_PROTOCOL, /* Protocol code (assigned by the USB-IF). */
USB_CONTROL_MAX_PACKET_SIZE, /* Maximum packet size for endpoint zero
(only 8, 16, 32, or 64 are valid) */
USB_SHORT_GET_LOW(USB_DEVICE_VID),
USB_SHORT_GET_HIGH(USB_DEVICE_VID), /* Vendor ID (assigned by the USB-IF) */
USB_SHORT_GET_LOW(USB_DEVICE_PID),
USB_SHORT_GET_HIGH(USB_DEVICE_PID), /* Product ID (assigned by the manufacturer) */
USB_SHORT_GET_LOW(USB_DEVICE_DEMO_BCD_VERSION),
USB_SHORT_GET_HIGH(USB_DEVICE_DEMO_BCD_VERSION), /* Device release number in binary-coded decimal */
0x01U, /* Index of string descriptor describing manufacturer */
0x02U, /* Index of string descriptor describing product */
0x03U, /* Index of string descriptor describing the
device's serial number */
USB_DEVICE_CONFIGURATION_COUNT, /* Number of possible configurations */
};
#define TOTAL_LENGHT (USB_DESCRIPTOR_LENGTH_CONFIGURE + \
USB_AUDIO_INTERFACE_ASSOCIATION_DESC_LENGTH + \
USB_DESCRIPTOR_LENGTH_INTERFACE + \
USB_AUDIO_CONTROL_INTERFACE_HEADER_LENGTH + \
(2 * USB_AUDIO_CLOCK_SOURCE_DESC_LENGTH) + \
(2 * USB_AUDIO_INPUT_TERMINAL_DESC_LENGTH) + \
(2 * USB_AUDIO_OUTPUT_TERMINAL_DESC_LENGTH) + \
USB_DESCRIPTOR_LENGTH_INTERFACE + \
USB_DESCRIPTOR_LENGTH_INTERFACE + \
USB_AUDIO_AS_INTERFACE_DESC_LENGTH + \
USB_AUDIO_TYPE_I_FORMAT_TYPE_DESC_LENGTH + \
USB_AUDIO_STANDARD_AS_ISO_DATA_ENDPOINT_LENGTH + \
USB_AUDIO_CLASS_SPECIFIC_ENDPOINT_LENGTH + \
USB_DESCRIPTOR_LENGTH_INTERFACE + \
USB_DESCRIPTOR_LENGTH_INTERFACE + \
USB_AUDIO_AS_INTERFACE_DESC_LENGTH + \
USB_AUDIO_TYPE_I_FORMAT_TYPE_DESC_LENGTH + \
USB_AUDIO_STANDARD_AS_ISO_DATA_ENDPOINT_LENGTH + \
USB_AUDIO_STANDARD_AS_ISO_DATA_ENDPOINT_LENGTH + \
USB_AUDIO_CLASS_SPECIFIC_ENDPOINT_LENGTH)
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceConfigurationDescriptor[] = {
/**
* Configuration Descriptor:
* bLength 9
* bDescriptorType 2
* wTotalLength 0x00e9
* bNumInterfaces 3
* bConfigurationValue 1
* iConfiguration 0
* bmAttributes 0xc0
* Self Powered
* MaxPower 500mA
*/
USB_DESCRIPTOR_LENGTH_CONFIGURE, /* Size of this descriptor in bytes */
USB_DESCRIPTOR_TYPE_CONFIGURE, /* CONFIGURATION Descriptor Type */
USB_SHORT_GET_LOW(TOTAL_LENGHT),
USB_SHORT_GET_HIGH(TOTAL_LENGHT), /* Total length of data returned for this configuration. */
USB_AUDIO_INTERFACE_COUNT, /* Number of interfaces supported by this configuration */
USB_AUDIO_CONFIGURE_INDEX, /* Value to use as an argument to the
SetConfiguration() request to select this configuration */
0x00U, /* Index of string descriptor describing this configuration */
(USB_DESCRIPTOR_CONFIGURE_ATTRIBUTE_D7_MASK) |
(USB_DEVICE_CONFIG_SELF_POWER << USB_DESCRIPTOR_CONFIGURE_ATTRIBUTE_SELF_POWERED_SHIFT) |
(USB_DEVICE_CONFIG_REMOTE_WAKEUP << USB_DESCRIPTOR_CONFIGURE_ATTRIBUTE_REMOTE_WAKEUP_SHIFT),
/* Configuration characteristics
D7: Reserved (set to one)
D6: Self-powered
D5: Remote Wakeup
D4...0: Reserved (reset to zero)
*/
0xFAU, /** Maximum power consumption of the USB
* device from the bus in this specific
* configuration when the device is fully
* operational. Expressed in 2 mA units
* (i.e., 50 = 100 mA).
*/
/**
* Interface Association:
* bLength 8
* bDescriptorType 11
* bFirstInterface 0
* bInterfaceCount 3
* bFunctionClass 1 Audio
* bFunctionSubClass 0
* bFunctionProtocol 32
* iFunction 4
*/
USB_AUDIO_INTERFACE_ASSOCIATION_DESC_LENGTH, /* Descriptor size is 8 bytes */
USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION, /* INTERFACE_ASSOCIATION Descriptor Type */
0x00U, /* The first interface number associated with this function is 0 */
0x03U, /* The number of contiguous interfaces associated with this function is 3 */
USB_AUDIO_CLASS, /* The function belongs to the Audio Interface Class */
0x00U, /* The function belongs to the SUBCLASS_UNDEFINED Subclass */
USB_AUDIO_PROTOCOL, /* Protocol code = 32 */
0x04U, /* The Function string descriptor index is 4 */
/**
* Interface Descriptor:
* bLength 9
* bDescriptorType 4
* bInterfaceNumber 0
* bAlternateSetting 0
* bNumEndpoints 0
* bInterfaceClass 1 Audio
* bInterfaceSubClass 1 Control Device
* bInterfaceProtocol 32
* iInterface 5
*/
USB_DESCRIPTOR_LENGTH_INTERFACE, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_INTERFACE, /* INTERFACE Descriptor Type */
USB_AUDIO_CONTROL_INTERFACE_INDEX, /* The number of this interface is 0 */
USB_AUDIO_CONTROL_INTERFACE_ALTERNATE_0, /* The value used to select the alternate setting for this interface is 0 */
0x00U, /* The number of endpoints used by this interface is 0 (excluding endpoint zero) */
USB_AUDIO_CLASS, /* The interface implements the Audio Interface class */
USB_SUBCLASS_AUDIOCONTROL, /* The interface implements the AUDIOCONTROL Subclass */
USB_AUDIO_PROTOCOL, /* The Protocol code is 32 */
0x05U, /* The interface string descriptor index is 5 */
/**
* AudioControl Interface Descriptor:
* bLength 9
* bDescriptorType 36
* bDescriptorSubtype 1 (HEADER)
* bcdADC 2.00
* bCategory 8
* wTotalLength 0x0061
* bmControls 0x00
*/
USB_AUDIO_CONTROL_INTERFACE_HEADER_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_HEADER, /* HEADER descriptor subtype */
0x00U,
0x02U, /* Audio Device compliant to the USB Audio specification version 2.00 */
0x08U, /* IO_BOX(0x08) : Indicating the primary use of this audio function */
0x61U,
0x00U, /* Total number of bytes returned for the class-specific AudioControl interface descriptor. Includes
the combined length of this descriptor header and all Unit and Terminal descriptors. */
0x00U, /* D1..0: Latency Control */
/**
* AudioControl Interface Descriptor:
* bLength 8
* bDescriptorType 36
* bDescriptorSubtype 10 (CLOCK_SOURCE)
* bClockID 16
* bmAttributes 1 Internal fixed clock
* bmControls 0x07
* Clock Frequency Control (read/write)
* Clock Validity Control (read-only)
* bAssocTerminal 0
* iClockSource 6
*/
USB_AUDIO_CLOCK_SOURCE_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_CLOCK_SOURCE_UNIT, /* CLOCK_SOURCE descriptor subtype */
USB_AUDIO_IN_CONTROL_CLOCK_SOURCE_ENTITY_ID, /* Constant uniquely identifying the Clock Source Entity within
the audio funcion */
0x01U, /* D1..0: 01: Internal Fixed Clock
D2: 0 Clock is not synchronized to SOF
D7..3: Reserved, should set to 0 */
0x07U, /* D1..0: Clock Frequency Control is present and Host programmable
D3..2: Clock Validity Control is present but read-only
D7..4: Reserved, should set to 0 */
0x00U, /* This Clock Source has no association */
0x06U, /* Index of a string descriptor, describing the Clock Source Entity */
/**
* AudioControl Interface Descriptor:
* bLength 8
* bDescriptorType 36
* bDescriptorSubtype 10 (CLOCK_SOURCE)
* bClockID 17
* bmAttributes 1 Internal fixed clock
* bmControls 0x07
* Clock Frequency Control (read/write)
* Clock Validity Control (read-only)
* bAssocTerminal 0
* iClockSource 6
*/
USB_AUDIO_CLOCK_SOURCE_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_CLOCK_SOURCE_UNIT, /* CLOCK_SOURCE descriptor subtype */
USB_AUDIO_OUT_CONTROL_CLOCK_SOURCE_ENTITY_ID, /* Constant uniquely identifying the Clock Source Entity within
the audio funcion */
0x01U, /* D1..0: 01: Internal Fixed Clock
D2: 0 Clock is not synchronized to SOF
D7..3: Reserved, should set to 0 */
0x07U, /* D1..0: Clock Frequency Control is present and Host programmable
D3..2: Clock Validity Control is present but read-only
D7..4: Reserved, should set to 0 */
0x00U, /* This Clock Source has no association */
0x06U, /* Index of a string descriptor, describing the Clock Source Entity */
/**
* AudioControl Interface Descriptor:
* bLength 17
* bDescriptorType 36
* bDescriptorSubtype 2 (INPUT_TERMINAL)
* bTerminalID 1
* wTerminalType 0x0201 Microphone
* bAssocTerminal 0
* bCSourceID 16
* bNrChannels 16
* bmChannelConfig 0x00000000
* iChannelNames 0
* bmControls 0x0000
* iTerminal 9
*/
USB_AUDIO_INPUT_TERMINAL_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_INPUT_TERMINAL, /* INPUT_TERMINAL descriptor subtype */
USB_AUDIO_IN_CONTROL_INPUT_TERMINAL_ID, /* Constant uniquely identifying the Terminal within the audio
function. This value is used in all requests to address this Terminal. */
0x01U,
0x02U, /* A generic microphone that does not fit under any of the other classifications. */
0x00U, /* This Input Terminal has no association */
USB_AUDIO_IN_CONTROL_CLOCK_SOURCE_ENTITY_ID, /* ID of the Clock Entity to which this Input Terminal is
connected. */
0x10U, /* This Terminal's output audio channel cluster has 16 logical output channels */
0x00U,
0x00U,
0x00U,
0x00U, /* Describes the spatial location of the logical channels:: Mono, no spatial location */
0x00U, /* Index of a string descriptor, describing the name of the first logical channel. */
0x00U,
0x00U, /* bmControls D1..0: Copy Protect Control is not present
D3..2: Connector Control is not present
D5..4: Overload Control is not present
D7..6: Cluster Control is not present
D9..8: Underflow Control is not present
D11..10: Overflow Control is not present
D15..12: Reserved, should set to 0*/
0x09U, /* Index of a string descriptor, describing the Input Terminal. */
/**
* AudioControl Interface Descriptor:
* bLength 17
* bDescriptorType 36
* bDescriptorSubtype 2 (INPUT_TERMINAL)
* bTerminalID 4
* wTerminalType 0x0101 (USB Streaming)
* bAssocTerminal 0
* bCSourceID 17
* bNrChannels 16
* bmChannelConfig 0x00000000
* iChannelNames 0
* bmControls 0x0000
* iTerminal 7
*/
USB_AUDIO_INPUT_TERMINAL_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_INPUT_TERMINAL, /* INPUT_TERMINAL descriptor subtype */
USB_AUDIO_OUT_CONTROL_INPUT_TERMINAL_ID, /* Constant uniquely identifying the Terminal within the audio
function. This value is used in all requests to address this Terminal. */
0x01U,
0x01U, /* USB Streaming. */
0x00U, /* This Input Terminal has no association */
USB_AUDIO_OUT_CONTROL_CLOCK_SOURCE_ENTITY_ID, /* ID of the Clock Entity to which this Input Terminal is
connected. */
0x10U, /* This Terminal's output audio channel cluster has 16 logical output channels */
0x00U,
0x00U,
0x00U,
0x00U, /* Describes the spatial location of the logical channels:: Mono, no spatial location */
0x00U, /* Index of a string descriptor, describing the name of the first logical channel. */
0x00U,
0x00U, /* bmControls D1..0: Copy Protect Control is not present
D3..2: Connector Control is not present
D5..4: Overload Control is not present
D7..6: Cluster Control is not present
D9..8: Underflow Control is not present
D11..10: Overflow Control is not present
D15..12: Reserved, should set to 0*/
0x07U, /* Index of a string descriptor, describing the Input Terminal. */
/**
* AudioControl Interface Descriptor:
* bLength 12
* bDescriptorType 36
* bDescriptorSubtype 3 (OUTPUT_TERMINAL)
* bTerminalID 3
* wTerminalType 0x0101 USB Streaming
* bAssocTerminal 0
* bSourceID 2
* bCSourceID 16
* bmControls 0x0000
* iTerminal 8
*/
USB_AUDIO_OUTPUT_TERMINAL_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_OUTPUT_TERMINAL, /* OUTPUT_TERMINAL descriptor subtype */
USB_AUDIO_IN_CONTROL_OUTPUT_TERMINAL_ID, /* Constant uniquely identifying the Terminal within the audio
function. This value is used in all requests to address this Terminal. */
0x01U,
0x01U, /* A Terminal dealing with a signal carried over an endpoint in an AudioStreaming interface. The
AudioStreaming interface descriptor points to the associated Terminal through the bTerminalLink field. */
0x00U, /* This Output Terminal has no association */
USB_AUDIO_IN_CONTROL_INPUT_TERMINAL_ID, /* ID of the Unit or Terminal to which this Terminal is connected. */
USB_AUDIO_IN_CONTROL_CLOCK_SOURCE_ENTITY_ID, /* ID of the Clock Entity to which this Output Terminal is
connected */
0x00U,
0x00U, /* bmControls: D1..0: Copy Protect Control is not present
D3..2: Connector Control is not present
D5..4: Overload Control is not present
D7..6: Underflow Control is not present
D9..8: Overflow Control is not present
D15..10: Reserved, should set to 0 */
0x08U, /* Index of a string descriptor, describing the Output Terminal. */
/**
* AudioControl Interface Descriptor:
* bLength 12
* bDescriptorType 36
* bDescriptorSubtype 3 (OUTPUT_TERMINAL)
* bTerminalID 6
* wTerminalType 0x0301 Speaker
* bAssocTerminal 0
* bSourceID 4
* bCSourceID 17
* bmControls 0x0000
* iTerminal 10
*/
USB_AUDIO_OUTPUT_TERMINAL_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_CONTROL_OUTPUT_TERMINAL, /* OUTPUT_TERMINAL descriptor subtype */
USB_AUDIO_OUT_CONTROL_OUTPUT_TERMINAL_ID, /* Constant uniquely identifying the Terminal within the audio
function. This value is used in all requests to address this Terminal. */
0x01U,
0x03U, /* Speaker */
0x00U, /* This Output Terminal has no association */
USB_AUDIO_OUT_CONTROL_INPUT_TERMINAL_ID, /* ID of the Unit or Terminal to which this Terminal is connected. */
USB_AUDIO_OUT_CONTROL_CLOCK_SOURCE_ENTITY_ID, /* ID of the Clock Entity to which this Output Terminal is
connected */
0x00U,
0x00U, /* bmControls: D1..0: Copy Protect Control is not present
D3..2: Connector Control is not present
D5..4: Overload Control is not present
D7..6: Underflow Control is not present
D9..8: Overflow Control is not present
D15..10: Reserved, should set to 0 */
0x0AU, /* Index of a string descriptor, describing the Output Terminal. */
/**
* Interface Descriptor:
* bLength 9
* bDescriptorType 4
* bInterfaceNumber 1
* bAlternateSetting 0
* bNumEndpoints 0
* bInterfaceClass 1 Audio
* bInterfaceSubClass 2 Streaming
* bInterfaceProtocol 32
* iInterface 13
*/
USB_DESCRIPTOR_LENGTH_INTERFACE, /* Descriptor size is 9 bytes */
USB_DESCRIPTOR_TYPE_INTERFACE, /* INTERFACE Descriptor Type */
USB_AUDIO_STREAM_IN_INTERFACE_INDEX, /* The number of this interface is 1. */
USB_AUDIO_STREAM_INTERFACE_ALTERNATE_0, /* The value used to select the alternate setting for this interface is 0 */
0x00U, /* The number of endpoints used by this interface is 0 (excluding endpoint zero) */
USB_AUDIO_CLASS, /* The interface implements the Audio Interface class */
USB_SUBCLASS_AUDIOSTREAM, /* The interface implements the AUDIOSTREAMING Subclass */
USB_AUDIO_PROTOCOL, /* The Protocol code is 32 */
0x0DU, /* Index of a string descriptor */
/**
* Interface Descriptor:
* bLength 9
* bDescriptorType 4
* bInterfaceNumber 1
* bAlternateSetting 1
* bNumEndpoints 1
* bInterfaceClass 1 Audio
* bInterfaceSubClass 2 Streaming
* bInterfaceProtocol 32
* iInterface 14
*/
USB_DESCRIPTOR_LENGTH_INTERFACE, /* Descriptor size is 9 bytes */
USB_DESCRIPTOR_TYPE_INTERFACE, /* INTERFACE Descriptor Type */
USB_AUDIO_STREAM_IN_INTERFACE_INDEX, /*The number of this interface is 1. */
USB_AUDIO_STREAM_INTERFACE_ALTERNATE_1, /* The value used to select the alternate setting for this interface is 1 */
USB_AUDIO_STREAM_IN_ENDPOINT_COUNT, /* The number of endpoints used by this interface is 1 (excluding endpoint zero) */
USB_AUDIO_CLASS, /* The interface implements the Audio Interface class */
USB_SUBCLASS_AUDIOSTREAM, /* The interface implements the AUDIOSTREAMING Subclass */
USB_AUDIO_PROTOCOL, /* The Protocol code is 32 */
0x0EU, /* Index of a string descriptor */
/**
* AudioStreaming Interface Descriptor:
* bLength 16
* bDescriptorType 36
* bDescriptorSubtype 1 (AS_GENERAL)
* bTerminalLink 3
* bmControls 0x00
* bFormatType 1
* bmFormats 0x00000001
* PCM
* bNrChannels 16
* bmChannelConfig 0x00000000
* iChannelNames 0
*/
USB_AUDIO_AS_INTERFACE_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_STREAMING_AS_GENERAL, /* AS_GENERAL descriptor subtype */
USB_AUDIO_IN_CONTROL_OUTPUT_TERMINAL_ID, /* The Terminal ID of the terminal to which this interface is
connected */
0x00U, /* bmControls : D1..0: Active Alternate Setting Control is not present
D3..2: Valid Alternate Settings Control is not present
D7..4: Reserved, should set to 0 */
USB_AUDIO_FORMAT_TYPE_I, /* The format type AudioStreaming interfae using is FORMAT_TYPE_I (0x01) */
0x01U,
0x00U,
0x00U,
0x00U, /* The Audio Data Format that can be Used to communicate with this interface */
AUDIO_FORMAT_CHANNELS, /* Number of physical channels in the AS Interface audio channel cluster */
0x00U,
0x00U,
0x00U,
0x00U, /* Describes the spatial location of the logical channels: */
0x00U, /* Index of a string descriptor, describing the name of the first physical channel */
/**
* AudioStreaming Interface Descriptor:
* bLength 6
* bDescriptorType 36
* bDescriptorSubtype 2 (FORMAT_TYPE)
* bFormatType 1 (FORMAT_TYPE_I)
* bSubslotSize 4
* bBitResolution 32
*/
USB_AUDIO_TYPE_I_FORMAT_TYPE_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_STREAMING_FORMAT_TYPE, /* FORMAT_TYPE descriptor subtype */
USB_AUDIO_FORMAT_TYPE_I, /* The format type AudioStreaming interfae using is FORMAT_TYPE_I (0x01) */
0x04U, /* The number of bytes occupied by one audio subslot. Can be 1, 2, 3 or 4. */
0x20U, /* The number of effectively used bits from the available bits in an audio subslot */
/**
* Endpoint Descriptor:
* bLength 7
* bDescriptorType 5
* bEndpointAddress 0x82 EP 2 IN
* bmAttributes 5
* Transfer Type Isochronous
* Synch Type Asynchronous
* Usage Type Data
* wMaxPacketSize 0x01C0 1x 448 bytes
* bInterval 1
*/
/* ENDPOINT Descriptor */
USB_AUDIO_STANDARD_AS_ISO_DATA_ENDPOINT_LENGTH, /* Descriptor size is 7 bytes */
USB_DESCRIPTOR_TYPE_ENDPOINT, /* ENDPOINT Descriptor Type */
USB_AUDIO_STREAM_IN_ENDPOINT | (USB_IN << 7), /* This is an IN endpoint with endpoint number 2 */
0x05U, /* Types -
Transfer: ISOCHRONOUS
Sync: Async
Usage: Data EP */
USB_SHORT_GET_LOW(FS_ISO_IN_ENDP_PACKET_SIZE + (AUDIO_FORMAT_CHANNELS * AUDIO_FORMAT_SIZE)),
USB_SHORT_GET_HIGH(FS_ISO_IN_ENDP_PACKET_SIZE + (AUDIO_FORMAT_CHANNELS * AUDIO_FORMAT_SIZE)), /* Maximum packet size for this endpoint */
FS_ISO_IN_ENDP_INTERVAL, /* The polling interval value is every 1 Frames. If Hi-Speed, every 1 uFrames */
/**
* AudioStreaming Endpoint Descriptor:
* bLength 8
* bDescriptorType 37
* bDescriptorSubtype 1 (EP_GENERAL)
* bmAttributes 0x00
* bmControls 0x00
* bLockDelayUnits 0 Undefined
* wLockDelay 0x0000
*/
USB_AUDIO_CLASS_SPECIFIC_ENDPOINT_LENGTH, /* Size of the descriptor, in bytes */
USB_AUDIO_STREAM_ENDPOINT_DESCRIPTOR, /* CS_ENDPOINT Descriptor Type */
USB_AUDIO_EP_GENERAL_DESCRIPTOR_SUBTYPE, /* AUDIO_EP_GENERAL descriptor subtype */
0x00U,
0x00U,
0x00U,
0x00U,
0x00U,
/**
* Interface Descriptor:
* bLength 9
* bDescriptorType 4
* bInterfaceNumber 2
* bAlternateSetting 0
* bNumEndpoints 0
* bInterfaceClass 1 Audio
* bInterfaceSubClass 2 Streaming
* bInterfaceProtocol 32
* iInterface 11
*/
USB_DESCRIPTOR_LENGTH_INTERFACE, /* Descriptor size is 9 bytes */
USB_DESCRIPTOR_TYPE_INTERFACE, /* INTERFACE Descriptor Type */
USB_AUDIO_STREAM_OUT_INTERFACE_INDEX, /* The number of this interface is 2. */
USB_AUDIO_STREAM_INTERFACE_ALTERNATE_0, /* The value used to select the alternate setting for this interface is 0 */
0x00U, /* The number of endpoints used by this interface is 0 (excluding endpoint zero) */
USB_AUDIO_CLASS, /* The interface implements the Audio Interface class */
USB_SUBCLASS_AUDIOSTREAM, /* The interface implements the AUDIOSTREAMING Subclass */
USB_AUDIO_PROTOCOL, /* The Protocol code is 32 */
0x0BU, /* Index of a string descriptor */
/**
* Interface Descriptor:
* bLength 9
* bDescriptorType 4
* bInterfaceNumber 2
* bAlternateSetting 1
* bNumEndpoints 2
* bInterfaceClass 1 Audio
* bInterfaceSubClass 2 Streaming
* bInterfaceProtocol 32
* iInterface 12
*/
USB_DESCRIPTOR_LENGTH_INTERFACE, /* Descriptor size is 9 bytes */
USB_DESCRIPTOR_TYPE_INTERFACE, /* INTERFACE Descriptor Type */
USB_AUDIO_STREAM_OUT_INTERFACE_INDEX, /*The number of this interface is 2. */
USB_AUDIO_STREAM_INTERFACE_ALTERNATE_1, /* The value used to select the alternate setting for this interface is 1 */
USB_AUDIO_STREAM_OUT_ENDPOINT_COUNT, /* The number of endpoints used by this interface */
USB_AUDIO_CLASS, /* The interface implements the Audio Interface class */
USB_SUBCLASS_AUDIOSTREAM, /* The interface implements the AUDIOSTREAMING Subclass */
USB_AUDIO_PROTOCOL, /* The Protocol code is 32 */
0x0CU, /* Index of a string descriptor */
/**
* AudioStreaming Interface Descriptor:
* bLength 16
* bDescriptorType 36
* bDescriptorSubtype 1 (AS_GENERAL)
* bTerminalLink 4
* bmControls 0x00
* bFormatType 1
* bmFormats 0x00000001
* PCM
* bNrChannels 16
* bmChannelConfig 0x00000000
* iChannelNames 0
*/
USB_AUDIO_AS_INTERFACE_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_STREAMING_AS_GENERAL, /* AS_GENERAL descriptor subtype */
USB_AUDIO_OUT_CONTROL_INPUT_TERMINAL_ID, /* The Terminal ID of the terminal to which this interface is
connected */
0x00U, /* bmControls : D1..0: Active Alternate Setting Control is not present
D3..2: Valid Alternate Settings Control is not present
D7..4: Reserved, should set to 0 */
USB_AUDIO_FORMAT_TYPE_I, /* The format type AudioStreaming interfae using is FORMAT_TYPE_I (0x01) */
0x01U,
0x00U,
0x00U,
0x00U, /* The Audio Data Format that can be Used to communicate with this interface */
AUDIO_FORMAT_CHANNELS, /* Number of physical channels in the AS Interface audio channel cluster */
0x00U,
0x00U,
0x00U,
0x00U, /* Describes the spatial location of the logical channels: */
0x00U, /* Index of a string descriptor, describing the name of the first physical channel */
/**
* AudioStreaming Interface Descriptor:
* bLength 6
* bDescriptorType 36
* bDescriptorSubtype 2 (FORMAT_TYPE)
* bFormatType 1 (FORMAT_TYPE_I)
* bSubslotSize 4
* bBitResolution 32
*/
USB_AUDIO_TYPE_I_FORMAT_TYPE_DESC_LENGTH, /* Size of the descriptor, in bytes */
USB_DESCRIPTOR_TYPE_AUDIO_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_DESCRIPTOR_SUBTYPE_AUDIO_STREAMING_FORMAT_TYPE, /* FORMAT_TYPE descriptor subtype */
USB_AUDIO_FORMAT_TYPE_I, /* The format type AudioStreaming interfae using is FORMAT_TYPE_I (0x01) */
0x04U, /* The number of bytes occupied by one audio subslot. Can be 1, 2, 3 or 4. */
0x20U, /* The number of effectively used bits from the available bits in an audio subslot */
/**
* Endpoint Descriptor:
* bLength 7
* bDescriptorType 5
* bEndpointAddress 0x01 EP 1 OUT
* bmAttributes 5
* Transfer Type Isochronous
* Synch Type Asynchronous
* Usage Type Data
* wMaxPacketSize 0x01C0 1x 448 bytes
* bInterval 1
*/
/* ENDPOINT Descriptor */
USB_AUDIO_STANDARD_AS_ISO_DATA_ENDPOINT_LENGTH, /* Descriptor size is 7 bytes */
USB_DESCRIPTOR_TYPE_ENDPOINT, /* ENDPOINT Descriptor Type */
USB_AUDIO_STREAM_OUT_ENDPOINT | (USB_OUT << 7), /* This is an IN endpoint with endpoint number 2 */
0x05U, /* Types -
Transfer: ISOCHRONOUS
Sync: Async
Usage: Data EP */
USB_SHORT_GET_LOW(FS_ISO_OUT_ENDP_PACKET_SIZE + (AUDIO_FORMAT_CHANNELS * AUDIO_FORMAT_SIZE)),
USB_SHORT_GET_HIGH(FS_ISO_OUT_ENDP_PACKET_SIZE + (AUDIO_FORMAT_CHANNELS * AUDIO_FORMAT_SIZE)), /* Maximum packet size for this endpoint */
FS_ISO_OUT_ENDP_INTERVAL, /* The polling interval value is every 1 Frames. If Hi-Speed, every 1 uFrames */
/**
* Endpoint Descriptor:
* bLength 7
* bDescriptorType 5
* bEndpointAddress 0x81 EP 1 IN
* bmAttributes 15
* Transfer Type Isochronous
* Synch Type Asynchronous
* Usage Type Feedback
* wMaxPacketSize 0x0004 1x 4 bytes
* bInterval 4
*/
/* ENDPOINT Descriptor */
USB_AUDIO_STANDARD_AS_ISO_DATA_ENDPOINT_LENGTH, /* Descriptor size is 7 bytes */
USB_DESCRIPTOR_TYPE_ENDPOINT, /* ENDPOINT Descriptor Type */
USB_AUDIO_STREAM_OUT_ENDPOINT | (USB_IN << 7), /* This is an IN endpoint with endpoint number 2 */
0x15U, /* Types -
Transfer: ISOCHRONOUS
Sync: Async
Usage: Data EP */
USB_SHORT_GET_LOW(FS_ISO_IN_FEEDBACK_ENDP_PACKET_SIZE),
USB_SHORT_GET_HIGH(FS_ISO_IN_FEEDBACK_ENDP_PACKET_SIZE), /* Maximum packet size for this endpoint */
FS_ISO_IN_FEEDBACK_ENDP_INTERVAL, /* The polling interval value */
/**
* AudioStreaming Endpoint Descriptor:
* bLength 8
* bDescriptorType 37
* bDescriptorSubtype 1 (EP_GENERAL)
* bmAttributes 0x00
* bmControls 0x00
* bLockDelayUnits 0 Undefined
* wLockDelay 0x0000
*/
USB_AUDIO_CLASS_SPECIFIC_ENDPOINT_LENGTH, /* Size of the descriptor, in bytes */
USB_AUDIO_STREAM_ENDPOINT_DESCRIPTOR, /* CS_ENDPOINT Descriptor Type */
USB_AUDIO_EP_GENERAL_DESCRIPTOR_SUBTYPE, /* AUDIO_EP_GENERAL descriptor subtype */
0x00U,
0x00U,
0x00U,
0x00U,
0x00U,
};
/* Define string descriptor */
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringNull0[] = {
2U + 2U,
USB_DESCRIPTOR_TYPE_STRING,
0x09U,
0x04U,
};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringManufacturer1[] = {
USB_STRING_MANUFACTURER};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringProduct2[] = {
USB_STRING_PRODUCT};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringSerial3[] = {
USB_STRING_SERIAL};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringSourceSink4[] = {
USB_STRING_SOURCE_SINK};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringTopologyControl5[] = {
USB_STRING_TOPOLOGY_CONTROL};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceString48000Hz6[] = {
USB_STRING_48000HZ};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringUsbhOut7[] = {
USB_STRING_USBH_OUT};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringUsbhIn8[] = {
USB_STRING_USBH_IN};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringUsbdOut9[] = {
USB_STRING_USBD_OUT};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringUsbdIn10[] = {
USB_STRING_USBD_IN};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringPlaybackInactive11[] = {
USB_STRING_PLAYBACK_INACTIVE};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringPlaybackActive12[] = {
USB_STRING_PLAYBACK_ACTIVE};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringCaptureInactive13[] = {
USB_STRING_CAPTURE_INACTIVE};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceStringCaptureActive14[] = {
USB_STRING_CAPTURE_ACTIVE};
uint32_t g_UsbDeviceStringDescriptorLength[USB_DEVICE_STRING_COUNT] = {
sizeof(g_UsbDeviceStringNull0),
sizeof(g_UsbDeviceStringManufacturer1),
sizeof(g_UsbDeviceStringProduct2),
sizeof(g_UsbDeviceStringSerial3),