|
这个是端口描述符 没有协议 驱动怎么写呢
const u8 Virtual_Com_Port_ConfigDescriptor[] = { /*Configuation Descriptor*/ 0x09, /* bLength: Configuation Descriptor size */ USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */ VIRTUAL_COM_PORT_SIZ_CONFIG_DESC, /* wTotalLength:no of returned bytes */ 0x00, 0x02, /* bNumInterfaces: 2 interface */ 0x01, /* bConfigurationValue: Configuration value */ 0x00, /* iConfiguration: Index of string descriptor describing the configuration */ 0x50, /* bmAttributes: self powered */ 0xc0, /* MaxPower 0 mA */ /*Interface Descriptor*/ 0x09, /* bLength: Interface Descriptor size */ USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: Interface */ /* Interface descriptor type */ 0x00, /* bInterfaceNumber: Number of Interface */ 0x00, /* bAlternateSetting: Alternate setting */ 0x03, /* bNumEndpoints: One endpoints used */ 0xff, /* bInterfaceClass: Communication Interface Class */ 0xff, /* bInterfaceSubClass: Abstract Control Model */ 0xff, /* bInterfaceProtocol: Common AT commands */ 0x00, /* iInterface: */ /*Endpoint 2 Descriptor*/ 0x07, /* bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */ 0x82, /* bEndpointAddress: (IN2) */ 0x03, /* bmAttributes: Interrupt */ VIRTUAL_COM_PORT_INT_SIZE, /* wMaxPacketSize: */ 0x00, 0x20, /* bInterval: */ /*Endpoint 3 Descriptor*/ 0x07, /* bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */ 0x03, /* bEndpointAddress: (OUT3) */ 0x02, /* bmAttributes: Bulk */ VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */ 0x00, 0x20, /* bInterval: ignore for Bulk transfer */ /*Endpoint 1 Descriptor*/ 0x07, /* bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */ 0x81, /* bEndpointAddress: (IN1) */ 0x02, /* bmAttributes: Bulk */ VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */ 0x00, 0x20, /* bInterval */ /*Data class interface descriptor*/ 0x09, /* bLength: Endpoint Descriptor size */ USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: */ 0x01, /* bInterfaceNumber: Number of Interface */ 0x00, /* bAlternateSetting: Alternate setting */ 0x03, /* bNumEndpoints: Two endpoints used */ 0xff, /* bInterfaceClass: CDC */ 0xff, /* bInterfaceSubClass: */ 0xff, /* bInterfaceProtocol: */ 0x00, /* iInterface: */ /*Endpoint 2 Descriptor*/ 0x07, /* bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */ 0x84, /* bEndpointAddress: (IN2) */ 0x03, /* bmAttributes: Interrupt */ VIRTUAL_COM_PORT_INT_SIZE, /* wMaxPacketSize: */ 0x00, 0x20, /* bInterval: */ /*Endpoint 3 Descriptor*/ 0x07, /* bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */ 0x05, /* bEndpointAddress: (OUT3) */ 0x02, /* bmAttributes: Bulk */ VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */ 0x00, 0x20, /* bInterval: ignore for Bulk transfer */ /*Endpoint 1 Descriptor*/ 0x07, /* bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */ 0x86, /* bEndpointAddress: (IN1) */ 0x02, /* bmAttributes: Bulk */ VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */ 0x00, 0x20, /* bInterval */ }; |
|