請教關於USB與SMBUS整合後的Port_Init及Report handle的OUT問題
小弟目前使用C8051F347做一個Device與Host的中繼站,如下圖:
SMBus USB HID
Device <-----> C8051F347 <---------> Host
而目前階段是C8051F347接到Host無法辨識到裝置,但又一直找不出原因...
所以又卡住3天還在卡...XD
所以小弟是覺得會是port_Init有問題吧??USB需要使用到port的規劃??
(1)USB與SMBUS整合後的Port_Init會是如下所示嗎??(這部分一直都不怎確定)
P1MDIN = 0x7F; // Port 1 pin 7 set as analog input
P0MDOUT = 0x00; // All P0 pins open-drain output
P1MDOUT |= 0x0F; // Port 1 pins 0-3 set high impedence
P2MDOUT |= 0x0C; // Port 2 pins 0,1 set high impedence
P1SKIP = 0x80; // Port 1 pin 7 skipped by crossbar
XBR0 = 0x04; // Enable SMBus pins
XBR1 = 0x40; // Enable crossbar and weak pull-ups
P0 = 0xFF;
(2)在Report handle的OUT部份,我只要把OUT_PACKET放到void OUT_Report就可以讀到由Host端傳進來資料嗎??