Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static
- unsigned char video_control_descriptors[] = {
- /* Interface Association Descriptor */
- 0x08, /* Descriptor Size */
- 0x11, /* Interface Association Descr Type: 11 */
- 0x00, /* I/f number of first VideoControl i/f */
- 0x02, /* Number of Video i/f */
- 0x0E, /* CC_VIDEO : Video i/f class code */
- 0x03, /* SC_VIDEO_INTERFACE_COLLECTION : Subclass code */
- 0x00, /* Protocol : Not used */
- 0x02, /* String desc index for interface */
- };
- static
- unsigned char video_streaming_descriptors[] = {
- /* Class-specific Video Streaming Input Header Descriptor */
- 0x0E, /* Descriptor size */
- 0x24, /* Class-specific VS I/f Type */
- 0x01, /* Descriptotor Subtype : Input Header */
- 0x00, /* No format desciptor supported for FS device */
- 0x0E, 0x00, /* Total size of Class specific VS descr */
- 0x83, /* EP address for BULK video data */
- 0x00, /* No dynamic format change supported */
- 0x04, /* Output terminal ID : 4 */
- 0x01, /* Still image capture method 1 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 */
- };
- /* Endpoint blocks */
- static
- struct SceUdcdEndpoint endpoints[4] = {
- {0x00, 0, 0, 0},
- {0x00, 1, 0, 0},
- {0x80, 2, 0, 0},
- {0x80, 3, 0, 0}
- };
- /* Interfaces */
- static
- struct SceUdcdInterface interfaces[1] = {
- {-1, 0, 1}
- };
- /* String descriptor */
- static
- struct SceUdcdStringDescriptor string_descriptors[2] = {
- {
- 18,
- USB_DT_STRING,
- {'V', 'i', 't', 'a', ' ', 'U', 'V', 'C'}
- },
- {
- 0,
- USB_DT_STRING
- }
- };
- /* HI-Speed device descriptor */
- static
- struct SceUdcdDeviceDescriptor devdesc_hi = {
- USB_DT_DEVICE_SIZE,
- USB_DT_DEVICE,
- 0x200, /* bcdUSB */
- 0xEF, /* bDeviceClass */
- 0x02, /* bDeviceSubClass */
- 0x01, /* bDeviceProtocol */
- 64, /* bMaxPacketSize0 */
- 0, /* idProduct */
- 0, /* idVendor */
- 0x100, /* bcdDevice */
- 0, /* iManufacturer */
- 0, /* iProduct */
- 0, /* iSerialNumber */
- 1 /* bNumConfigurations */
- };
- /* Hi-Speed endpoint descriptors */
- static
- struct SceUdcdEndpointDescriptor endpdesc_hi[4] = {
- /* Video Control endpoints */
- {
- USB_DT_ENDPOINT_SIZE,
- USB_DT_ENDPOINT,
- 0x01, /* bEndpointAddress */
- 0x02, /* bmAttributes */
- 0x200, /* wMaxPacketSize */
- 0x00 /* bInterval */
- },
- {
- USB_DT_ENDPOINT_SIZE,
- USB_DT_ENDPOINT,
- 0x82, /* bEndpointAddress */
- 0x03, /* bmAttributes */
- 0x40, /* wMaxPacketSize */
- 0x01 /* bInterval */
- },
- /* Video Streaming endpoints */
- {
- USB_DT_ENDPOINT_SIZE,
- USB_DT_ENDPOINT,
- 0x83, /* bEndpointAddress */
- 0x02, /* bmAttributes */
- 0x200, /* wMaxPacketSize */
- 0x00 /* bInterval */
- },
- {
- 0,
- }
- };
- /* Hi-Speed interface descriptor */
- static
- struct SceUdcdInterfaceDescriptor interdesc_hi[3] = {
- { /* Standard Video Control Interface Descriptor */
- USB_DT_INTERFACE_SIZE,
- USB_DT_INTERFACE,
- 0, /* bInterfaceNumber */
- 0, /* bAlternateSetting */
- 2, /* bNumEndpoints */
- 14, /* bInterfaceClass */
- 0x01, /* bInterfaceSubClass */
- 0x00, /* bInterfaceProtocol */
- 0, /* iInterface */
- &endpdesc_hi[0], /* endpoints */
- video_control_descriptors,
- sizeof(video_control_descriptors)
- },
- { /* Standard Video Streaming Interface Descriptor */
- USB_DT_INTERFACE_SIZE,
- USB_DT_INTERFACE,
- 1, /* bInterfaceNumber */
- 0, /* bAlternateSetting */
- 1, /* bNumEndpoints */
- 14, /* bInterfaceClass */
- 0x02, /* bInterfaceSubClass */
- 0x00, /* bInterfaceProtocol */
- 0, /* iInterface */
- &endpdesc_hi[2], /* endpoints */
- video_streaming_descriptors,
- sizeof(video_streaming_descriptors)
- },
- {
- 0
- }
- };
- /* Hi-Speed settings */
- static
- struct SceUdcdInterfaceSettings settings_hi[1] = {
- {
- interdesc_hi,
- 0,
- 2
- }
- };
- /* Hi-Speed configuration descriptor */
- static
- struct SceUdcdConfigDescriptor confdesc_hi = {
- USB_DT_CONFIG_SIZE,
- USB_DT_CONFIG,
- (USB_DT_CONFIG_SIZE + 2 * USB_DT_INTERFACE_SIZE + 3 * USB_DT_ENDPOINT_SIZE +
- sizeof(video_control_descriptors) +
- sizeof(video_streaming_descriptors)), /* wTotalLength */
- 2, /* bNumInterfaces */
- 1, /* bConfigurationValue */
- 0, /* iConfiguration */
- 0xC0, /* bmAttributes */
- 0, /* bMaxPower */
- &settings_hi[0]
- };
- /* Hi-Speed configuration */
- static
- struct SceUdcdConfiguration config_hi = {
- &confdesc_hi,
- &settings_hi[0],
- &interdesc_hi[0],
- &endpdesc_hi[0]
- };
- /* Full-Speed device descriptor */
- static
- struct SceUdcdDeviceDescriptor devdesc_full = {
- USB_DT_DEVICE_SIZE,
- USB_DT_DEVICE,
- 0x200, /* bcdUSB (should be 0x110 but the PSVita freezes otherwise) */
- 0xEF, /* bDeviceClass */
- 0x02, /* bDeviceSubClass */
- 0x01, /* bDeviceProtocol */
- 0x40, /* bMaxPacketSize0 */
- 0, /* idProduct */
- 0, /* idVendor */
- 0x200, /* bcdDevice */
- 0, /* iManufacturer */
- 0, /* iProduct */
- 0, /* iSerialNumber */
- 1 /* bNumConfigurations */
- };
- /* Full-Speed endpoint descriptors */
- static
- struct SceUdcdEndpointDescriptor endpdesc_full[4] = {
- /* Video Control endpoints */
- {
- USB_DT_ENDPOINT_SIZE,
- USB_DT_ENDPOINT,
- 0x01, /* bEndpointAddress */
- 0x02, /* bmAttributes */
- 0x40, /* wMaxPacketSize */
- 0x00 /* bInterval */
- },
- {
- USB_DT_ENDPOINT_SIZE,
- USB_DT_ENDPOINT,
- 0x82, /* bEndpointAddress */
- 0x03, /* bmAttributes */
- 0x40, /* wMaxPacketSize */
- 0x01 /* bInterval */
- },
- /* Video Streaming endpoints */
- {
- USB_DT_ENDPOINT_SIZE,
- USB_DT_ENDPOINT,
- 0x83, /* bEndpointAddress */
- 0x02, /* bmAttributes */
- 0x40, /* wMaxPacketSize */
- 0x00 /* bInterval */
- },
- {
- 0,
- }
- };
- /* Full-Speed interface descriptor */
- static
- struct SceUdcdInterfaceDescriptor interdesc_full[3] = {
- { /* Standard Video Control Interface Descriptor */
- USB_DT_INTERFACE_SIZE,
- USB_DT_INTERFACE,
- 0, /* bInterfaceNumber */
- 0, /* bAlternateSetting */
- 2, /* bNumEndpoints */
- 14, /* bInterfaceClass */
- 0x01, /* bInterfaceSubClass */
- 0x00, /* bInterfaceProtocol */
- 1, /* iInterface */
- &endpdesc_full[0], /* endpoints */
- video_control_descriptors,
- sizeof(video_control_descriptors)
- },
- { /* Standard Video Streaming Interface Descriptor */
- USB_DT_INTERFACE_SIZE,
- USB_DT_INTERFACE,
- 1, /* bInterfaceNumber */
- 0, /* bAlternateSetting */
- 1, /* bNumEndpoints */
- 14, /* bInterfaceClass */
- 0x02, /* bInterfaceSubClass */
- 0x00, /* bInterfaceProtocol */
- 1, /* iInterface */
- &endpdesc_full[2], /* endpoints */
- video_streaming_descriptors,
- sizeof(video_streaming_descriptors)
- },
- {
- 0
- }
- };
- /* Full-Speed settings */
- static
- struct SceUdcdInterfaceSettings settings_full[1] = {
- {
- &interdesc_full[0],
- 0,
- 2
- }
- };
- /* Full-Speed configuration descriptor */
- static
- struct SceUdcdConfigDescriptor confdesc_full = {
- USB_DT_CONFIG_SIZE,
- USB_DT_CONFIG,
- (USB_DT_CONFIG_SIZE + 2 * USB_DT_INTERFACE_SIZE + 3 * USB_DT_ENDPOINT_SIZE +
- sizeof(video_control_descriptors) +
- sizeof(video_streaming_descriptors)), /* wTotalLength */
- 2, /* bNumInterfaces */
- 1, /* bConfigurationValue */
- 0, /* iConfiguration */
- 0xC0, /* bmAttributes */
- 0, /* bMaxPower */
- &settings_full[0]
- };
- /* Full-Speed configuration */
- static
- struct SceUdcdConfiguration config_full = {
- &confdesc_full,
- &settings_full[0],
- &interdesc_full[0],
- &endpdesc_full[0]
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement