終於把USB HID 給搞定了。
感謝這篇文章,讓我終於知道出了什麼包,我找了快一天了Orz
原來是我的reset setting沒有設定好。我還以為是我的描述元弄錯了。
初始化劃面:
確認USB HID DEVICE:
接收到正確資料。
可以從USB ANALYZER得知,資料有進「IN」有出「OUT」。
太棒了!
下一步, 製作自己的小玩具。
第一次修改HID 描述元。 終於有點眉目了 參這裡的說明。 http://www.microchip.com/forums/m558929-print.aspx
0x06, 0x00, 0xFF, // Usage Page = 0xFF00 (Vendor Defined Page 1)
0x09, 0x01, // Usage (Vendor Usage 1)
0xA1, 0x01, // Collection (Application)
0x19, 0x01, // Usage Minimum
0x29, 0x40, // Usage Maximum //64 input usages total (0x01 to 0x40)
0x15, 0x01, // Logical Minimum (data bytes in the report may have minimum value = 0x00)
0x26, 0xFF, 0x00, // Logical Maximum (data bytes in the report may have maximum value = 0x00FF = unsigned 255)
0x75, 0x08, // Report Size: 8-bit field size
0x95, 0x40, // Report Count: Make sixty-four 8-bit fields (the next time the parser hits an "Input", "Output", or "Feature" item)
0x81, 0x00, // Input (Data, Array, Abs): Instantiates input packet fields based on the above report size, count, logical min/max, and usage.
0x19, 0x01, // Usage Minimum
0x29, 0x40, // Usage Maximum //64 output usages total (0x01 to 0x40)
0x91, 0x00, // Output (Data, Array, Abs): Instantiates output packet fields. Uses same report size and count as "Input" fields, since nothing new/different was specified to the parser since the "Input" item.
0xC0 // End Collection
因為在家沒有C++,下次再來測試GUI 是否可以正常讀到資料。 接著就可以做自己的「小玩具」了。 ^^"
最近學弟貼了挺超值的開發板給我看
http://goods.ruten.com.tw/item/show?21106255703147
坦白說, 一塊開發板除了應該有的MCU 還有 ICE, 另外還送你幾顆熱門的Device, 實在是超級超值的。
如果有興趣想學習的話,真的可以認真考慮敗回家研究一下。