电脑系统win7 32位,2440开发板自带四个按键,想利用这四个按键和usbdevice控制器模拟一个鼠标的运行,但是枚举过程就出现了问题
在写ep0函数中
void WrPktEp0(U8 *buf,int num)
{
S3C24X0_USB_DEVICE * const usbdevregs = S3C24X0_GetBase_USB_DEVICE();
int i;
for(i=0;i<num;i++)
{
usbdevregs->fifo[0].EP_FIFO_REG=buf;
//myprintf("0x%02x ",buf);
}
//for(i=0;i<num;i++)
//{
// myprintf("0x%02x ",buf);
//}
//myprintf("\n");
}
注释掉红色字体,接收到的数据是下面这样的
[RCV:80,6,0,1,0,0,40,0,]
[RCV:0,5,1,0,0,0,0,0,]
[RCV:80,6,0,1,0,0,12,0,]
[RCV:80,6,0,2,0,0,ff,0,]
[RCV:80,6,0,3,0,0,ff,0,]
[RCV:80,6,2,3,9,4,ff,0,]
[RCV:80,6,0,2,0,0,9,0,]
[RCV:80,6,0,2,0,0,22,0,]
[RCV:80,6,0,3,0,0,ff,0,]
[RCV:80,6,1,3,9,4,ff,0,]
[RCV:80,6,2,3,9,4,ff,0,]
[RCV:80,6,0,1,0,0,40,0,]
[RCV:0,5,1,0,0,0,0,0,]
[RCV:80,6,0,1,0,0,12,0,]
[RCV:80,6,0,2,0,0,ff,0,]
[RCV:80,6,0,3,0,0,ff,0,]
[RCV:80,6,2,3,9,4,ff,0,]
[RCV:80,6,0,1,0,0,12,0,]
[RCV:80,6,0,2,0,0,9,0,]
[RCV:80,6,0,2,0,0,22,0,]
[RCV:0,9,1,0,0,0,0,0,]
[RCV:80,6,0,2,0,0,9,0,]
但是为什么没有收到设置请求和请求报告描述符的请求[RCV:21,a,0,0,0,0,0,0,] [RCV:81,6,0,22,0,0,74,0,]
如果不注释掉红色区域,打印出2440传给电脑的数据
void WrPktEp0(U8 *buf,int num)
{
S3C24X0_USB_DEVICE * const usbdevregs = S3C24X0_GetBase_USB_DEVICE();
int i;
for(i=0;i<num;i++)
{
usbdevregs->fifo[0].EP_FIFO_REG=buf;
//myprintf("0x%02x ",buf);
}
for(i=0;i<num;i++)
{
myprintf("0x%02x ",buf);
}
myprintf("\n");
}
则接收到的数据是
[RCV:80,6,0,1,0,0,40,0,]
0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08
0x45 0x53 0x34 0x12 0x00 0x01 0x01 0x02
[RCV:0,5,1,0,0,0,0,0,]
[RCV:80,6,0,1,0,0,12,0,]
0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08
0x45 0x53 0x34 0x12 0x00 0x01 0x01 0x02
0x00 0x01
[RCV:80,6,0,2,0,0,ff,0,]
0x09 0x02 0x22 0x00 0x01 0x01 0x00 0xc0
0x19
0x09 0x04 0x00 0x00 0x01 0x03 0x01
0x02 0x00
0x09 0x21 0x10 0x01 0x21 0x01
0x22 0x34 0x00
0x07 0x05 0x81 0x03 0x10
0x00 0x0a
[RCV:80,6,0,3,0,0,ff,0,]
0x04 0x03 0x09 0x04
[RCV:80,6,2,3,9,4,ff,0,]
0x2c 0x03 0x53 0x00 0x45 0x00 0x43 0x00
0x20 0x00 0x53 0x00 0x33 0x00 0x43 0x00
0x32 0x00 0x34 0x00 0x31 0x00 0x30 0x00
0x58 0x00 0x20 0x00 0x54 0x00 0x65 0x00
0x73 0x00 0x74 0x00 0x20 0x00 0x42 0x00
0x2f 0x00 0x44 0x00
[RCV:80,6,0,1,0,0,40,0,]
0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08
0x45 0x53 0x34 0x12 0x00 0x01 0x01 0x02
[RCV:0,5,1,0,0,0,0,0,]
[RCV:80,6,0,1,0,0,12,0,]
0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08
0x45 0x53 0x34 0x12 0x00 0x01 0x01 0x02
0x00 0x01
[RCV:80,6,0,2,0,0,ff,0,]
0x09 0x02 0x22 0x00 0x01 0x01 0x00 0xc0
0x19
0x09 0x04 0x00 0x00 0x01 0x03 0x01
0x02 0x00
0x09 0x21 0x10 0x01 0x21 0x01
0x22 0x34 0x00
0x07 0x05 0x81 0x03 0x10
0x00 0x0a
[RCV:80,6,12,3,9,4,ff,0,]
[RCV:80,6,0,1,0,0,12,0,]
0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08
0x45 0x53 0x34 0x12 0x00 0x01 0x01 0x02
0x00 0x01
[RCV:80,6,0,2,0,0,9,0,]
0x09 0x02 0x22 0x00 0x01 0x01 0x00 0xc0
0x19
[RCV:80,6,0,2,0,0,22,0,]
0x09 0x02 0x22 0x00 0x01 0x01 0x00 0xc0
0x19
0x09 0x04 0x00 0x00 0x01 0x03 0x01
0x02 0x00
0x09 0x21 0x10 0x01 0x21 0x01
0x22 0x34 0x00
0x07 0x05 0x81 0x03 0x10
0x00 0x0a
[RCV:0,9,1,0,0,0,0,0,]
[RCV:21,a,0,0,0,0,0,0,]
set idle
[RCV:81,6,0,22,0,0,74,0,]
0x05 0x01 0x09 0x02 0xa1 0x01 0x09 0x01
0xa1 0x00 0x05 0x09 0x19 0x01 0x29 0x03
0x15 0x00 0x25 0x01 0x95 0x03 0x75 0x01
0x81 0x02 0x95 0x01 0x75 0x05 0x81 0x03
0x05 0x01 0x09 0x30 0x09 0x31 0x09 0x38
0x15 0x81 0x25 0x7f 0x75 0x08 0x95 0x03
0x81 0x06 0xc0 0xc0
但是中间为什么出现了[RCV:80,6,12,3,9,4,ff,0,],并且设备未能识别,驱动没有安装成功,一个黄色的叹号 |