3GO模拟飞行网|3GO Cyber Air Force

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: hbk0401

我的DIY——USB 光电5轴游戏控制器-写在圣诞节(已上图)

[复制链接]
发表于 2010-12-29 13:14:53 | 显示全部楼层
真  厉害    我也想DIY 个脚舵
发表于 2010-12-31 16:39:14 | 显示全部楼层
楼主真乃神人也,强悍啊
发表于 2011-1-1 16:55:30 | 显示全部楼层
完全不懂..........
发表于 2011-1-2 08:39:40 | 显示全部楼层
俺有位姓常名言的大哥告诉俺:“淫8可貌相,溪水也不能拿斗量”

看完这写对俺来说乱七八糟的东西,俺的菊紧了又紧    最后还是决定顶一下

再问LZ一句:“你压。。。。力大麽?”
发表于 2011-1-3 08:55:42 | 显示全部楼层
这才是专家啊!!!!
发表于 2011-1-3 10:51:39 | 显示全部楼层
支持DIY
发表于 2011-1-4 12:17:02 | 显示全部楼层
支持LZ的DIY精神
都忘了是你的证明人了.........
 楼主| 发表于 2011-1-5 20:49:53 | 显示全部楼层
呵呵,又不被考核,哪来压力!
只不过天天看着大家玩的这么HIGH,羡慕啊!
没办法,只能闭门抓紧造车!
其实,DIY的过程也是一种享受!
发表于 2011-1-5 21:30:22 | 显示全部楼层
回复 23# hbk0401


    LZ再弄个,搞好卖我吧
发表于 2011-1-7 12:33:31 | 显示全部楼层
楼主真是人才啊,真是佩服佩服。
发表于 2011-1-8 16:20:59 | 显示全部楼层
都是神人啊
发表于 2011-1-9 17:32:23 | 显示全部楼层
回复  hbk0401


    LZ再弄个,搞好卖我吧
SLHSu37 发表于 2011-1-5 21:30



    同求一块
 楼主| 发表于 2011-1-13 22:59:46 | 显示全部楼层
我发现我弄的这个好像挑机器:只能在我的台机上识别,在笔记本电脑上就成了“不可识别的设备”,不知道什么原因!所以还是不稳定的。
各位如果有兴趣,我可以共享我的技术资料一起研究制作。原现图简单可以照张图上传,PCB在厂里画的不可能拷出来了。关键是代码,等我重新抄一份一块上传吧!
发表于 2011-1-14 11:45:07 | 显示全部楼层
别的不用,把你的descriptor文件发出来就行了。
 楼主| 发表于 2011-1-14 22:11:13 | 显示全部楼层
Descriptor是这样的:
;------------------------------------------------------------------------------------------
.equ USBversion  =0x0100  ;for what version USB is that (1.00)
.equ VendorUSBID  =0x0777  ;vendor identifier (Atmel=0x03EB)
.equ DeviceUSBID  =0x0001  ;product identifier (USB Joystick)
.equ DeviceVersion  =0x0001  ;version number of product (version=0.01)
      ;(0.01=First USB Joystick with internal ADC)
.equ MaxUSBCurrent  =0xC8  ;current consumption from USB (50mA) - together with MAX232
;------------------------------------------------------------------------------------------
DeviceDescriptor:
  .db 0x12,0x01  ;0 byte - size of descriptor in byte
      ;1 byte - descriptor type: Device descriptor
  .dw USBversion  ;2,3 byte - version USB LSB (1.00)
  .db 0x00,0x00  ;4 byte - device class
      ;5 byte - subclass
  .db 0x00,0x08  ;6 byte - protocol code
      ;7 byte - FIFO size in bytes
  .dw VendorUSBID  ;8,9 byte - vendor identifier
  .dw DeviceUSBID  ;10,11 byte - product identifier
  .dw DeviceVersion  ;12,13 byte - product version number
  .db 0x01,0x02  ;14 byte - index of string "vendor"
      ;15 byte - index of string "product"
  .db 0x00,0x01  ;16 byte - index of string "serial number" (0=none)
      ;17 byte - number of possible configurations
DeviceDescriptorEnd:
;------------------------------------------------------------------------------------------
ConfigDescriptor:
  .db 0x9,0x02  ;length, descriptor type
ConfigDescriptorLength:
  .dw 9+9+9+7   ;entire length of all descriptors + HID
ConfigAnswerMinus1:   ;for sending the number - congiguration number (attention - addition of 1 required)
  .db 1,1   ;numInterfaces, congiguration number
  .db 2,0x80   ;string index (0=none), attributes; bus powered
;InterfaceDescriptor-1:
  .db MaxUSBCurrent/2,0x09  ;current consumption,    interface descriptor length
  .db 0x04,0   ;interface descriptor; number of interface
InterfaceAnswer:   ;for sending number of alternatively interface
  .db 0,1   ;alternatively interface; number of endpoints except EP0
  .db 0x03,0   ;interface class - HID; interface subclass
  .db 0,3   ;protocol code; string index - Device name
HIDDescriptor:
  .db 0x09,0x21 ; HID descriptor length , HID descriptor type (defined by USB)
  .dw 0x101  ; HID Class Specification release number
  .db 0,0x01   ;Hardware target country.; ;Number of HID class descriptors to follow.
  .db 0x22,ReportDescriptorSize   ;Report descriptor type.; length LSB
  .db 0, 0x07   ;Total length of Report descriptor MSB, EndPointDescriptor length
;EndPointDescriptor:
  .db 0x5, 0x81  ;, descriptor type - endpoint
  .db 0x3, 0x08   ;endpoint address In 1; transfer type -interrupt;max packet size LSB
  .db 0, 10   ;max packet size MSB,polling interval [ms];
ConfigDescriptorEnd:
;-------------------------
StatusAnswer:
  .db 0,0  ;2 zero answers
;-----------------------------------
.equ ReportDescriptorSize =0x3d;61 (ReportDescriptorEnd-ReportDescriptor)*2-1;0x37;55
.equ JoystickReportSize =6
ReportDescriptor:
  .db 0x05,0x01  ;Usage_Page (Generic Desktop)
  .db 0x15,0x00  ;Logical_Minimum (0)
  .db 0x09,0x04  ;Usage (Joystick)
  .db 0xA1,0x01  ;Collection (Application)
  .db 0x05,0x02   ;Usage_Page (Simulation Controls)
  .db 0x09,0xC8   ;Usage (Steering) - OK
  .db 0x16,0x00   ;Logical_Minimum (-1024)
  .db 0xFC,0x26
  .db 0xFF,0x03   ;Logical Maximum (1023)
  .db 0x75,0x10   ;Report_Size (16)
  .db 0x95,0x01   ;Report_Count (1)
  .db 0x81,0x02   ;Input (Data, Var, Abs)
  .db 0x09,0xC4   ;Usage (Accelerator)  OK for 1 axle
  .db 0x09,0xBB   ;Usage (Throttle) - OK for 2 axle
  .db 0x09,0xC5   ;Usage (Brake) - OK 2 axle
  .db 0x15,0x81   ;Logical_Minimum (-128)
  .db 0x25,0x7F   ;Logical Maximum (127)
  .db 0x75,0x08   ;Report_Size (8)
  .db 0x95,0x03   ;Report_Count (3)
  .db 0x81,0x02   ;Input (Data, Var, Abs)
  .db 0x05,0x09   ;Usage_Page (Button)
  .db 0x19,0x01   ;Usage_Minimum (Button 1)
  .db 0x29,0x08   ;Usage_Maximum (Button 24)
  .db 0x15,0x00   ;Logical_Minimum (0)
  .db 0x25,0x01   ;Logical_Maximum (1)
  .db 0x35,0x00   ;Physical_Minimum(0)
  .db 0x45,0x01   ;Physical_Maximum(1)
  .db 0x75,0x01   ;Report_Size (1)
  .db 0x95,0x08   ;Report_Count (8)
  .db 0x81,0x02   ;Input (Data, Var, Abs)
  .db 0xC0,0   ;End_Collection , dummy padding
ReportDescriptorEnd:

;------------------------------------------------------------------------------------------
LangIDStringDescriptor:
  .db (LangIDStringDescriptorEnd-LangIDStringDescriptor)*2,3 ;length, type: string descriptor
  ;.dw 0x0409   ;English
  .dw 0x0009   ;English
LangIDStringDescriptorEnd:
;------------------------------------------------------------------------------------------
VendorStringDescriptor:
  .db (VendorStringDescriptorEnd-VendorStringDescriptor)*4-2,3 ;length, type: string descriptor
CopyRight:
  .db "hbk0401,Copyright(c)_2010"
CopyRightEnd:
VendorStringDescriptorEnd:
;------------------------------------------------------------------------------------------
DevNameStringDescriptor:
  .db (DevNameStringDescriptorEnd-DevNameStringDescriptor)*4-2,3;length, type: string descriptor
  .db "HBK_JoyStick_for_R220"
DevNameStringDescriptorEnd:
NameStringDescriptor:
  .db (NameStringDescriptorEnd-NameStringDescriptor)*4-2,3;length, type: string descriptor
  .db "ATMega8_based USB Optical Joystick"
NameStringDescriptorEnd:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|3GO模拟飞行网|3GO Cyber Air Force ( 沪ICP备08002287号|沪ICP备14050587号 )

GMT+8, 2024-11-16 14:31

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表