Skip to content

Instantly share code, notes, and snippets.

@topnotcher
Created January 12, 2014 19:47
Show Gist options
  • Save topnotcher/8389482 to your computer and use it in GitHub Desktop.
Save topnotcher/8389482 to your computer and use it in GitHub Desktop.
USB_Device_Config_Descriptor device_configuration = {
.config = {
.bLength = sizeof(USB_StdDescriptor_Configuration_Header_t),
.bDescriptorType = DESC_CONFIGURATION,
.wTotalLength = sizeof(USB_Device_Config_Descriptor),
.bNumInterfaces = 2,
.bConfigurationValue = 1,
.iConfiguration = 0, /*unused*/
.bmAttributes = 0x80, /*bus power, no wakeup*/
.bMaxPower = 0x32, /*100mA*/
},
.video_iad = {
.bLength = sizeof(USB_IAD),
.bDescriptorType = 0x0B, /*Interface Assoc*/
.bFirstInterface = 0,
.bInterfaceCount = 2, /*num video interfaces*/
.bFunctionClass = USB_CC_VIDEO,
.bFunctionSubClass = USB_UVC_SC_VIDEO_INTERFACE_COLLECTION,
.bFunctionProtocol = USB_UVC_PC_PROTOCOL_UNDEFINED,
.iFunction = 0x00, /*some string*/
},
.vc_std = {
.bLength = sizeof(USB_StdDescriptor_Interface_t),
.bDescriptorType = DESC_INTERFACE,
.bInterfaceNumber = 0,
.bAlternateSetting = 0,
.bNumEndpoints = 0, /*uvc,pp47*/
.bInterfaceClass = USB_CC_VIDEO,
.bInterfaceSubClass = USB_UVC_SC_VIDEOCONTROL,
.bInterfaceProtocol = USB_UVC_PC_PROTOCOL_15,
.iInterface = 0, /*some sttring*/
},
.vc_int = {
.bLength = sizeof(USB_UVC_VC_Interface_Descriptor),
.bDescriptorType = 0x24,/*CS_INTERFACE*/
.bDescriptorSubType = USB_UVC_VC_HEADER,
.bcdUVC = 0x0150,
.wTotalLength = 0x042, /*...this is going to be a slight problem...*/
.dwClockFrequency = 0x005B8D80,
.bInCollection = 0x01, /*number of streaming interfaces*/
.baInterfaceNr = 0x01, /*# of this interface*/
},
/**terminal descriptor heeereee*/
.vs0_std = {
.bLength = sizeof(USB_StdDescriptor_Interface_t),
.bDescriptorType = DESC_INTERFACE,
.bInterfaceNumber = 0x01, /*index of this interface*/
.bAlternateSetting = 0x00, /*alt#0, no bw*/
.bNumEndpoints = 0x00,
.bInterfaceClass = USB_CC_VIDEO,
.bInterfaceSubClass = USB_UVC_SC_VIDEOSTREAMING,
.bInterfaceProtocol = USB_UVC_PC_PROTOCOL_15,
.iInterface = 0x00, /*unused*/
},
.vs1_cs = {
.bLength = sizeof(USB_UVC_VS_Header_Descriptor) /*+bControlSize*/,
.bDescriptorType = 0x24, /*CS_INTERFACE*/
.bDescriptorSubType = USB_UVC_VS_INPUT_HEADER,
.bNumFormats = 0x01, /*only 1 format*/
.wTotalLength = 0x003F, /*problem*/
.bEndpointAddress = 0x82, /*endpoint 2?*/
.bmInfo = 0x00, /*no dynamic format?*/
.bTerminalLink = 0x00, /*supplies terminal 3???* but no has terminals*/
.bStillCaptureMethod = 0x00,
.bTriggerSupport = 0x00,
.bTriggerUsage = 0x00,
.bControlSize = 0x01,
.bmaControls = 0x00, /*variable length = controlSize...*/
},
.vs1_fmt = {
.bLength = sizeof(USB_UVC_VS_Format_Descriptor),
.bDescriptorType = 0x24, /*CS_INTERFACE*/
.bDescriptorSubType = USB_UVC_VS_FORMAT_UNCOMPRESSED,
.bFormatIndex = 0x01, /*first format, only 1*/
.bmFlags = 0x01, /*fixed size samples*/
.bDefaultFrameIndex = 0x01, /*what?*/
.bAspectRatioX = 0x00, /*non-interlaced*/
.bAspectRatioY = 0x00,
.bmInterlaceFlags = 0x00, /*non-interlaced*/
.bCopyProtect = 0x00, /*no*/
},
.vs1_frame = {
.bLength = sizeof(USB_UVC_VS_Frame_Descriptor),
.bDescriptorType = 0x24, /*CS_INTERFACE*/
.bDescriptorSubType = USB_UVC_VS_FRAME_UNCOMPRESSED,
.bFrameIndex = 0x01, /*first and only frame descriptor*/
.bmCapabilities = 0x02, /*look this up*/
.wWidth = 0xA0,
.wHeight = 0x90,
.dwMinBitRate = 0x2A3000,
.dwMaxBitRate = 0x2A3000,
.dwMaxVideoFrameBufSize = 0x1680,
.dwDefaultFrameInterval = 0x28B0B,
.bFrameIntervalType = 0x00,
.dwMinFrameInterval = 0x28B0B,
.dwMaxFrameInterval = 0x28B0B,
.dwFrameIntervalStep = 0
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment