Forum Discussion
Altera_Forum
Honored Contributor
14 years agoIn fact there is no "simple" way to handle USB.
In fact the USB "Function" is a different layer from the USB "Hardware". These need to be handled separately (e.g. you can use the same USB connector hardware to attach to multiple functions in your device, even several at the same time.) Why do you think, you need to write a driver ? Seemingly you want to do an USB device interface in your design. Do you have appropriate "Device-Site" or "On The Go" hardware ? For such hardware, an USB "hardware-layer" driver should be available. On top of that, you need to handle the basic USB protocol and connect your software to the USB data stream. I suppose you should be able to find a driver in source code that creates a TTY device from the USB device function. Now your user land software can use this to deal with the "user"- byte stream to and from the PC. (Again, in Linux a TTY device is a "file" :) .) To make the PC see the device (e.g. as a serial device) your device needs to provide an appropriate vendor and device ID to the PC, and (supposing your PC runs Windows) you need to install a file that makes the OS load the standard USB-serial-device driver for this device when seeing these IDs. Other Standard USB device types are "Storage-Media" and "Ethernet", but I suppose handling those is a lot more complicated that "serial". Even more demanding is defining your own USB device type. Here you would need to write a propriety Windows USB driver to access your device. -Michael