阅读:1406回复:5
[求助] 描述表问题
大家好 现在我的设备总是安装驱动时 一到端点设置就没戏了
请大家帮忙看看我的描述表有什么问题? 谢了 4管道 1,2 中断 16 3,4 块 64 char USB_Device_Descriptor[18] = { //------------------------------------------------------------------- //TotalLength = 0x0012 bytes //------------------------------------------------------------------- //Device (0x12 bytes) 0x12, //bLength: 0x12 bytes 0x01, //bDescriptorType: DEVICE 0x10, 0x01, //bcdUSB: version 1.10 0x00, //bDeviceClass: independent interfaces 0x00, //bDeviceSubClass: 0 0x00, //bDeviceProtocol: class specific protocols NOT used on device basis 0x10, //bMaxPacketSize0: maximum packet size for endpoint zero 0x71, 0x04, //idVendor: vendor ID 0x00, 0x01, //idProduct: product ID //900515But org=503 0x00, 0x01, //bcdDevice: device release number in BCD 0x00, //iManufacturer: index of string 0x00, //iProduct: index of string 0x00, //iSerialNumber: index of string 0x01, //bNumConfigurations: 1 configuration }; //******************************************************************* //配置描述符 char USB_CONFIGURATION_DESCRIPTOR [] = { 0x09, 0x02, 0x2e, 00,// 0x01, 0x01, 0x00, 0xc0, 0x01, //}; //接口描述符 //char USB_INTERFACE_DESCRIPTOR [9] = //{ //Interface 0, AlternateSetting 0 (0x09 bytes) 0x09, //bLength: 0x09 bytes 0x04, //bDescriptorType: INTERFACE 0x00, //bInterfaceNumber: interface 0 0x00, //bAlternateSetting: alternate setting 0 0x04, //bNumEndpoints: 4 endpoint 0xFF, //bInterfaceClass: vendor specific interface 0x00, //bInterfaceSubClass: 0 0x00, //bInterfaceProtocol: class specific protocol NOT used on this interface 0x00, //iInterface: index of string //}; //端点描述符 //char USB_ENDPOINT_DESCRIPTOR_EP1_TXDescr [7] = //{ //Endpoint 1 (0x07 bytes) 0x07, //bLength: 0x07 bytes 0x05, //bDescriptorType: ENDPOINT 0x81, //bEndpointAddress: IN endpoint 1 0x01, //bmAttributes: Isochronous 0x10, 0x00, //wMaxPacketSize: 0 bytes 0x01, //bInterval: polling interval is 1 ms //}; //char USB_ENDPOINT_DESCRIPTOR_EP1_RXDescr [7] = //{ //Endpoint 1 (0x07 bytes) 0x07, //bLength: 0x07 bytes 0x05, //bDescriptorType: ENDPOINT 0x01, //bEndpointAddress: out endpoint 1 0x01, //bmAttributes: Isochronous 0x10, 0x00, //wMaxPacketSize: 0 bytes 0x01, //}; //char USB_ENDPOINT_DESCRIPTOR_EP2_TXDescr [7] = //{ //Endpoint 2 (0x07 bytes) 0x07, //bLength: 0x07 bytes 0x05, //bDescriptorType: ENDPOINT 0x82, //bEndpointAddress: IN endpoint 2 0x02, //bmAttributes: Bulk 0x40, 0x00, //wMaxPacketSize: 64 bytes 0x00, //bInterval: ignored //}; //char USB_ENDPOINT_DESCRIPTOR_EP2_RXDescr [7] = //{ //Endpoint 2 (0x07 bytes) 0x07, //bLength: 0x07 bytes 0x05, //bDescriptorType: ENDPOINT 0x02, //bEndpointAddress: out endpoint 2 0x02, //bmAttributes: Bulk 0x40, 0x00, //wMaxPacketSize: 64 bytes 0x00 }; [编辑 - 3/24/04 by wang_lei_kaka] [编辑 - 3/24/04 by wang_lei_kaka] [编辑 - 3/24/04 by wang_lei_kaka] [编辑 - 3/25/04 by wang_lei_kaka] |
|
沙发#
发布于:2004-03-24 19:09
引用:
UWord16 USB_Device_Descriptor[18] = 你为什么使用UWord16呢?这不是变成18*2=36Bytes了吗?! |
|
|
板凳#
发布于:2004-03-25 18:53
引用: 好像你修改过你的贴子了吗! 搞定了吗? |
|
|
地板#
发布于:2004-03-26 09:52
即使你按字节定义,对16位总线,还是存在字节颠倒问题例如对0x09,0x02,0x2e,0x00,0x01,0x01,0x00,0xc0,0x01,0x00
应变成 0x02,0x09,0x00,0x2e,0x01,0x01,0xc0,0x00,0x00,0x01 发送.注意上述已经按双字节补0对齐了。 |
|
|
地下室#
发布于:2004-03-26 09:53
即使你按字节定义,对16位总线,还是可能存在字节颠倒问题例如对 |
|
|
5楼#
发布于:2004-03-26 15:43
多谢各位的 答复
|
|