CH32F205 USBFS配置為Device 但是不管如何轉(zhuǎn)發(fā)描述符到USB端點(diǎn) 都是讓鼠標(biāo)往右移動

CH32F205 兩個(gè)usb 一個(gè)配置為主機(jī) 一個(gè)配置為HID設(shè)備 主機(jī)接收HID設(shè)備數(shù)據(jù) 然后通過從機(jī)USB端口 轉(zhuǎn)發(fā)給PC?

這是主函數(shù)設(shè)置

int main( void )

{

? ? /* Initialize system configuration */

? ? Delay_Init( );

? ? USART_Printf_Init( 115200 );

? ? DUG_PRINTF( "SystemClk:%d\r\n", SystemCoreClock );

? ? DUG_PRINTF( "USB HOST KM Test\r\n" );


? ? /* Initialize TIM3 */

? ? TIM3_Init( 9, SystemCoreClock / 10000 - 1 );

? ? DUG_PRINTF( "TIM3 Init OK!\r\n" );


? ? /* Initialize USBHS host */

? ? /* Note: Only CH32F205/CH32F207 support USB high-speed port. */

#if DEF_USBHS_PORT_EN

? ? DUG_PRINTF( "USBHS Host Init\r\n" );

? ? USBHS_RCC_Init( );

? ? USBHS_Host_Init( ENABLE );

? ? memset( &RootHubDev[ DEF_USBHS_PORT_INDEX ].bStatus, 0, sizeof( ROOT_HUB_DEVICE ) );

? ? memset( &HostCtl[ DEF_USBHS_PORT_INDEX * DEF_ONE_USB_SUP_DEV_TOTAL ].InterfaceNum, 0, DEF_ONE_USB_SUP_DEV_TOTAL * sizeof( HOST_CTL ) );

#endif


? ? /* Initialize USBFS host */

#if DEF_USBFS_PORT_EN

? ? DUG_PRINTF( "USBFS Host Init\r\n" );

//? ? USBFS_RCC_Init( );

//? ? USBFS_Host_Init( ENABLE );


? ? USBFS_RCC_Init( );

???? USBFS_Device_Init( ENABLE );

???? DUG_PRINTF(" < - USB DEVCIE INIT OK - > \r\n");

? ? memset( &RootHubDev[ DEF_USBFS_PORT_INDEX ].bStatus, 0, sizeof( ROOT_HUB_DEVICE ) );

? ? memset( &HostCtl[ DEF_USBFS_PORT_INDEX * DEF_ONE_USB_SUP_DEV_TOTAL ].InterfaceNum, 0, DEF_ONE_USB_SUP_DEV_TOTAL * sizeof( HOST_CTL ) );

#endif


? ??

? ? while( 1 )

? ? {

? ? ? ? USBH_MainDeal( );


? ? }

}



這是USBH_MainDeal 函數(shù)里獲取到描述符的部分 不管我接入鍵盤還是鼠標(biāo) 都是鼠標(biāo)一直往右移動

/* Get the data of the HID device connected to the USB host port */

? ? for( usb_port = 0; usb_port < DEF_TOTAL_ROOT_HUB; usb_port++ )

? ? {

? ? ? ? if( RootHubDev[ usb_port ].bStatus >= ROOT_DEV_SUCCESS )

? ? ? ? {

? ? ? ? ? ? index = RootHubDev[ usb_port ].DeviceIndex;?

? ? ? ? ? ? if( RootHubDev[ usb_port ].bType == USB_DEV_CLASS_HID )

? ? ? ? ? ? {

? ? ? ? ? ? ? ? for( intf_num = 0; intf_num < HostCtl[ index ].InterfaceNum; intf_num++ )

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? for( in_num = 0; in_num < HostCtl[ index ].Interface[ intf_num ].InEndpNum; in_num++ )

? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? ? ? ? ? /* Get endpoint data based on the interval time of the device */

? ? ? ? ? ? ? ? ? ? ? ? if( HostCtl[ index ].Interface[ intf_num ].InEndpTimeCount[ in_num ] >= HostCtl[ index ].Interface[ intf_num ].InEndpInterval[ in_num ] )

? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? HostCtl[ index ].Interface[ intf_num ].InEndpTimeCount[ in_num ] %= HostCtl[ index ].Interface[ intf_num ].InEndpInterval[ in_num ];

? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? ? ? ? ? ? ? /* Get endpoint data */

? ? ? ? ? ? ? ? ? ? ? ? ? ? s = USBH_GetHidData( usb_port, index, intf_num, in_num, Com_Buf, &len );

? ? ? ? ? ? ? ? ? ? ? ? ? ? if( s == ERR_SUCCESS )

? ? ? ? ? ? ? ? ? ? ? ? ? ? {

#if DEF_DEBUG_PRINTF

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? for( i = 0; i < len; i++ )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DUG_PRINTF( "%02x ", Com_Buf[ i ] );

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DUG_PRINTF( "\r\n" );

#endif

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

int8_t x_move = (int8_t)Com_Buf[1]; // X 位移

int8_t y_move = (int8_t)Com_Buf[2]; // Y 位移

int8_t wheel_move = (int8_t)Com_Buf[3]; // 滾輪位移


DUG_PRINTF("Mouse Move: X=%d, Y=%d, Wheel=%d\r\n", x_move, y_move, wheel_move);


// 上傳數(shù)據(jù)到端點(diǎn)

DUG_PRINTF("Uploading Data: %02x %02x %02x %02x\r\n", Com_Buf[0], Com_Buf[1], Com_Buf[2], Com_Buf[3]);

uint8_t report_len = 4; // HID 描述符定義了 4 字節(jié)

if (USBFS_Endp_DataUp(endp, Com_Buf, report_len, DEF_UEP_DMA_LOAD) == READY) {

DUG_PRINTF("Mouse Data Uploaded to Endpoint %d\r\n", endp);

} else {

DUG_PRINTF("Mouse Data Upload Failed!\r\n");

然后串口的打印數(shù)據(jù)一直是往一個(gè)方向累加?



SystemClk:96000000

USB HOST KM Test

TIM3 Init OK!

USBHS Host Init

USBFS Host Init

?< - USB DEVCIE INIT OK - >?

USB Port1 Dev In.

Enum:

Get DevDesc: 12 01 10 01 00 00 00 08 4f 1c 34 00 10 01 01 02 00 01?

Set DevAddr: OK

Get CfgDesc: 09 02 22 00 01 01 00 a0 32 09 04 00 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 81 03 04 00 0a?

DevType: 03

Set Cfg: OK

Root Device Is HID. Enum Hid:

Analyze CfgDesc: OK

Get Interface0 RepDesc: HID Descriptor:

05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 01 75 05 81 01 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 81 06 c0 c0?

05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 01 75 05 81 01 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 81 06 c0 c0?

Get StringDesc1: 14 03 53 00 49 00 47 00 4d 00 41 00 43 00 48 00 49 00 50 00?

Get StringDesc2: 14 03 55 00 73 00 62 00 20 00 4d 00 6f 00 75 00 73 00 65 00?

Further Enum Result: OK

00 00 00 00?

Mouse Move: X=0, Y=0, Wheel=0

Uploading Data: 00 00 00 00

Mouse Data Uploaded to Endpoint 2

00 01 00 00?


Mouse Data Uploaded to Endpoint 2

00 01 ff 00?

Mouse Move: X=1, Y=-1, Wheel=0

Uploading Data: 00 01 ff 00

Mouse Data Uploaded to Endpoint 2

00 01 ff 00?

Mouse Move: X=1, Y=-1, Wheel=0

Uploading Data: 00 01 ff 00

Mouse Data Uploaded to Endpoint 2

00 02 00 00?

Mouse Move: X=2, Y=0, Wheel=0

Uploading Data: 00 02 00 00

Mouse Data Uploaded to Endpoint 2

00 03 ff 00?

Mouse Move: X=3, Y=-1, Wheel=0

Uploading Data: 00 03 ff 00

Mouse Data Uploaded to Endpoint 2

00 05 00 00?

Mouse Move: X=5, Y=0, Wheel=0

Uploading Data: 00 05 00 00

Mouse Data Uploaded to Endpoint 2

00 06 00 00?

Mouse Move: X=6, Y=0, Wheel=0

Uploading Data: 00 06 00 00

Mouse Data Uploaded to Endpoint 2

00 04 00 00?

Mouse Move: X=4, Y=0, Wheel=0

Uploading Data: 00 04 00 00

Mouse Data Uploaded to Endpoint 2

00 02 00 00?

Mouse Move: X=2, Y=0, Wheel=0

Uploading Data: 00 02 00 00

Mouse Data Uploaded to Endpoint 2

00 05 fe 00?

Mouse Move: X=5, Y=-2, Wheel=0

Uploading Data: 00 05 fe 00

Mouse Data Uploaded to Endpoint 2

00 09 fc 00?

Mouse Move: X=9, Y=-4, Wheel=0

Uploading Data: 00 09 fc 00

Mouse Data Uploaded to Endpoint 2

00 06 fe 00?

Mouse Move: X=6, Y=-2, Wheel=0

Uploading Data: 00 06 fe 00

Mouse Data Uploaded to Endpoint 2

00 06 ff 00?

Mouse Move: X=6, Y=-1, Wheel=0

Uploading Data: 00 06 ff 00

Mouse Data Uploaded to Endpoint 2

00 05 ff 00?

Mouse Move: X=5, Y=-1, Wheel=0

Uploading Data: 00 05 ff 00

Mouse Data Uploaded to Endpoint 2

00 06 fe 00?

Mouse Move: X=6, Y=-2, Wheel=0

Uploading Data: 00 06 fe 00

Mouse Data Uploaded to Endpoint 2

00 09 ff 00?

Mouse Move: X=9, Y=-1, Wheel=0

Uploading Data: 00 09 ff 00

Mouse Data Uploaded to Endpoint 2

00 09 fe 00?

Mouse Move: X=9, Y=-2, Wheel=0

Uploading Data: 00 09 fe 00

Mouse Data Uploaded to Endpoint 2

00 0a 00 00?

Mouse Move: X=10, Y=0, Wheel=0

Uploading Data: 00 0a 00 00

Mouse Data Uploaded to Endpoint 2

00 09 fe 00?

Mouse Move: X=9, Y=-2, Wheel=0

Uploading Data: 00 09 fe 00

Mouse Data Uploaded to Endpoint 2

00 09 fd 00?

Mouse Move: X=9, Y=-3, Wheel=0

Uploading Data: 00 09 fd 00

Mouse Data Uploaded to Endpoint 2

00 09 fe 00?

Mouse Move: X=9, Y=-2, Wheel=0

Uploading Data: 00 09 fe 00

Mouse Data Uploaded to Endpoint 2

00 0a fd 00?

Mouse Move: X=10, Y=-3, Wheel=0

Uploading Data: 00 0a fd 00

Mouse Data Uploaded to Endpoint 2

00 0a fd 00?

Mouse Move: X=10, Y=-3, Wheel=0

Uploading Data: 00 0a fd 00

Mouse Data Uploaded to Endpoint 2

00 0a fd 00?

Mouse Move: X=10, Y=-3, Wheel=0

Uploading Data: 00 0a fd 00

Mouse Data Uploaded to Endpoint 2

00 0a ff 00?

Mouse Move: X=10, Y=-1, Wheel=0

Uploading Data: 00 0a ff 00

Mouse Data Uploaded to Endpoint 2

00 0a 00 00?

Mouse Move: X=10, Y=0, Wheel=0

Uploading Data: 00 0a 00 00

Mouse Data Uploaded to Endpoint 2

00 08 ff 00?

Mouse Move: X=8, Y=-1, Wheel=0

Uploading Data: 00 08 ff 00

Mouse Data Uploaded to Endpoint 2

00 06 00 00?

Mouse Move: X=6, Y=0, Wheel=0

Uploading Data: 00 06 00 00

Mouse Data Uploaded to Endpoint 2

00 05 ff 00?

Mouse Move: X=5, Y=-1, Wheel=0

Uploading Data: 00 05 ff 00

Mouse Data Uploaded to Endpoint 2

00 03 ff 00?

Mouse Move: X=3, Y=-1, Wheel=0

Uploading Data: 00 03 ff 00

Mouse Data Uploaded to Endpoint 2

00 ff 00 00?

Mouse Move: X=-1, Y=0, Wheel=0

Uploading Data: 00 ff 00 00

Mouse Data Uploaded to Endpoint 2

00 fd 01 00?

Mouse Move: X=-3, Y=1, Wheel=0

Uploading Data: 00 fd 01 00

Mouse Data Uploaded to Endpoint 2

00 f6 01 00?

Mouse Move: X=-10, Y=1, Wheel=0

Uploading Data: 00 f6 01 00

Mouse Data Uploaded to Endpoint 2

00 ee 01 00?

Mouse Move: X=-18, Y=1, Wheel=0

Uploading Data: 00 ee 01 00

Mouse Data Uploaded to Endpoint 2

00 e9 00 00?

Mouse Move: X=-23, Y=0, Wheel=0

Uploading Data: 00 e9 00 00

Mouse Data Uploaded to Endpoint 2

00 e7 00 00?

Mouse Move: X=-25, Y=0, Wheel=0

Uploading Data: 00 e7 00 00

Mouse Data Uploaded to Endpoint 2

00 e9 ff 00?

Mouse Move: X=-23, Y=-1, Wheel=0

Uploading Data: 00 e9 ff 00

Mouse Data Uploaded to Endpoint 2

00 eb fd 00?

Mouse Move: X=-21, Y=-3, Wheel=0

Uploading Data: 00 eb fd 00

Mouse Data Uploaded to Endpoint 2

00 ed fc 00?

Mouse Move: X=-19, Y=-4, Wheel=0

Uploading Data: 00 ed fc 00

Mouse Data Uploaded to Endpoint 2

00 ef fc 00?

Mouse Move: X=-17, Y=-4, Wheel=0

Uploading Data: 00 ef fc 00

Mouse Data Uploaded to Endpoint 2

00 ee fb 00?

Mouse Move: X=-18, Y=-5, Wheel=0

Uploading Data: 00 ee fb 00

Mouse Data Uploaded to Endpoint 2

00 ed fb 00?

Mouse Move: X=-19, Y=-5, Wheel=0

Uploading Data: 00 ed fb 00

Mouse Data Uploaded to Endpoint 2

00 eb fb 00?

Mouse Move: X=-21, Y=-5, Wheel=0

Uploading Data: 00 eb fb 00

Mouse Data Uploaded to Endpoint 2

00 e9 fc 00?

Mouse Move: X=-23, Y=-4, Wheel=0

Uploading Data: 00 e9 fc 00

Mouse Data Uploaded to Endpoint 2

00 eb fb 00?

Mouse Move: X=-21, Y=-5, Wheel=0

Uploading Data: 00 eb fb 00

Mouse Data Uploaded to Endpoint 2

00 eb fd 00?

Mouse Move: X=-21, Y=-3, Wheel=0

Uploading Data: 00 eb fd 00

Mouse Data Uploaded to Endpoint 2

00 eb fe 00?

Mouse Move: X=-21, Y=-2, Wheel=0

Uploading Data: 00 eb fe 00

Mouse Data Uploaded to Endpoint 2

00 ef fd 00?

Mouse Move: X=-17, Y=-3, Wheel=0

Uploading Data: 00 ef fd 00

Mouse Data Uploaded to Endpoint 2

00 f2 fe 00?

Mouse Move: X=-14, Y=-2, Wheel=0

Uploading Data: 00 f2 fe 00

Mouse Data Uploaded to Endpoint 2

00 f4 ff 00?



}


您好,按照你的描述,你是不是想實(shí)現(xiàn)一個(gè)類似HUB的功能,或者說僅是想通過主機(jī)口獲取連接鼠標(biāo)的數(shù)據(jù),然后通過設(shè)備口連接電腦實(shí)現(xiàn)鼠標(biāo)的功能。若僅是想要實(shí)現(xiàn)鼠標(biāo)的功能,建議設(shè)備端改成模擬鼠標(biāo)設(shè)備,可以使用bushound抓一下你鼠標(biāo)的枚舉過程,然后根據(jù)其修改一下HID設(shè)備的描述符,模擬成具體的鼠標(biāo)設(shè)備,然后再將主機(jī)抓取的設(shè)備通過設(shè)備端口上傳電腦實(shí)現(xiàn)鼠標(biāo)功能。后續(xù)若有問題,可以郵箱(lzs@wch.cn)和我溝通。


您好 (通過主機(jī)口獲取連接鍵鼠的數(shù)據(jù),然后通過設(shè)備口連接電腦實(shí)現(xiàn)鍵鼠的功能)這個(gè)問題 我已經(jīng)解決了
只連接一個(gè)鼠標(biāo) 或者 換成 一個(gè)鍵盤 可以被主機(jī)識別并且轉(zhuǎn)發(fā)數(shù)據(jù)到PC?
但是我用一個(gè)HUB連接主機(jī) 只能識別到HUB設(shè)備 無法正確枚舉連接在HUB上的鼠標(biāo)或者鍵盤

/* Get HUB port HID device data */

? ? ? ? ? ? ? ? for( hub_port = 0; hub_port < RootHubDev[ usb_port ].bPortNum; hub_port++ )

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? if( RootHubDev[ usb_port ].Device[ hub_port ].bStatus == ROOT_DEV_SUCCESS )

? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? index = RootHubDev[ usb_port ].Device[ hub_port ].DeviceIndex;


? ? ? ? ? ? ? ? ? ? ? ? if( RootHubDev[ usb_port ].Device[ hub_port ].bType == USB_DEV_CLASS_HID )

? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? ? ? ? ? ? for( intf_num = 0; intf_num < HostCtl[ index ].InterfaceNum; intf_num++ )

? ? ? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? for( in_num = 0; in_num < HostCtl[ index ].Interface[ intf_num ].InEndpNum; in_num++ )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ?

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* Get endpoint data based on the interval time of the device */

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if( HostCtl[ index ].Interface[ intf_num ].InEndpTimeCount[ in_num ] >= HostCtl[ index ].Interface[ intf_num ].InEndpInterval[ in_num ] )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? HostCtl[ index ].Interface[ intf_num ].InEndpTimeCount[ in_num ] %= HostCtl[ index ].Interface[ intf_num ].InEndpInterval[ in_num ];


? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* Select HUB device port */

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? USBFSH_SetSelfAddr( RootHubDev[ usb_port ].Device[ hub_port ].bAddress );

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? USBFSH_SetSelfSpeed( RootHubDev[ usb_port ].Device[ hub_port ].bSpeed );

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if( RootHubDev[ usb_port ].bSpeed != USB_LOW_SPEED )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? USBFSH->HOST_CTRL &= ~USBFS_UH_LOW_SPEED;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* Get endpoint data */

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? s = USBH_GetHidData( usb_port, index, intf_num, in_num, Com_Buf, &len );? ? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if( s == ERR_SUCCESS )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {? ? ?

#if DEF_DEBUG_PRINTF

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? for( i = 0; i < len; i++ )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DUG_PRINTF( "%02x ", Com_Buf[ i ] );

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DUG_PRINTF( "\r\n" );

#endif




if (HostCtl[index].Interface[intf_num].Type == DEC_MOUSE)

{

/* Forward mouse data */

int8_t btn = (int8_t)Com_Buf[0];? ? // Buttons

int8_t x_move = (int8_t)Com_Buf[1]; // X movement

int8_t y_move = (int8_t)Com_Buf[2]; // Y movement

int8_t wheel_move = (int8_t)Com_Buf[3]; // Wheel movement


DUG_PRINTF("Hub Mouse Data: btn=%d, X=%d, Y=%d, Wheel=%d\r\n", btn, x_move, y_move, wheel_move);


if (USBFS_Endp_DataUp(endp_mouse, Com_Buf, len, DEF_UEP_CPY_LOAD) == READY)

{

DUG_PRINTF("Hub Mouse Data Uploaded to Endpoint %d\r\n", endp_mouse);

}

else

{

DUG_PRINTF("Hub Mouse Data Upload Failed!\r\n");

}

}

else if (HostCtl[index].Interface[intf_num].Type == DEC_KEY)

{

/* Forward keyboard data */

DUG_PRINTF("Hub Keyboard Data: ");

for (i = 0; i < len; i++)

{

DUG_PRINTF("%02x ", Com_Buf[i]);

}

DUG_PRINTF("\r\n");


if (USBFS_Endp_DataUp(endp_keyboard, Com_Buf, len, DEF_UEP_CPY_LOAD) == READY)

{

DUG_PRINTF("Hub Keyboard Data Uploaded to Endpoint %d\r\n", endp_keyboard);

}

else

{

DUG_PRINTF("Hub Keyboard Data Upload Failed!\r\n");

}

}

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if( HostCtl[ index ].Interface[ intf_num ].Type == DEC_KEY )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? KB_AnalyzeKeyValue( index, intf_num, Com_Buf, len );


? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if( HostCtl[ index ].Interface[ intf_num ].SetReport_Flag )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? KB_SetReport( usb_port, index, RootHubDev[ usb_port ].Device[ hub_port ].bEp0MaxPks, intf_num );

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? else if( s == ERR_USB_DISCON )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }


? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if( s == ERR_USB_DISCON )

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }? ?

#endif? ?

? ? ? ? }

? ? }

}


然后串口的打印也只顯示 HUB-Device?

SystemClk:96000000

USB HOST KM Test

TIM3 Init OK!

USBHS Host Init

?< - USB DEVCIE INIT OK - >?

USB Port1 Dev Out.

USB Port1 Dev In.

Enum:

Get DevDesc: 12 01 10 02 09 00 01 40 e3 05 10 06 56 06 01 02 00 01?

Set DevAddr: OK

Get CfgDesc: 09 02 19 00 01 01 00 e0 32 09 04 00 00 01 09 00 00 00 07 05 81 03 01 00 0c?

DevType: 09

Set Cfg: OK

Root Device Is HUB. Enum Hub:

Analyze CfgDesc: OK

Get StringDesc1: 1a 03 47 00 65 00 6e 00 65 00 73 00 79 00 73 00 4c 00 6f 00 67 00 69 00 63 00?

Get StringDesc2: 16 03 55 00 53 00 42 00 32 00 2e 00 31 00 20 00 48 00 75 00 62 00?

Get Hub Desc: 09 29 04 e0 00 32 64 00 ff?

RootHubDev[ 01 ].bPortNum: 04

Port Power Status: 00

Port Power Status: 00

Port Power Status: 00

Port Power Status: 00

Further Enum Result: OK



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

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