最近在学习CY7C63813USB微控制器,实现HID键盘设备,以下程序实现联机时自动给PC机一次PAGEDOWN按键的信号(0X5D),实测时发现PC机一直在接收PAGEDOWN信号,这是为什么呢?明明我就发送了一次?
....
BYTE KeyData[8] = {0,0,0x5b,0,0,0,0,0};
....
M8C_EnableGInt; //Enable Global Interrupts
USB_1_Start(0); //Start USB Operation using device 0
while (!USB_1_bGetConfiguration()); //Wait for Device to enumerate
for (y1=0;y1<100;y1++)//must delay some time!!!
delay();
USB_1_LoadEP (1, KeyData, 8); //Begin initial USB transfers
while (!USB_1_bGetEPAckState (1)); //Check and see if ACK has occured
while(1);
.....
用BUS HOUND监听数据发现如下内容:
36.1 IN 00 00 5b 00 00 00 00 00 ..[..... 1374.1.0
37 IN 0d 00 51 00 00 00 00 00 ..Q..... 1375.1.0(3227) |