CH554 做的復(fù)合hid設(shè)備USB數(shù)據(jù)端口發(fā)送數(shù)據(jù)的疑問(wèn)

image.png

這是一個(gè)復(fù)合HID設(shè)備,用在觸摸i2c的電容觸摸轉(zhuǎn)USB

image.png

端口1用來(lái)接收數(shù)據(jù),端口2發(fā)送數(shù)據(jù)。

image.png

現(xiàn)在從端口1發(fā)送數(shù)據(jù)到電腦通過(guò)串口監(jiān)聽(tīng)到39設(shè)備的1好端口收到了數(shù)據(jù)包。

請(qǐng)教一下CH554要怎么從端口1發(fā)送數(shù)據(jù)到pc,讓復(fù)合設(shè)備58收到觸摸數(shù)據(jù)?


image.pngZ這個(gè)是WCH廠家的i2c轉(zhuǎn)usb觸摸屏監(jiān)聽(tīng)的數(shù)據(jù)包,是通過(guò)端口2上傳數(shù)據(jù)到pc?,F(xiàn)在不知道58這個(gè)數(shù)據(jù)是怎么來(lái)的,單片機(jī)那邊要怎么做才能讓電腦收到這個(gè)數(shù)據(jù)包。


這個(gè)看起來(lái)像BUSHOUND的顯示問(wèn)題,僅需要顯示39號(hào)設(shè)備的抓包就可以了,實(shí)際遇到了什么問(wèn)題呢。


現(xiàn)在pc端能夠識(shí)別到設(shè)備,觸摸沒(méi)有反應(yīng)。應(yīng)該是pc沒(méi)有識(shí)別到有效的HID的數(shù)據(jù)包。


WINDOWS 對(duì)觸摸屏么有反應(yīng),但是我插到我一個(gè)linxu設(shè)備板子上卻能夠工作,證明發(fā)送的數(shù)據(jù)包還有usb枚舉部分應(yīng)該沒(méi)有問(wèn)題。但是windows不能工作不知道是哪里的問(wèn)題,感覺(jué)還是數(shù)據(jù)包的問(wèn)題。


image.png

image.png

image.png

當(dāng)我發(fā)送數(shù)據(jù)長(zhǎng)度為64的時(shí)候,抓到的數(shù)據(jù)報(bào),就能看到多了一個(gè)設(shè)備的數(shù)據(jù)包,如圖49設(shè)備。不知道什么原因。


可以把對(duì)應(yīng)的描述符相關(guān)內(nèi)容發(fā)出來(lái)看下,報(bào)告描述符會(huì)上報(bào)數(shù)據(jù)的可以,可以檢查下發(fā)送的數(shù)據(jù)格式是否和報(bào)告描述一致


//HID類(lèi)報(bào)表描述符

UINT8C HIDRepDesc[ ] =

{

0x05,0x0d,0x09,0x04,0xa1,0x01,0x85,0x02,0x09,0x20,0xa1,0x00,0x09,0x42,0x09,0x32,

0x15,0x00,0x25,0x01,0x95,0x02,0x75,0x01,0x81,0x02,0x95,0x06,0x75,0x01,0x81,0x03,

0x05,0x01,0x09,0x30,0x75,0x10,0x95,0x01,0xa4,0x55,0x0e,0x65,0x33,0x16,0x00,0x00,

0x26,0xff,0x0f,0x36,0x00,0x00,0x46,0xff,0x0f,0x81,0x02,0x09,0x31,0x16,0x00,0x00,

0x26,0xff,0x0f,0x36,0x00,0x00,0x46,0xff,0x0f,0x81,0x02,0x09,0x31,0x16,0x00,0x00,

0x26,0xff,0x0f,0x36,0x00,0x00,0x46,0x5f,0x23,0x81,0x02,0xb4,0xc0,0xc0,0x05,0x01,

0x09,0x01,0xa1,0x01,0x85,0x01,0x09,0x01,0xa1,0x00,0x05,0x09,0x19,0x01,0x29,0x02,

0x15,0x00,0x25,0x01,0x95,0x02,0x75,0x01,0x81,0x02,0x95,0x01,0x75,0x06,0x81,0x01,

0x05,0x01,0x09,0x30,0x09,0x31,0x16,0x00,0x00,0x26,0xff,0x0f,0x36,0x00,0x00,0x46,

0xff,0x0f,0x66,0x00,0x00,0x75,0x10,0x95,0x02,0x81,0x02,0xc0,0xc0,0x06,0x00,0xff,

0x09,0x01,0xa1,0x01,0x09,0x01,0x15,0x00,0x26,0xff,0x00,0x85,0x03,0x75,0x08,0x95,

0x3f,0x81,0x02,0x06,0x00,0xff,0x09,0x01,0x15,0x00,0x26,0xff,0x00,0x75,0x08,0x95,

0x3f,0x91,0x02,0xc0,0x05,0x0d,0x09,0x04,0xa1,0x01,0x85,0x04,0x09,0x22,0xa1,0x00,

0x09,0x42,0x15,0x00,0x25,0x01,0x75,0x01,0x95,0x01,0x81,0x02,0x09,0x32,0x15,0x00,

0x25,0x01,0x81,0x02,0x09,0x51,0x75,0x04,0x95,0x01,0x16,0x00,0x00,0x26,0x10,0x00,

0x81,0x02,0x09,0xff,0x15,0x00,0x25,0x01,0x75,0x01,0x95,0x01,0x81,0x02,0x09,0x47,

0x75,0x01,0x95,0x01,0x15,0x00,0x25,0x01,0x81,0x02,0x05,0x01,0x09,0x30,0x75,0x10,

0x95,0x01,0x55,0x0e,0x65,0x33,0x35,0x00,0x16,0x00,0x00,0x26,0xff,0x0f,0x36,0x00,

0x00,0x46,0x3e,0x03,0x81,0x02,0x09,0x31,0x75,0x10,0x95,0x01,0x55,0x0e,0x65,0x33,

0x35,0x00,0x16,0x00,0x00,0x26,0xff,0x0f,0x36,0x00,0x00,0x46,0x6e,0x02,0x81,0x02,

0x05,0x0d,0x09,0x54,0x15,0x00,0x25,0x05,0x75,0x08,0x95,0x01,0x81,0x02,0x05,0x0d,

0x09,0x55,0x25,0x05,0x75,0x08,0x95,0x01,0xb1,0x02,0xc0,0xc0,0x05,0x0d,0x09,0x0e,

0xa1,0x01,0x85,0x05,0x09,0x22,0xa1,0x00,0x09,0x52,0x09,0x53,0x15,0x00,0x25,0x0a,

0x75,0x08,0x95,0x02,0xb1,0x02,0xc0,0xc0

};


下面是從端口1上傳的報(bào)文

image.png



從描述符格式和數(shù)據(jù)來(lái)看,可能是最后Report ID為4的這個(gè)描述,第二個(gè)字節(jié)中包含了Usage (0xFF)的一位,會(huì)不會(huì)是需要特定的驅(qū)動(dòng)程序才能驅(qū)動(dòng)起這個(gè)屏幕?可以找個(gè)類(lèi)似描述符的可以在WIN上使用的樣品抓包對(duì)比下看看。


? 70.1? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 1.1.0? ? ? ??

? 75? ? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 2.1.0? ? ? ??

? 70.1? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 3.1.0? ? ? ??

? 75? ? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 4.1.0? ? ? ??

? 70.1? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 5.1.0? ? ? ??

? 75? ? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 6.1.0? ? ? ??

? 70.1? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 7.1.0? ? ? ??

? 75? ? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 8.1.0? ? ? ??

? 70.1? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ? 9.1.0? ? ? ??

? 75? ? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ?10.1.0? ? ? ??

? 70.1? IN? ? ?04 c3 cb 00? 00 00 01? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?.......? ? ? ? ? ? ? ? ?11.1.0? ? ? ?

數(shù)據(jù)的發(fā)送也是模仿原來(lái)觸摸屏的通信協(xié)議發(fā)送的數(shù)據(jù),在linxu板子上可以工作,按理說(shuō)協(xié)議應(yīng)該沒(méi)有問(wèn)題。就是不知道在windows上為啥不行。除了從端口1上傳數(shù)據(jù)外還要做其他什么步驟沒(méi)有做?


只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频