OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 8:18 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: USB HID command
PostPosted: Wed Jan 30, 2013 2:29 pm 
Offline
Member
Member

Joined: Sun Sep 02, 2012 11:04 am
Posts: 30
Hi, i been messing with the HID on usb and i tryed lot of way to switch the device (mouse or keyboard) to report protocol or to simply set the idle to something else than 0 butit always fail... the device stop responding

by alot of way i mean various config of the packet.

what i do is to send on the config pipe the fallowing command:

Set_Idle: dw 0x0a21,0x0200,0x0001, 0x0000

i tryed to switch the data, changed them to diferent value used 00 instead of 21(the usb hid pdf suggest 0x21 but some source i found use 00)

i am wondering if any of you could give me some hint on the way it should be done. currently mouse and kb work in boot protocol but it's not very accurate (click or key doesnt always get reported or are reported only on raise wich make the report containing 0 instead of the key value)

note that bochs will always report a result on poll when my test pc awnser with a nack if there is no change

thx

_________________
OS Website


Top
 Profile  
 
 Post subject: Re: USB HID command
PostPosted: Thu Jan 31, 2013 11:53 am 
Offline
Member
Member

Joined: Sat Mar 15, 2008 7:20 am
Posts: 42
Location: Wisconsin, USA
Here is part of my usb mouse init sequence.
MouseSetProtocol switches from boot to report.

;returns 18 bytes at 0x5500
call MouseGetDeviceDescriptor

;read just the configuration descriptor to get MOUSEWTOTALLENGTH
mov edx,9
call MouseGetConfigDescriptor

;now we get the Config+Interface+HID+Endpoint Descriptors all in 1 shot
xor edx,edx
mov dx,[MOUSEWTOTALLENGTH]
call MouseGetConfigDescriptor

call MouseGetReportDescriptor
call MouseSetAddress
call MouseSetProtocol
call MouseSetIdle
call MouseSetConfiguration

;ready to conduct usb mouse interrupt IN transactions
;see /usb/interrupt.s

TomT
http://code.google.com/p/tatos/


Top
 Profile  
 
 Post subject: Re: USB HID command
PostPosted: Thu Jan 31, 2013 6:16 pm 
Offline
Member
Member

Joined: Sun Sep 02, 2012 11:04 am
Posts: 30
thx for the tips, i found part of my problem... i forgot to set the TD procesing order (breadth/depth first) wich was creating bug sometime.

now i can switch to Report protocol but still that damn mouse doesnt report everything... the "raise" event doesnt get send.
i tryed the way you do it but no change :(

ex: for button1 instead of getting the pushed and raised action i get only the pushed one

the raw data i get is this:

01 00 00 00
01 00 00 00
01 00 00 00

this is what i get for 3 click
it would be convenient to get a 00 00 00 00 between them to know when the button got raised

_________________
OS Website


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 84 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group