你好:
我利用avr單片機(jī),主控芯片CH375枚舉鍵盤,發(fā)現(xiàn)不能枚舉鍵盤, 我用BUSHOUND查看鍵盤信息: Bus Hound 6.01 capture on Windows Vista Service Pack 1 (x64). Complements of www.perisoft.net
LXH-EKB-10YA(白色)
Device - Device ID (followed by the endpoint for USB devices) (22) USB 輸入設(shè)備 (25) USB 輸入設(shè)備 (26) USB 輸入設(shè)備 Phase - Phase Type CTL USB control transfer IN Data in transfer OUT Data out transfer Data - Hex dump of the data transferred Descr - Description of the phase Cmd... - Position in the captured data
Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- ------------------------ ---------------- ------------------ 25.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 1.1.0 25.0 IN 12 01 00 02 00 00 00 08 ........ 1.2.0 ef 17 2d 60 30 01 01 02 ..-`0... 1.2.8 00 01 .. 1.2.16 25.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 2.1.0 25.0 IN 09 02 22 00 01 01 00 a0 .."..... 2.2.0 32 2 2.2.8 25.0 CTL 80 06 00 02 00 00 22 00 GET DESCRIPTOR 3.1.0 25.0 IN 09 02 22 00 01 01 00 a0 .."..... 3.2.0 32 09 04 00 00 01 03 01 2....... 3.2.8 01 00 09 21 11 01 00 01 ...!.... 3.2.16 22 41 00 07 05 81 03 08 "A...... 3.2.24 25.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 4.1.0 25.0 CTL 21 0a 00 00 00 00 00 00 SET IDLE 5.1.0 25.0 CTL 81 06 00 22 00 00 81 00 GET DESCRIPTOR 6.1.0 25.0 IN 05 01 09 06 a1 01 05 07 ........ 6.2.0 19 e0 29 e7 15 00 25 01 ..)...%. 6.2.8 75 01 95 08 81 02 95 01 u....... 6.2.16 75 08 81 01 95 03 75 01 u.....u. 6.2.24 26.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 7.1.0 26.0 IN 12 01 00 02 00 00 00 08 ........ 7.2.0 ef 17 2d 60 30 01 01 02 ..-`0... 7.2.8 00 01 .. 7.2.16 26.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 8.1.0 26.0 IN 09 02 22 00 01 01 00 a0 .."..... 8.2.0 32 2 8.2.8 26.0 CTL 80 06 00 02 00 00 22 00 GET DESCRIPTOR 9.1.0 26.0 IN 09 02 22 00 01 01 00 a0 .."..... 9.2.0 32 09 04 01 00 01 03 00 2....... 9.2.8 00 00 09 21 11 01 00 01 ...!.... 9.2.16 22 a5 00 07 05 82 03 05 "....... 9.2.24 26.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 10.1.0 26.0 CTL 21 0a 00 00 01 00 00 00 SET IDLE 11.1.0 26.0 CTL 81 06 00 22 01 00 e5 00 GET DESCRIPTOR 12.1.0 26.0 IN 05 01 09 80 a1 01 85 01 ........ 12.2.0 19 81 29 83 15 00 25 01 ..)...%. 12.2.8 95 03 75 01 81 02 95 05 ..u..... 12.2.16 81 01 c0 06 0c 00 09 01 ........ 12.2.24 25.0 CTL 21 09 00 02 00 00 01 00 SET REPORT 13.1.0 25.0 OUT 00 . 13.2.0
我在用單片機(jī)枚舉時(shí)候發(fā)現(xiàn): 獲取設(shè)備描述符時(shí)候完全一樣:12 01 00 02 00 00 00 08 EF 17 2D 60 30 01 01 02 00 01
在獲取配置描述符時(shí)候:02 3b 00 02 01 00 a0 32 , busHound 22->3b,01->02這兩位不一樣
程序繼續(xù)運(yùn)行,獲取的別的描述符,個(gè)別也有問題,結(jié)果鍵盤不能枚舉 我后來改動(dòng)這個(gè)函數(shù) void get_int_in() { endp6_mode=0x80; toggle_recv(); //UDR1=endp_int; endp_int=0x01; issue_token(( endp_int << 4 ) | DEF_USB_PID_IN);//status=wait_interrupt(); }
直接給endp_int=0x01; 就可以從中斷接受到鍵值,但是這個(gè)鍵值需要按下五六秒才能接到一個(gè),并且中斷在不按任何按鍵時(shí)候,也不斷接受0X14, 由于最近項(xiàng)目趕時(shí)間,利用你們的芯片解析USB鍵盤,懇求幫忙找下解決方法,