-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcycx3_uvcdscr.c
902 lines (820 loc) · 50.2 KB
/
cycx3_uvcdscr.c
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
/*
## Cypress USB 3.0 Platform source file (cycx3_uvcdscr.c)
## ===========================
##
## Copyright Cypress Semiconductor Corporation, 2010-2013,
## All Rights Reserved
## UNPUBLISHED, LICENSED SOFTWARE.
##
## CONFIDENTIAL AND PROPRIETARY INFORMATION
## WHICH IS THE PROPERTY OF CYPRESS.
##
## Use of this file is governed
## by the license agreement included in the file
##
## <install>/license/license.txt
##
## where <install> is the Cypress software
## installation root directory path.
##
## ===========================
*/
/* This file contains the USB enumeration descriptors for the CX3 UVC YUY2 application example.
* The descriptor arrays must be 32 byte aligned if the D-cache is turned on. If the linker
* used is not capable of supporting the aligned feature for this, then dynamically allocated
* buffer must be used, and the descriptor must be loaded into it. */
#include "cycx3_uvc.h"
#include "cyu3mipicsi.h"
/* Standard Device Descriptor for USB 3 */
const uint8_t CyCx3USB30DeviceDscr[] =
{
0x12, /* Descriptor size */
CY_U3P_USB_DEVICE_DESCR, /* Device descriptor type */
0x00, 0x03, /* USB 3.0 */
0xEF, /* Device class */
0x02, /* Device Sub-class */
0x01, /* Device protocol */
0x09, /* Maxpacket size for EP0 : 2^9 */
0xB4, 0x04, /* Vendor ID */
0xC3, 0x00, /* Product ID */
0x00, 0x00, /* Device release number */
0x01, /* Manufacture string index */
0x02, /* Product string index */
0x00, /* Serial number string index */
0x01 /* Number of configurations */
};
/* Standard Device Descriptor for USB 2 */
const uint8_t CyCx3USB20DeviceDscr[] =
{
0x12, /* Descriptor size */
CY_U3P_USB_DEVICE_DESCR, /* Device descriptor type */
0x10, 0x02, /* USB 2.1 */
0xEF, /* Device class */
0x02, /* Device sub-class */
0x01, /* Device protocol */
0x40, /* Maxpacket size for EP0 : 64 bytes */
0xB4, 0x04, /* Vendor ID */
0xC3, 0x00, /* Product ID */
0x00, 0x00, /* Device release number */
0x01, /* Manufacture string index */
0x02, /* Product string index */
0x00, /* Serial number string index */
0x01 /* Number of configurations */
};
/* Binary Device Object Store (BOS) Descriptor */
const uint8_t CyCx3USBBOSDscr[] =
{
0x05, /* Descriptor size */
CY_U3P_BOS_DESCR, /* Device descriptor type */
0x16, 0x00, /* Length of this descriptor and all sub descriptors */
0x02, /* Number of device capability descriptors */
/* USB 2.0 Extension */
0x07, /* Descriptor size */
CY_U3P_DEVICE_CAPB_DESCR, /* Device capability type descriptor */
CY_U3P_USB2_EXTN_CAPB_TYPE, /* USB 2.1 extension capability type */
0x02, 0x00, 0x00, 0x00, /* Supported device level features - LPM support */
/* SuperSpeed Device Capability */
0x0A, /* Descriptor size */
CY_U3P_DEVICE_CAPB_DESCR, /* Device capability type descriptor */
CY_U3P_SS_USB_CAPB_TYPE, /* SuperSpeed device capability type */
0x00, /* Supported device level features */
0x0E, 0x00, /* Speeds supported by the device : SS, HS and FS */
0x03, /* Functionality support */
0x00, /* U1 device exit latency */
0x00, 0x00 /* U2 device exit latency */
};
/* Standard Device Qualifier Descriptor */
const uint8_t CyCx3USBDeviceQualDscr[] =
{
0x0A, /* descriptor size */
CY_U3P_USB_DEVQUAL_DESCR, /* Device qualifier descriptor type */
0x00, 0x02, /* USB 2.0 */
0xEF, /* Device class */
0x02, /* Device sub-class */
0x01, /* Device protocol */
0x40, /* Maxpacket size for EP0 : 64 bytes */
0x01, /* Number of configurations */
0x00 /* Reserved */
};
/* Standard Super Speed Configuration Descriptor */
const uint8_t CyCx3USBSSConfigDscr[] =
{
/* Configuration Descriptor*/
0x09, /* Descriptor Size */
CY_U3P_USB_CONFIG_DESCR, /* Configuration Descriptor Type */
0xe5,0x00, /* Length of this descriptor and all sub descriptors */
0x02, /* Number of interfaces */
0x01, /* Configuration number */
0x03, /* Configuration string index */
0xC0, /* Config characteristics - Self Powered */
0x0C, /* Max power consumption of device (in 8mA unit) : 96mA */
/* Interface Association Descriptor */
0x08, /* Descriptor Size */
CX3_INTRFC_ASSN_DESCR, /* Interface Association Descriptor Type */
0x00, /* Interface number of the VideoControl interface
that is associated with this function*/
0x02, /* Number of contiguous Video interfaces that are
associated with this function */
0x0E, /* Video Interface Class Code: CC_VIDEO */
0x03, /* Subclass code: SC_VIDEO_INTERFACE_COLLECTION*/
0x00, /* Protocol: PC_PROTOCOL_UNDEFINED*/
0x00, /* String Descriptor index for interface */
/* Standard Video Control Interface Descriptor (Interface 0, Alternate Setting 0)*/
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x00, /* Index of this Interface */
0x00, /* Alternate setting number */
0x01, /* Number of end points - 1 Interrupt Endpoint*/
0x0E, /* Video Interface Class Code: CC_VIDEO */
0x01, /* Interface sub class: SC_VIDEOCONTROL */
0x00, /* Interface protocol code: PC_PROTOCOL_UNDEFINED.*/
0x00, /* Interface descriptor string index */
/* Class specific VC Interface Header Descriptor */
0x0D, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class Specific Interface Descriptor type: CS_INTERFACE */
0x01, /* Descriptor Sub type: VC_HEADER */
#ifdef CX3_UVC_1_0_SUPPORT
0x00, 0x01, /* Revision of UVC class spec: 1.0 - Legacy version */
#else
0x10, 0x01, /* Revision of UVC class spec: 1.1 - Minimum version required
for USB Compliance. Not supported on Windows XP*/
#endif
0x51, 0x00, /* Total Size of class specific descriptors
(till Output terminal) */
0x00, 0x6C, 0xDC, 0x02, /* Clock frequency : 48MHz(Deprecated) */
0x01, /* Number of streaming interfaces */
0x01, /*VideoStreaming interface 1 belongs to this
VideoControl interface*/
/* Input (Camera) Terminal Descriptor */
0x12, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* CS_INTERFACE */
0x02, /* VC_INPUT_TERMINAL subtype */
0x01, /* ID of this input terminal */
0x01, 0x02, /* ITT_CAMERA type. This terminal is a camera
terminal representing the CCD sensor*/
0x00, /* No association terminal */
0x00, /* Unused */
0x00, 0x00, /* No optical zoom supported */
0x00, 0x00, /* No optical zoom supported */
0x00, 0x00, /* No optical zoom supported */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
/* Processing Unit Descriptor */
0x0D, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x05, /* Processing Unit Descriptor type: VC_PROCESSING_UNIT*/
0x02, /* ID of this unit */
0x01, /* Source ID: 1: Conencted to input terminal */
0x00, 0x40, /* Digital multiplier */
0x03, /* Size of controls field for this terminal: 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
0x00, /* String desc index: Not used */
0x00, /* Analog Video Standards Supported: None */
/* Extension Unit Descriptor */
0x1C, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x06, /* Extension Unit Descriptor type */
0x03, /* ID of this terminal */
0xFF, 0xFF, 0xFF, 0xFF, /* 16 byte GUID */
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0x00, /* Number of controls in this terminal */
0x01, /* Number of input pins in this terminal */
0x02, /* Source ID : 2 : Connected to Proc Unit */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
0x00, /* String descriptor index : Not used */
/* Output Terminal Descriptor */
0x09, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x03, /* Output Terminal Descriptor type */
0x04, /* ID of this terminal */
0x01, 0x01, /* USB Streaming terminal type */
0x00, /* No association terminal */
0x03, /* Source ID : 3 : Connected to Extn Unit */
0x00, /* String desc index : Not used */
/* Video Control Status Interrupt Endpoint Descriptor */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint Descriptor Type */
CX3_EP_CONTROL_STATUS, /* Endpoint address and description: EP-2 IN */
CY_U3P_USB_EP_INTR, /* Interrupt End point Type */
0x40, 0x00, /* Max packet size: 64 bytes */
0x01, /* Servicing interval */
/* Super Speed Endpoint Companion Descriptor */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS Endpoint Companion Descriptor Type */
0x00, /* Max no. of packets in a Burst: 1 */
0x00, /* Attribute: N.A. */
0x40, /* Bytes per interval: 1024 */
0x00,
/* Class Specific Interrupt Endpoint Descriptor */
0x05, /* Descriptor size */
0x25, /* Class Specific Endpoint Descriptor Type */
CY_U3P_USB_EP_INTR, /* End point Sub Type */
0x40, 0x00, /* Max packet size = 64 bytes */
/* Standard Video Streaming Interface Descriptor (Interface 1, Alternate Setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x01, /* Interface number: 1 */
0x00, /* Alternate setting number: 0 */
0x01, /* Number of end points: 1 Bulk Endpoint */
0x0E, /* Interface class : CC_VIDEO */
0x02, /* Interface sub class : SC_VIDEOSTREAMING */
0x00, /* Interface protocol code : PC_PROTOCOL_UNDEFINED */
0x00, /* Interface descriptor string index */
/* Class-specific Video Streaming Input Header Descriptor */
0x0E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class-specific VS I/f Type */
0x01, /* Descriptor Subtype: Input Header */
0x01, /* 1 format desciptor follows */
0x52,0x00, /* Total size of Class specific VS descr */
CX3_EP_BULK_VIDEO, /* EP address for BULK video data: EP 3 IN */
0x00, /* No dynamic format change supported */
0x04, /* Output terminal ID : 4 */
0x02, /* > Still image capture method supported */
0x00, /* Hardware trigger NOT supported */
0x00, /* Hardware to initiate still image capture not supported */
0x01, /* Size of controls field : 1 byte */
0x00, /* D2 : Compression quality supported - No compression*/
/* Class specific Uncompressed VS format descriptor */
0x1B, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class-specific VS interface Type */
0x04, /* Subtype : VS_FORMAT_UNCOMPRESSED */
0x01, /* Format desciptor index */
0x01, /* Number of Frame Descriptors that follow this descriptor: 1 */
/* GUID, globally unique identifier used to identify streaming-encoding format: UYVY */
0X55,0X59,0X56,0X59,
0X00,0X00,0X10,0X00,
0X80,0X00,0X00,0XAA,
0X00,0X38,0X9B,0X71,
0x10, /* Number of bits per pixel: 16*/
0x01, /* Optimum Frame Index for this stream: 1 (720P) */
0x00, /* X dimension of the picture aspect ratio; Non-interlaced */
0x00, /* Y dimension of the pictuer aspect ratio: Non-interlaced */
0x00, /* Interlace Flags: Progressive scanning, no interlace */
0x00, /* duplication of the video stream restriction: 0 - no restriction */
/* Class specific Uncompressed VS Frame Descriptor 1 - 720P */
0x1E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Descriptor type*/
0x05, /* Subtype: Uncompressed frame interface*/
0x01, /* Frame Descriptor Index: 1 */
0x00, /* No Still image capture method supported */
0x00,0x05, /* Width in pixel: 1280 */
0xd0,0x02, /* Height in pixel: 720 */
0x00,0x00,0x5e,0x1a, /* Min bit rate (bits/s): 1280 x 720 x No Of Bits per Pixel x FrameRate = 442368000 */
0x00,0x00,0x5e,0x1a, /* Max bit rate (bits/s): Fixed rate so same as Min */
0x00,0x20,0x1c,0x00, /* Maximum video or still frame size in bytes(Deprecated): 1280 x 720 x 2 */
0x15,0x16,0x05,0x00, /* Default frame interval (in 100ns units): (1/30)x10^7 */
0x01, /* Frame interval type : No of discrete intervals */
0x15,0x16,0x05,0x00, /* Frame interval 3: Same as Default frame interval */
/* Still image descriptor -YUV with QVGA resolution */
0x0b, /*Size of this descriptor*/
0x24, /*CS_INTERFACE descriptor type*/
0x03, /*VS_STILL_IMAGE_FRAME descriptor subtype*/
0x00, /*If method 3 is used, endpoint address is mentioned here*/
0x01, //No of frame Resolutions Follows
0x00,0x05, /* Width in pixel: 1280=500*/ //1
0xd0,0x02, /* Height in pixel: 720=2d0*/
0x01, /*Compression patterns supported*/
0x00, /*No compression*/
/* Endpoint Descriptor for BULK Streaming Video Data */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint Descriptor Type */
CX3_EP_BULK_VIDEO, /* Endpoint address and description: EP 3 IN */
CY_U3P_USB_EP_BULK, /* BULK End point */
CX3_EP_BULK_VIDEO_PKT_SIZE_L, /* CX3_EP_BULK_VIDEO_PKT_SIZE_L */
CX3_EP_BULK_VIDEO_PKT_SIZE_H, /* CX3_EP_BULK_VIDEO_PKT_SIZE_H */
0x00, /* Servicing interval for data transfers */
/* Super Speed Endpoint Companion Descriptor */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS Endpoint Companion Descriptor Type */
0x0F, /* Max number of packets per burst: 12 */
0x00, /* Attribute: Streams not defined */
0x00, /* No meaning for bulk */
0x00
};
/* Standard High Speed Configuration Descriptor */
const uint8_t CyCx3USBHSConfigDscr[] =
{
/* Configuration descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
0xb7,0x00, /* Length of this descriptor and all sub descriptors */
0x02, /* Number of interfaces */
0x01, /* Configuration number */
0x04, /* Configuration string index */
0xC0, /* Config characteristics - self powered */
0x32, /* Max power consumption of device (in 2mA unit) : 100mA */
/* Interface Association Descriptor */
0x08, /* Descriptor Size */
CX3_INTRFC_ASSN_DESCR, /* Interface Association Descriptor Type */
0x00, /* Interface number of the VideoControl interface
that is associated with this function*/
0x02, /* Number of contiguous Video interfaces that are
associated with this function */
0x0E, /* Video Interface Class Code: CC_VIDEO */
0x03, /* Subclass code: SC_VIDEO_INTERFACE_COLLECTION*/
0x00, /* Protocol: PC_PROTOCOL_UNDEFINED*/
0x00, /* String Descriptor index for interface */
/* Standard Video Control Interface Descriptor (Interface 0, Alternate Setting 0)*/
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x00, /* Index of this Interface */
0x00, /* Alternate setting number */
0x01, /* Number of end points - 1 Interrupt Endpoint*/
0x0E, /* Video Interface Class Code: CC_VIDEO */
0x01, /* Interface sub class: SC_VIDEOCONTROL */
0x00, /* Interface protocol code: PC_PROTOCOL_UNDEFINED.*/
0x00, /* Interface descriptor string index */
/* Class specific VC Interface Header Descriptor */
0x0D, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class Specific Interface Descriptor type: CS_INTERFACE */
0x01, /* Descriptor Sub type: VC_HEADER */
#ifdef CX3_UVC_1_0_SUPPORT
0x00, 0x01, /* Revision of UVC class spec: 1.0 - Legacy version */
#else
0x10, 0x01, /* Revision of UVC class spec: 1.1 - Minimum version required
for USB Compliance. Not supported on Windows XP*/
#endif
0x51, 0x00, /* Total Size of class specific descriptors
(till Output terminal) */
0x00, 0x6C, 0xDC, 0x02, /* Clock frequency : 48MHz(Deprecated) */
0x01, /* Number of streaming interfaces */
0x01, /*VideoStreaming interface 1 belongs to this
VideoControl interface*/
/* Input (Camera) Terminal Descriptor */
0x12, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* CS_INTERFACE */
0x02, /* VC_INPUT_TERMINAL subtype */
0x01, /* ID of this input terminal */
0x01, 0x02, /* ITT_CAMERA type. This terminal is a camera
terminal representing the CCD sensor*/
0x00, /* No association terminal */
0x00, /* Unused */
0x00, 0x00, /* No optical zoom supported */
0x00, 0x00, /* No optical zoom supported */
0x00, 0x00, /* No optical zoom supported */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
/* Processing Unit Descriptor */
0x0D, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x05, /* Processing Unit Descriptor type: VC_PROCESSING_UNIT*/
0x02, /* ID of this unit */
0x01, /* Source ID: 1: Conencted to input terminal */
0x00, 0x40, /* Digital multiplier */
0x03, /* Size of controls field for this terminal: 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
0x00, /* String desc index: Not used */
0x00, /* Analog Video Standards Supported: None */
/* Extension Unit Descriptor */
0x1C, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x06, /* Extension Unit Descriptor type */
0x03, /* ID of this terminal */
0xFF, 0xFF, 0xFF, 0xFF, /* 16 byte GUID */
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0x00, /* Number of controls in this terminal */
0x01, /* Number of input pins in this terminal */
0x02, /* Source ID : 2 : Connected to Proc Unit */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
0x00, /* String descriptor index : Not used */
/* Output Terminal Descriptor */
0x09, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x03, /* Output Terminal Descriptor type */
0x04, /* ID of this terminal */
0x01, 0x01, /* USB Streaming terminal type */
0x00, /* No association terminal */
0x03, /* Source ID : 3 : Connected to Extn Unit */
0x00, /* String desc index : Not used */
/* Video Control Status Interrupt Endpoint Descriptor */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint Descriptor Type */
CX3_EP_CONTROL_STATUS, /* Endpoint address and description: EP-2 IN */
CY_U3P_USB_EP_INTR, /* Interrupt End point Type */
0x40, 0x00, /* Max packet size: 64 bytes */
0x01, /* Servicing interval */
/* Class Specific Interrupt Endpoint Descriptor */
0x05, /* Descriptor size */
0x25, /* Class specific endpoint descriptor type */
CY_U3P_USB_EP_INTR, /* End point sub type */
0x40,0x00, /* Max packet size = 64 bytes */
/* Standard Video Streaming Interface Descriptor (Interface 1, Alternate Setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x01, /* Interface number: 1 */
0x00, /* Alternate setting number: 0 */
0x01, /* Number of end points: 1 Bulk endopoint*/
0x0E, /* Interface class : CC_VIDEO */
0x02, /* Interface sub class : SC_VIDEOSTREAMING */
0x00, /* Interface protocol code : PC_PROTOCOL_UNDEFINED */
0x00, /* Interface descriptor string index */
/* Class-specific Video Streaming Input Header Descriptor */
0x0E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class-specific VS interface type */
0x01, /* Descriptotor subtype : Input Header */
0x01, /* 1 format desciptor follows */
0x65, 0x00, /* Total size of class specific VS descr */
CX3_EP_BULK_VIDEO, /* EP address for BULK video data: EP 3 IN */
0x00, /* No dynamic format change supported */
0x04, /* Output terminal ID : 4 */
0x00, /* No Still image capture method supported */
0x00, /* Hardware trigger not supported */
0x00, /* Hardware to initiate still image capture not supported*/
0x01, /* Size of controls field : 1 byte */
0x00, /* D2 : Compression quality supported - No compression */
/* Endpoint descriptor for Bulk streaming video data */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint Descriptor Type */
CX3_EP_BULK_VIDEO, /* Endpoint address and description: EP 3 IN */
CY_U3P_USB_EP_BULK, /* BULK End point */
0x00, /* Packet Size: 512 bytes */
0x02,
0x00 /* Servicing interval for data transfers */
};
/* Standard Full Speed Configuration Descriptor*/
const uint8_t CyCx3USBFSConfigDscr[] =
{
/* Configuration descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
#ifdef CX3_UVC_1_0_SUPPORT
0xEB,0x00, /* Length of this descriptor and all sub descriptors */
#else
0xEC,0x00, /* Length of this descriptor and all sub descriptors */
#endif
0x02, /* Number of interfaces */
0x01, /* Configuration number */
0x05, /* Configuration string index */
0xC0, /* Config characteristics - self powered */
0x32, /* Max power consumption of device (in 2mA unit) : 100mA */
/* Interface Association Descriptor */
0x08, /* Descriptor Size */
CX3_INTRFC_ASSN_DESCR, /* Interface Association Descriptor Type */
0x00, /* Interface number of the VideoControl interface
that is associated with this function*/
0x02, /* Number of contiguous Video interfaces that are
associated with this function */
0x0E, /* Video Interface Class Code: CC_VIDEO */
0x03, /* Subclass code: SC_VIDEO_INTERFACE_COLLECTION*/
0x00, /* Protocol: PC_PROTOCOL_UNDEFINED*/
0x00, /* String Descriptor index for interface */
/* Standard Video Control Interface Descriptor (Interface 0, Alternate Setting 0)*/
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x00, /* Index of this Interface */
0x00, /* Alternate setting number */
0x01, /* Number of end points - 1 Interrupt Endpoint*/
0x0E, /* Video Interface Class Code: CC_VIDEO */
0x01, /* Interface sub class: SC_VIDEOCONTROL */
0x00, /* Interface protocol code: PC_PROTOCOL_UNDEFINED.*/
0x00, /* Interface descriptor string index */
/* Class specific VC Interface Header Descriptor */
0x0D, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class Specific Interface Descriptor type: CS_INTERFACE */
0x01, /* Descriptor Sub type: VC_HEADER */
#ifdef CX3_UVC_1_0_SUPPORT
0x00, 0x01, /* Revision of UVC class spec: 1.0 - Legacy version */
0x50, 0x00, /* Total Size of class specific descriptors
(till Output terminal) */
#else
0x10, 0x01, /* Revision of UVC class spec: 1.1 - Minimum version required
for USB Compliance. Not supported on Windows XP*/
0x51, 0x00, /* Total Size of class specific descriptors
(till Output terminal) */
#endif
0x00, 0x6C, 0xDC, 0x02, /* Clock frequency : 48MHz(Deprecated) */
0x01, /* Number of streaming interfaces */
0x01, /*VideoStreaming interface 1 belongs to this
VideoControl interface*/
/* Input (Camera) Terminal Descriptor */
0x12, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* CS_INTERFACE */
0x02, /* VC_INPUT_TERMINAL subtype */
0x01, /* ID of this input terminal */
0x01, 0x02, /* ITT_CAMERA type. This terminal is a camera
terminal representing the CCD sensor*/
0x00, /* No association terminal */
0x00, /* Unused */
0x00, 0x00, /* No optical zoom supported */
0x00, 0x00, /* No optical zoom supported */
0x00, 0x00, /* No optical zoom supported */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
/* Processing Unit Descriptor */
#ifdef CX3_UVC_1_0_SUPPORT
0x0C, /* Descriptor size */
#else
0x0D, /* Descriptor size */
#endif
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x05, /* Processing Unit Descriptor type: VC_PROCESSING_UNIT*/
0x02, /* ID of this unit */
0x01, /* Source ID: 1: Conencted to input terminal */
0x00, 0x40, /* Digital multiplier */
0x03, /* Size of controls field for this terminal: 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
0x00, /* String desc index: Not used */
#ifndef CX3_UVC_1_0_SUPPORT
0x00, /* Analog Video Standards Supported: None */
#endif
/* Extension Unit Descriptor */
0x1C, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x06, /* Extension Unit Descriptor type */
0x03, /* ID of this terminal */
0xFF, 0xFF, 0xFF, 0xFF, /* 16 byte GUID */
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF,
0x00, /* Number of controls in this terminal */
0x01, /* Number of input pins in this terminal */
0x02, /* Source ID : 2 : Connected to Proc Unit */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00, 0x00, 0x00, /* No controls supported */
0x00, /* String descriptor index : Not used */
/* Output Terminal Descriptor */
0x09, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class specific interface desc type */
0x03, /* Output Terminal Descriptor type */
0x04, /* ID of this terminal */
0x01, 0x01, /* USB Streaming terminal type */
0x00, /* No association terminal */
0x03, /* Source ID : 3 : Connected to Extn Unit */
0x00, /* String desc index : Not used */
/* Video Control Status Interrupt Endpoint Descriptor */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint Descriptor Type */
CX3_EP_CONTROL_STATUS, /* Endpoint address and description: EP-2 IN */
CY_U3P_USB_EP_INTR, /* Interrupt End point Type */
0x40, 0x00, /* Max packet size: 64 bytes */
0x01, /* Servicing interval */
/* Class Specific Interrupt Endpoint Descriptor */
0x05, /* Descriptor size */
0x25, /* Class specific endpoint descriptor type */
CY_U3P_USB_EP_INTR, /* End point sub type */
0x40,0x00, /* Max packet size = 64 bytes */
/* Standard Video Streaming Interface Descriptor (Interface 1, Alternate Setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x01, /* Interface number: 1 */
0x00, /* Alternate setting number: 0 */
0x01, /* Number of end points: 1 Bulk endopoint*/
0x0E, /* Interface class : CC_VIDEO */
0x02, /* Interface sub class : SC_VIDEOSTREAMING */
0x00, /* Interface protocol code : PC_PROTOCOL_UNDEFINED */
0x00, /* Interface descriptor string index */
/* Class-specific Video Streaming Input Header Descriptor */
0x0E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class-specific VS interface type */
0x01, /* Descriptotor subtype : Input Header */
0x01, /* 1 format desciptor follows */
0x65, 0x00, /* Total size of class specific VS descr */
CX3_EP_BULK_VIDEO, /* EP address for BULK video data: EP 3 IN */
0x00, /* No dynamic format change supported */
0x04, /* Output terminal ID : 4 */
0x00, /* No Still image capture method supported */
0x00, /* Hardware trigger not supported */
0x00, /* Hardware to initiate still image capture not supported*/
0x01, /* Size of controls field : 1 byte */
0x00, /* D2 : Compression quality supported - No compression */
/* Class specific VS format descriptor */
0x1B, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class-specific VS interface Type */
0x04, /* Subtype : VS_FORMAT_UNCOMPRESSED */
0x01, /* Format desciptor index */
0x02, /* Number of Frame Descriptors that follow this descriptor: 2 */
/* GUID, globally unique identifier used to identify streaming-encoding format: YUY2 */
0x59, 0x55, 0x59, 0x32, /*MEDIASUBTYPE_YUY2 GUID: 32595559-0000-0010-8000-00AA00389B71 */
0x00, 0x00, 0x10, 0x00,
0x80, 0x00, 0x00, 0xAA,
0x00, 0x38, 0x9B, 0x71,
0x10, /* Number of bits per pixel: 16*/
0x02, /* Optimum Frame Index for this stream: 1 (320x240) */
0x00, /* X dimension of the picture aspect ratio; Non-interlaced */
0x00, /* Y dimension of the pictuer aspect ratio: Non-interlaced */
0x00, /* Interlace Flags: Progressive scanning, no interlace */
0x00, /* duplication of the video stream restriction: 0 - no restriction */
/* Class specific Uncompressed VS Frame Descriptor 1 - 320x240@5fps*/
0x1E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Descriptor type*/
0x05, /* Subtype: Uncompressed frame interface*/
0x01, /* Frame Descriptor Index: 1 */
0x00, /* No Still image capture method supported */
0x40, 0x01, /* Width in pixel: 320 */
0xF0, 0x00, /* Height in pixel: 240 */
0x00, 0xC0, 0x5D, 0x00, /* Min bit rate (bits/s): 320 x 240 x 2 x 5 x 8 = 6144000 */
0x00, 0xC0, 0x5D, 0x00, /* Max bit rate (bits/s): Fixed rate so same as Min */
0x00, 0x58, 0x02, 0x00, /* Maximum video or still frame size in bytes(Deprecated): 320 x 240 x 2*/
0x80, 0x84, 0x1E, 0x00, /* Default frame interval (in 100ns units): (1/5)x10^7 */
0x01, /* Frame interval type : No of discrete intervals */
0x80, 0x84, 0x1E, 0x00, /* Frame interval 3: Same as Default frame interval */
/* Class specific Uncompressed VS frame descriptor 2 - 320 x 240 @2fps - Needed only for compliance.
* The USBCV30 USB 2.0 UVC Tests 'Standard VS Interface Descriptor Test - Device Configured' and
* 'Standard VS Interface Descriptor Test - Device Addressed', Fail if only one VS Frame descriptor
* is provided.
*/
0x1E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Descriptor type*/
0x05, /* Subtype: Uncompressed frame interface*/
0x02, /* Frame Descriptor Index: 1 */
0x00, /* No Still image capture method supported */
0x40, 0x01, /* Width in pixel: 320 */
0xF0, 0x00, /* Height in pixel: 240 */
0x00, 0x80, 0x25, 0x00, /* Min bit rate (bits/s): 320 x 240 x 2 x 2 x 8 = 2457600 */
0x00, 0x80, 0x25, 0x00, /* Max bit rate (bits/s): Fixed rate so same as Min */
0x00, 0x58, 0x02, 0x00, /* Maximum video or still frame size in bytes(Deprecated): 320 x 240 x 2*/
0x40, 0x4B, 0x4C, 0x00, /* Default frame interval (in 100ns units): (1/5)x10^7 */
0x01, /* Frame interval type : No of discrete intervals */
0x40, 0x4B, 0x4C, 0x00, /* Frame interval 3: Same as Default frame interval */
/* Endpoint descriptor for Bulk streaming video data */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint Descriptor Type */
CX3_EP_BULK_VIDEO, /* Endpoint address and description: EP 3 IN */
CY_U3P_USB_EP_BULK, /* BULK End point */
0x40, /* EP Packet Size: 64 bytes */
0x00,
0x00 /* Servicing interval for data transfers */
};
/* Standard language ID string descriptor */
const uint8_t CyCx3USBStringLangIDDscr[] =
{
0x04, /* Descriptor size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
0x09,0x04 /* Language ID supported */
};
/* Standard manufacturer string descriptor */
const uint8_t CyCx3USBManufactureDscr[] =
{
0x10, /* Descriptor size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
'C',0x00, /* Manufacturer String */
'y',0x00,
'p',0x00,
'r',0x00,
'e',0x00,
's',0x00,
's',0x00
};
/* Standard product string descriptor */
const uint8_t CyCx3USBProductDscr[] =
{
0x10, /* Descriptor Size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
'C', 0x00, /* Product Descriptor String */
'X', 0x00,
'3', 0x00,
'-', 0x00,
'U', 0x00,
'V', 0x00,
'C', 0x00
};
/* Standard product string descriptor */
const uint8_t CyCx3USBConfigSSDscr[] =
{
0x10, /* Descriptor Size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
'U', 0x00, /* Super-Speed Configuration Descriptor */
'S', 0x00,
'B', 0x00,
'-', 0x00,
'3', 0x00,
'.', 0x00,
'0', 0x00
};
/* Standard product string descriptor */
const uint8_t CyCx3USBConfigHSDscr[] =
{
0x10, /* Descriptor Size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
'U', 0x00, /* High-Speed Configuration Descriptor */
'S', 0x00,
'B', 0x00,
'-', 0x00,
'2', 0x00,
'.', 0x00,
'1', 0x00
};
/* Standard product string descriptor */
const uint8_t CyCx3USBConfigFSDscr[] =
{
0x10, /* Descriptor Size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
'U', 0x00, /* Full-Speed Configuration Descriptor */
'S', 0x00,
'B', 0x00,
'-', 0x00,
'1', 0x00,
'.', 0x00,
'1', 0x00
};
/* UVC Probe Control Settings */
uint8_t glProbeCtrl[CX3_UVC_MAX_PROBE_SETTING] = {
0x00, 0x00, /* bmHint : No fixed parameters */
0x01, /* Use 1st Video format index */
0x01, /* Use 1st Video frame index */
0x0A, 0x8B, 0x02, 0x00, /* Desired frame interval in 100ns */
0x00, 0x00, /* Key frame rate in key frame/video frame units */
0x00, 0x00, /* PFrame rate in PFrame / key frame units */
0x00, 0x00, /* Compression quality control */
0x00, 0x00, /* Window size for average bit rate */
0x00, 0x00, /* Internal video streaming i/f latency in ms */
0x00, 0x48, 0x3F, 0x00, /* Max video frame size in bytes */
#ifdef CX3_UVC_1_0_SUPPORT
0x00, 0x90, 0x00, 0x00 /* No. of bytes device can rx in single payload: 32KB */
#else
/* UVC 1.1 Probe Control has additional fields from UVC 1.0 */
0x00, 0x90, 0x00, 0x00, /* No. of bytes device can rx in single payload: 32KB */
0x00, 0x60, 0xE3, 0x16, /* Device Clock */
0x00, /* Framing Information - Ignored for uncompressed format*/
0x00, /* Preferred payload format version */
0x00, /* Minimum payload format version */
0x00 /* Maximum payload format version */
#endif
};
/* UVC Probe Control Setting - 720P*/
uint8_t const gl720PProbeCtrl[CX3_UVC_MAX_PROBE_SETTING] = {
0x00, 0x00, /* bmHint : No fixed parameters */
0x01, /* Use 1st Video format index */
0x01, /* Use 1st Video frame index */
0x15,0x16,0x05,0x00, /* Desired frame interval in 100ns = (1/30)x10^7 */
0x00, 0x00, /* Key frame rate in key frame/video frame units */
0x00, 0x00, /* PFrame rate in PFrame / key frame units */
0x00, 0x00, /* Compression quality control */
0x00, 0x00, /* Window size for average bit rate */
0x00, 0x00, /* Internal video streaming i/f latency in ms */
0x00,0x20,0x1c,0x00, /* Max video frame size in bytes = 1920 x 1080 x 2 */
#ifdef CX3_UVC_1_0_SUPPORT
0x00, 0x90, 0x00, 0x00 /* No. of bytes device can rx in single payload: 36KB */
#else
/* UVC 1.1 Probe Control has additional fields from UVC 1.0 */
0x00, 0x90, 0x00, 0x00, /* No. of bytes device can rx in single payload: 36KB */
0x00, 0x60, 0xE3, 0x16, /* Device Clock */
0x00, /* Framing Information - Ignored for uncompressed format*/
0x00, /* Preferred payload format version */
0x00, /* Minimum payload format version */
0x00 /* Maximum payload format version */
#endif
};
/* Configuration parameters for 5Mp @15FPS for the OV5640 sensor */
CyU3PMipicsiCfg_t cfgUvc5Mp15NoMclk = {
CY_U3P_CSI_DF_YUV422_8_2,
2,
1,
64,
CY_U3P_CSI_PLL_FRS_500_1000M,
CY_U3P_CSI_PLL_CLK_DIV_8,
CY_U3P_CSI_PLL_CLK_DIV_8,
0,
CY_U3P_CSI_PLL_CLK_DIV_2,
2592,
0x01
};
/* Configuration parameters for 1080p @30FPS for the OV5640 sensor */
CyU3PMipicsiCfg_t cfgUvc1080p30NoMclk = {
CY_U3P_CSI_DF_YUV422_8_2, /* dataFormat */
2, /* numDataLanes */
1, /* pllPrd */
62, /* pllFbd */
CY_U3P_CSI_PLL_FRS_500_1000M, /* pllFrs */
CY_U3P_CSI_PLL_CLK_DIV_8, /* csiRxClkDiv */
CY_U3P_CSI_PLL_CLK_DIV_8, /* parClkDiv */
0x00, /* mclkCtl */
CY_U3P_CSI_PLL_CLK_DIV_8, /* mClkRefDiv */
1920, /* hResolution */
0x01 /* fifoDelay */
};
/* Configuration parameters for 720p @60FPS for the OV5640 sensor */
CyU3PMipicsiCfg_t cfgUvc720p60NoMclk = {
CY_U3P_CSI_DF_YUV422_8_2, /* dataFormat */
2, /* numDataLanes */
1, /* pllPrd */
62, /* pllFbd */
CY_U3P_CSI_PLL_FRS_250_500M, /* pllFrs */
CY_U3P_CSI_PLL_CLK_DIV_4, /* csiRxClkDiv */
CY_U3P_CSI_PLL_CLK_DIV_4, /* parClkDiv */
0x00, /* mclkCtl */
CY_U3P_CSI_PLL_CLK_DIV_8, /* mClkRefDiv */
1280, /* hResolution */
0x01 /* fifoDelay */
};
/* Configuration parameters for VGA for the OV5640 sensor */
CyU3PMipicsiCfg_t cfgUvcVgaNoMclk = {
CY_U3P_CSI_DF_YUV422_8_2, /* dataFormat */
1, /* numDataLanes */
0x1, /* pllPrd */
90, /* pllFbd */
CY_U3P_CSI_PLL_FRS_125_250M, /* pllFrs */
CY_U3P_CSI_PLL_CLK_DIV_2, /* csiRxClkDiv */
CY_U3P_CSI_PLL_CLK_DIV_8, /* parClkDiv */
0x00, /* mclkCtl */
CY_U3P_CSI_PLL_CLK_DIV_8, /* mClkRefDiv */
640, /* hResolution */
0x01 /* fifoDelay */
};
/* [ ] */