(仮)釣りと電子工作 GT Forceの解析 忍者ブログ
趣味の電子工作と釣りについて。電子工作は、おもに変換器作成。釣りはおもにトラウトの管釣り。
[155] [154] [153] [152] [151] [150] [149] [148] [147] [146] [144]
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

まずはGT  ForceのベンダーIDとプロダクトIDを調べる。デバイスマネージャから。。。。
0x046D:0C93
これをキーに、Snoopy ProでUSBパケットキャプチャー。
たなみにGT  Forceは2軸6ボタンのジョイスティックとしてドライバレスでも使えるが、ドライバ入れると3軸6ボタンに変化して、フォースフィードバックが使えるようになる。

解析結果まとめ

【入力】
X軸:ステアリング、10bit
Y軸:アクセル+ブレーキ、8bit
ボタン:6個
ポインター1:ドライバ入れるとアクセルに化ける、8bit
ポインター2:ドライバ入れるとブレーキに化ける、8bit

【出力】
マウス:名前とはちがって、フォースフィードバック用と思われる。

-----
ということで、デスクリプター書いてみた。
PC用ロジクールのドライバが使えるので、おそらく問題ないだろう。
しかしPS2で使用できるかは未知数。(じつはPS2持ってない)

------


+ + + + + + + + + +
/* Device Descriptor */
ROM USB_DEVICE_DESCRIPTOR device_dsc=
{
    0x12,    // Size of this descriptor in bytes
    USB_DESCRIPTOR_DEVICE,                // DEVICE descriptor type
    0x0100,                 // USB Spec Release Number in BCD format
    0x00,                   // Class Code
    0x00,                   // Subclass code
    0x00,                   // Protocol code
    USB_EP0_BUFF_SIZE,      // Max packet size for EP0, see usb_config.h
    0x046d,                 // Vendor ID, see usb_config.h
    0xc293,                 // Product ID, see usb_config.h
    0x0101,                 // Device release number in BCD format
    0x04,                   // Manufacturer string index
    0x20,                   // Product string index
    0x00,                   // Device serial number string index
    0x01                    // Number of possible configurations
};

/* Configuration 1 Descriptor */
ROM BYTE configDescriptor1[]={
    /* Configuration Descriptor */
    0x09,//sizeof(USB_CFG_DSC),    // Size of this descriptor in bytes
    USB_DESCRIPTOR_CONFIGURATION,                // CONFIGURATION descriptor type
    DESC_CONFIG_WORD(0x0029),   // Total length of data for this cfg
    1,                      // Number of interfaces in this cfg
    1,                      // Index value of this configuration
    0,                      // Configuration string index
    0x80,                   // Attributes, see usb_device.h
    40,                     // Max power consumption (2X mA)

    /* Interface Descriptor */
    0x09,//sizeof(USB_INTF_DSC),   // Size of this descriptor in bytes
    USB_DESCRIPTOR_INTERFACE,               // INTERFACE descriptor type
    0,                      // Interface Number
    0,                      // Alternate Setting Number
    2,                      // Number of endpoints in this intf
    HID_INTF,               // Class code
    0,     // Subclass code
    0,     // Protocol code
    0,                      // Interface string index

    /* HID Class-Specific Descriptor */
    0x09,//sizeof(USB_HID_DSC)+3,    // Size of this descriptor in bytes RRoj hack
    DSC_HID,                // HID descriptor type
    DESC_CONFIG_WORD(0x0100),                 // HID Spec Release Number in BCD format (1.11)
    0x21,                   // Country Code (0x00 for Not supported)
    HID_NUM_OF_DSC,         // Number of class descriptors, see usbcfg.h
    DSC_RPT,                // Report descriptor type
    DESC_CONFIG_WORD(HID_RPT01_SIZE),   //sizeof(hid_rpt01),      // Size of the report descriptor
   
    /* Endpoint Descriptor */
    0x07,/*sizeof(USB_EP_DSC)*/
    USB_DESCRIPTOR_ENDPOINT,    //Endpoint Descriptor
    HID_EP | _EP_IN,            //EndpointAddress
    _INTERRUPT,                       //Attributes
    DESC_CONFIG_WORD(8),        //size
    0x0a,                        //Interval

    /* Endpoint Descriptor */
    0x07,/*sizeof(USB_EP_DSC)*/
    USB_DESCRIPTOR_ENDPOINT,    //Endpoint Descriptor
    HID_EP | _EP_OUT,            //EndpointAddress
    _INTERRUPT,                       //Attributes
    DESC_CONFIG_WORD(8),        //size
    0x0a                        //Interval
};

ROM struct{BYTE report[HID_RPT01_SIZE];}hid_rpt01={{
  0x05,0x01,        //  USAGE_PAGE (Generic Desktop)
  0x09,0x04,        //  USAGE (Game Pad)
  0xA1,0x01,        //  COLLECTION (Application)
  0xA1,0x02,        //  COLLECTION (Logical)

  0x95,0x01,        //  REPORT_COUNT(1)
  0x75,0x0A,        //  REPORT_SIZE(10)
  0x15,0x00,        //  LOGICAL_MINIMUM(0)
  0x26,0xFF,0x03,   //  LOGICAL_MAXIMUM(1023)
  0x35,0x00,        //  PHYSICAL_MINIMUM(0)
  0x46,0xFF,0x03,   //  PHYSICAL_MAXIMUM(1023)
  0x09,0x30,        //  USAGE(X)
  0x81,0x02,        //  INPUT(Data,Var,Abs)

  0x95,0x06,        //  REPORT_COUNT(6)
  0x75,0x01,        //  REPORT_SIZE(1)
  0x25,0x01,        //  LOGICAL_MAXIMUM(1)
  0x45,0x01,        //  PHYSICAL_MAXIMUM(1)
  0x05,0x09,        //  USAGE_PAGE(Button)
  0x19,0x01,        //  USAGE_MINIMUM(Button 1)
  0x29,0x06,        //  USAGE_MAXIMUM(Button 6)
  0x81,0x02,        //  INPUT(Data,Var,Abs)

  0x95,0x01,        //  REPORT_COUNT(1)
  0x75,0x08,        //  REPORT_SIZE(8)
  0x26,0xFF,0x00,   //  LOGICAL_MAXIMUM(255)
  0x46,0xFF,0x00,   //  PHYSICAL_MAXIMUM(255)
  0x06,0x00,0xFF,   //  Vendor Defined Page 1
  0x09,0x01,        //  USAGE(Pointer)
  0x81,0x02,        //  INPUT(Data,Var,Abs)

  0x05,0x01,        //  USAGE_PAGE (Generic Desktop
  0x09,0x31,        //  USAGE(Y)
  0x81,0x02,        //  INPUT(Data,Var,Abs)

  0x06,0x00,0xFF,   //  Vendor Defined Page 1
  0x09,0x01,        //  USAGE(Pointer)
  0x95,0x03,        //  REPORT_COUNT(3)
  0x81,0x02,        //  INPUT(Data,Var,Abs)

  0xC0,             //  END_COLLECTION

  0xA1,0x02,        //  COLLECTION Logical
  0x09,0x02,        //  USAGE(MOUSE)
  0x95,0x07,        //  REPORT_COUNT(7)
  0x91,0x02,        //  OUTPUT (Data,Var,Abs)
 
  0xC0,             //  END_COLLECTION
  0xC0              //  END_COLLECTION
}
};
/** EOF usb_descriptors.c ***************************************************/

#endif


PR
この記事にコメントする
お名前
タイトル
文字色
URL
コメント
パスワード Vodafone絵文字 i-mode絵文字 Ezweb絵文字
この記事へのトラックバック
この記事にトラックバックする:
カレンダー
03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
リンク
最新TB
バーコード
ブログ内検索
カウンター
Powered by ニンジャブログ  Designed by 穂高
Copyright © (仮)釣りと電子工作 All Rights Reserved
忍者ブログ / [PR]