by Bret » Sat Jul 25, 2009 6:57 am
Actually, USB torches (I usually call them USB reading lights) are not USB devices at all, and there's no way to write a driver for them. In the USB world, they are classified as "power leeches" or "vampires", since all they do is steal power from the USB bus without telling any of the USB software what they are doing. They are one of the things about USB that makes it impossible to manage power on the bus.
Believe it or not, the simplest USB device out there is probably a USB Hub. The reason my device drivers are so complicated is that they all support multiple devices (USBHUB, for example, can support up to 16 Hubs), and they also support plug-and-play. My drivers would be much smaller and simpler if they didn't do those things, but "general purpose" drivers like mine really need to support plug-and-play for multiple devices.