Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _VIDEODESCRIPTORS_H_
00037 #define _VIDEODESCRIPTORS_H_
00038
00039
00040
00041
00042
00043
00044
00045
00046 #include <stdint.h>
00047 #include <USBVideo.h>
00048
00049
00050
00051
00052
00053 #define FRAME_BPP (16)
00054
00055 #define FRAME_BUFFER_SIZEC(W,H) ((W)*(H)*FRAME_BPP/8)
00056
00057 #define FRAME_BITRATEC(W,H,FR) ((FR)*FRAME_BUFFER_SIZEC(W,H)*8)
00058
00059 #define FRAME_INTERVALC(FR) (1*1000*1000*(1000/100)/(FR))
00060
00061 #define FRAME_PACKET_SIZE_FS 640
00062
00063
00064 #define FRAME_PACKET_SIZE_HS (1020)
00065
00066
00067 #define FRAME_PAYLOAD_HDR_SIZE 2
00068
00069
00070 #define ISO_HIGH_BW_MODE 2
00071
00072 #define VIDCAMD_EpDesc_MaxPacketSize (FRAME_PACKET_SIZE_HS | (ISO_HIGH_BW_MODE << 11))
00073
00074
00075 #define VIDCAMD_ControlInterfaceNum 0
00076
00077 #define VIDCAMD_StreamInterfaceNum 1
00078
00079 #define VIDCAMD_IsoInEndpointNum 2
00080
00081
00082 #define VIDCAMD_NumFrameTypes 3
00083
00084 #define VIDCAMD_FW_1 320
00085 #define VIDCAMD_FH_1 240
00086
00087 #define VIDCAMD_FW_2 640
00088 #define VIDCAMD_FH_2 480
00089
00090 #define VIDCAMD_FW_3 176
00091 #define VIDCAMD_FH_3 144
00092
00093
00094
00095
00096 #pragma pack(1)
00097 #if defined ( __CC_ARM )
00098 #elif defined ( __ICCARM__ )
00099 #define __attribute__(...)
00100 #define __packed__ packed
00101 #elif defined ( __GNUC__ )
00102 #define __packed__ aligned(1)
00103 #endif
00104
00105
00106
00107 typedef struct _UsbVideoControlInterfaceHeader1 {
00108 uint8_t bLength;
00109 uint8_t bDescriptorType;
00110 uint8_t bDescriptorSubType;
00111 uint16_t bcdVDC;
00112 uint16_t wTotalLength;
00113 uint32_t dwClockFrequency;
00114 uint8_t bInCollection;
00115 uint8_t bInterface1;
00116 } UsbVideoControlInterfaceHeader1;
00117
00118
00119
00120
00121 typedef struct _UsbVideoInputHeaderDescriptor1 {
00122 uint8_t bLength;
00123 uint8_t bDescriptorType;
00124 uint8_t bDescriptorSubType;
00125 uint8_t bNumFormats;
00126 uint16_t wTotalLength;
00127 uint8_t bEndpointAddress;
00128 uint8_t bmInfo;
00129 uint8_t bTerminalLink;
00130 uint8_t bStillCaptureMethod;
00131 uint8_t bTriggerSupport;
00132 uint8_t bTriggerUsage;
00133 uint8_t bControlSize;
00134 uint8_t bmaControls1;
00135 } UsbVideoInputHeaderDescriptor1;
00136
00137
00138
00139
00140 typedef struct _UsbVideoControlInterfaceDescriptor {
00141 UsbVideoControlInterfaceHeader1 header;
00142 USBVideoCameraTerminalDescriptor it;
00143 USBVideoOutputTerminalDescriptor ot;
00144 } UsbVideoControlInterfaceDescriptor;
00145
00146
00147 typedef struct _UsbVideoFormatDescriptor {
00148 USBVideoUncompressedFormatDescriptor payload;
00149 USBVideoUncompressedFrameDescriptor1 frame320x240;
00150 USBVideoUncompressedFrameDescriptor1 frame640x480;
00151 USBVideoUncompressedFrameDescriptor1 frame160x120;
00152 USBVideoColorMatchingDescriptor colorUncompressed;
00153 } UsbVideoFormatDescriptor;
00154
00155 typedef struct _UsbVideoStreamingInterfaceDescriptor {
00156 UsbVideoInputHeaderDescriptor1 inHeader;
00157 UsbVideoFormatDescriptor format;
00158 } UsbVideoStreamingInterfaceDescriptor;
00159
00160 struct UsbVideoCamConfigurationDescriptors {
00161
00162 USBConfigurationDescriptor configuration;
00163
00164 USBInterfaceAssociationDescriptor iad;
00165
00166 USBInterfaceDescriptor interface0;
00167
00168 UsbVideoControlInterfaceDescriptor vcInterface;
00169
00170 USBInterfaceDescriptor interface10;
00171
00172 UsbVideoStreamingInterfaceDescriptor vsInterface;
00173
00174 USBInterfaceDescriptor interface11;
00175
00176 USBEndpointDescriptor ep11;
00177 };
00178
00179 #pragma pack()
00180
00181
00182
00183 #endif