마소전략커맨더
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
마소전략커맨더 [2009/11/06 01:12] – suapapa | 마소전략커맨더 [2013/08/03 05:04] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ID | + | ====== 관련 파일 ====== |
+ | * drivers/ | ||
+ | * drivers/ | ||
+ | * Documentation/ | ||
+ | |||
+ | ====== HID report ====== | ||
+ | * / | ||
+ | * / | ||
+ | |||
+ | ====== references ====== | ||
+ | *[[http:// | ||
+ | |||
+ | |||
+ | libusb | ||
+ | <code c> | ||
+ | int usb_control_msg(usb_dev_handle *dev, int requesttype, | ||
+ | </ | ||
+ | in kernel | ||
< | < | ||
- | Bus 002 Device 002: ID 045e:0033 Microsoft Corp. Sidewinder Strategic Commander | + | /** |
+ | * usb_control_msg - Builds a control urb, sends it off and waits for completion | ||
+ | * @dev: pointer to the usb device to send the message to | ||
+ | * @pipe: endpoint " | ||
+ | * @request: USB message request value | ||
+ | * @requesttype: | ||
+ | * @value: USB message value | ||
+ | * @index: USB message index value | ||
+ | * @data: pointer to the data to send | ||
+ | * @size: length in bytes of the data to send | ||
+ | * @timeout: time in msecs to wait for the message to complete before timing | ||
+ | * out (if 0 the wait is forever) | ||
+ | */ | ||
+ | int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, | ||
+ | __u8 requesttype, | ||
+ | __u16 size, int timeout) | ||
</ | </ | ||
+ | ====== code practice ====== | ||
+ | ===== 깜박이는 속도 ===== | ||
+ | <code c> | ||
+ | memcpy(buf, | ||
+ | ret = usb_control_msg(devh, | ||
+ | </ | ||
+ | * 020101 : 파르르르르 | ||
+ | * 021111 : 빠르게 | ||
+ | * 022222 : 느리게 | ||
- | LED 켜고 끄기 덤프내용 | + | ===== LED ON/OFF ===== |
- | < | + | 두바이트에 다음과 같이 할당되어 있음 B(link)와 O(n)비트를 동시에 설정할 수 없음 |
- | -- URB_FUNCTION_CLASS_INTERFACE: | + | < |
- | TransferFlags | + | 4 3 2 1 n R 6 5 |
- | TransferBufferLength = 00000003 | + | BO BO BO BO xx BO BO BO |
- | TransferBuffer | + | </ |
- | TransferBufferMDL | + | 테스스코드 |
- | | + | <code c> |
- | | + | memcpy(buf, " |
- | | + | ret = usb_control_msg(devh, |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
*1번 LED : 01 01 00 | *1번 LED : 01 01 00 | ||
+ | *1번 LED 깜박임 : 01 02 00 | ||
*2번 LED : 01 04 00 | *2번 LED : 01 04 00 | ||
*3번 LED : 01 10 00 | *3번 LED : 01 10 00 | ||
*4번 LED : 01 40 00 | *4번 LED : 01 40 00 | ||
- | *6개 모두 on : 01 55 05 | + | *7개 모두 on : 01 55 15 |
+ | *전체 깝박임 : 01 AA 2A | ||
+ | |||
+ | ====== 장치정보 ====== | ||
+ | usb ID | ||
+ | < | ||
+ | Bus 002 Device 002: ID 045e:0033 Microsoft Corp. Sidewinder Strategic Commander | ||
+ | </ | ||
+ | 상세정보 | ||
+ | < | ||
+ | $ sudo lsusb -v -d 045e:0033 | ||
+ | |||
+ | Bus 002 Device 002: ID 045e:0033 Microsoft Corp. Sidewinder Strategic Commander | ||
+ | Device Descriptor: | ||
+ | bLength | ||
+ | bDescriptorType | ||
+ | bcdUSB | ||
+ | bDeviceClass | ||
+ | bDeviceSubClass | ||
+ | bDeviceProtocol | ||
+ | bMaxPacketSize0 | ||
+ | idVendor | ||
+ | idProduct | ||
+ | bcdDevice | ||
+ | iManufacturer | ||
+ | iProduct | ||
+ | iSerial | ||
+ | bNumConfigurations | ||
+ | Configuration Descriptor: | ||
+ | bLength | ||
+ | bDescriptorType | ||
+ | wTotalLength | ||
+ | bNumInterfaces | ||
+ | bConfigurationValue | ||
+ | iConfiguration | ||
+ | bmAttributes | ||
+ | (Bus Powered) | ||
+ | Remote Wakeup | ||
+ | MaxPower | ||
+ | Interface Descriptor: | ||
+ | bLength | ||
+ | bDescriptorType | ||
+ | bInterfaceNumber | ||
+ | bAlternateSetting | ||
+ | bNumEndpoints | ||
+ | bInterfaceClass | ||
+ | bInterfaceSubClass | ||
+ | bInterfaceProtocol | ||
+ | iInterface | ||
+ | HID Device Descriptor: | ||
+ | bLength | ||
+ | bDescriptorType | ||
+ | bcdHID | ||
+ | bCountryCode | ||
+ | bNumDescriptors | ||
+ | bDescriptorType | ||
+ | wDescriptorLength | ||
+ | Report Descriptor: (length is 190) | ||
+ | Item(Global): | ||
+ | Generic Desktop Controls | ||
+ | Item(Local ): Usage, data= [ 0x00 ] 0 | ||
+ | Undefined | ||
+ | Item(Main | ||
+ | Application | ||
+ | Item(Global): | ||
+ | Item(Local ): Usage, data= [ 0x01 ] 1 | ||
+ | Pointer | ||
+ | Item(Main | ||
+ | Physical | ||
+ | Item(Global): | ||
+ | Generic Desktop Controls | ||
+ | Item(Local ): Usage, data= [ 0x30 ] 48 | ||
+ | Direction-X | ||
+ | Item(Local ): Usage, data= [ 0x31 ] 49 | ||
+ | Direction-Y | ||
+ | Item(Local ): Usage, data= [ 0x35 ] 53 | ||
+ | Rotate-Z | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Main | ||
+ | Data Variable Absolute No_Wrap Linear | ||
+ | Preferred_State No_Null_Position Non_Volatile Bitfield | ||
+ | Item(Main | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Main | ||
+ | Constant Array Absolute No_Wrap Linear | ||
+ | Preferred_State No_Null_Position Non_Volatile Bitfield | ||
+ | Item(Global): | ||
+ | Buttons | ||
+ | Item(Local ): Usage Minimum, data= [ 0x01 ] 1 | ||
+ | Button 1 (Primary) | ||
+ | Item(Local ): Usage Maximum, data= [ 0x0c ] 12 | ||
+ | (null) | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Main | ||
+ | Data Variable Absolute No_Wrap Linear | ||
+ | Preferred_State No_Null_Position Non_Volatile Bitfield | ||
+ | Item(Global): | ||
+ | Buttons | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Local ): Usage, data= [ 0x0d ] 13 | ||
+ | (null) | ||
+ | Item(Local ): Usage, data= [ 0x0e ] 14 | ||
+ | (null) | ||
+ | Item(Local ): Usage, data= [ 0x0f ] 15 | ||
+ | (null) | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Main | ||
+ | Data Array Absolute No_Wrap Linear | ||
+ | No_Preferred_State No_Null_Position Non_Volatile Bitfield | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Main | ||
+ | Constant Array Absolute No_Wrap Linear | ||
+ | Preferred_State No_Null_Position Non_Volatile Bitfield | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | LEDs | ||
+ | Item(Local ): Usage Minimum, data= [ 0x4b ] 75 | ||
+ | Generic Indicator | ||
+ | Item(Main | ||
+ | Logical | ||
+ | Item(Local ): Usage Minimum, data= [ 0x49 ] 73 | ||
+ | Indicator Green | ||
+ | Item(Main | ||
+ | Logical | ||
+ | Item(Local ): Usage, data= [ 0x3c ] 60 | ||
+ | Usage Multi Indicator | ||
+ | Item(Main | ||
+ | Logical | ||
+ | Item(Local ): Usage, data= [ 0x41 ] 65 | ||
+ | Indicator Off | ||
+ | Item(Local ): Usage, data= [ 0x3d ] 61 | ||
+ | Indicator On | ||
+ | Item(Local ): Usage, data= [ 0x40 ] 64 | ||
+ | Indicator Fast Blink | ||
+ | Item(Main | ||
+ | Data Array Absolute No_Wrap Linear | ||
+ | No_Preferred_State Null_State Non_Volatile Bitfield | ||
+ | Item(Main | ||
+ | Item(Main | ||
+ | Item(Main | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | LEDs | ||
+ | Item(Local ): Usage Minimum, data= [ 0x4b ] 75 | ||
+ | Generic Indicator | ||
+ | Item(Main | ||
+ | Logical | ||
+ | Item(Local ): Usage Minimum, data= [ 0x48 ] 72 | ||
+ | Indicator Red | ||
+ | Item(Main | ||
+ | Logical | ||
+ | Item(Local ): Usage, data= [ 0x3c ] 60 | ||
+ | Usage Multi Indicator | ||
+ | Item(Main | ||
+ | Logical | ||
+ | Item(Local ): Usage, data= [ 0x41 ] 65 | ||
+ | Indicator Off | ||
+ | Item(Local ): Usage, data= [ 0x3d ] 61 | ||
+ | Indicator On | ||
+ | Item(Local ): Usage, data= [ 0x40 ] 64 | ||
+ | Indicator Fast Blink | ||
+ | Item(Main | ||
+ | Data Array Absolute No_Wrap Linear | ||
+ | No_Preferred_State Null_State Non_Volatile Bitfield | ||
+ | Item(Main | ||
+ | Item(Main | ||
+ | Item(Main | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Main | ||
+ | Constant Array Absolute No_Wrap Linear | ||
+ | Preferred_State No_Null_Position Non_Volatile Bitfield | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | Item(Global): | ||
+ | System: SI Linear, Unit: Seconds | ||
+ | Item(Global): | ||
+ | Unit Exponent: 2 | ||
+ | Item(Local ): Usage, data= [ 0x45 ] 69 | ||
+ | Fast Blink On Time | ||
+ | Item(Main | ||
+ | Data Array Absolute No_Wrap Linear | ||
+ | No_Preferred_State Null_State Non_Volatile Bitfield | ||
+ | Item(Local ): Usage, data= [ 0x46 ] 70 | ||
+ | Fast Blink Off Time | ||
+ | Item(Main | ||
+ | Data Array Absolute No_Wrap Linear | ||
+ | No_Preferred_State Null_State Non_Volatile Bitfield | ||
+ | Item(Main | ||
+ | Endpoint Descriptor: | ||
+ | bLength | ||
+ | bDescriptorType | ||
+ | bEndpointAddress | ||
+ | bmAttributes | ||
+ | Transfer Type Interrupt | ||
+ | Synch Type | ||
+ | Usage Type | ||
+ | wMaxPacketSize | ||
+ | bInterval | ||
+ | Device Status: | ||
+ | (Bus Powered) | ||
+ | </ | ||
====== references ====== | ====== references ====== | ||
Line 29: | Line 295: | ||
*[[http:// | *[[http:// | ||
*[[http:// | *[[http:// | ||
+ | *[[http:// |
마소전략커맨더.1257469945.txt.gz · Last modified: 2013/08/03 05:04 (external edit)