Michael N. Moran wrote: : Geir Frode Raanes wrote: :> I am looking for some kind of example device driver :> source code for USB devices on WinNT++. I'm not really :> sure as to what I am looking for, hence the muddy question. :> :> What I am certain of is that the example need to be dead :> simple - no multithreading, reentrant and who knows what. :> That rules out MS Developer Network. Block on all and :> everything, I do not care as long as it allows me to :> talk to the USB device one way or the other. :> : : Having said that, I have written several USB device drivers, : the latest one of which is a FAT16 storage system that uses : SCSI/Transparent Transport/Bulk-Only/USB.
Ooooh - Filesystems. Don't wanna go there... No Sir.
: Linux, however, does have source code for this, but : it takes a *little* effort to determine how things work.
In the Linux case, we have the Rubini/Corbet book. That makes life a lot easier, though I will not attemt to pass the illusion that I have read the complete book. The book is excellent on 'local' bus attached devices, but becomes sketchy when it comes to SCSI/USB.
: The USB bulk pipe mechanism is the "easiest" USB : pipe type to use. [Once you've gotten past enumeration, : etc ... nothing on the host side is *easy* in USB.]
Then bulk pipe is what I want. Sounds like it will work like a network socket from userland point of view. Good Thing(TM)
: The Transparent Transport mechanism wraps SCSI commands : and provides the message delimiting mechanism semantics : using two USB Bulk pipes, one in each direction. : : If I knew a little bit more about your application, : perhaps I could give you some more help. I do not have one (yet.) But for the sake of the argument lets pretend I have a typical simplistic USB-DAQ thingie.
I then need to do the following:
1) enumerate the device etc.
2) set up a data aquisition eg. as follows: - select DAC channel - set sampling rate - trig/start sampling either in HW or by SW - dump sampled data, ideally isochronously over USB or else from some buffer memory. - stop sampling
3) disconnect the device
In other words - the same thing one ususally do over the serial port by means of some proprietary protocol, just faster. I need access to a handful of setup/control registers, that typically will result in a bulk data transfer from USB device to PC host. Or vice versa. How hard can that be? Very, evidently...