|
FOR AN EMBEDDED PROCESSOR
by Stuart Allman
Start ý Typical
USB Solutions ý Required Components
ý An Easier Solution ý Following
the Rules ý Firmware ý Vendor-Specific
Requests ý Host Transfer Mechanisms
ý USB Transfers ý How
Does It Work? ý The Grand Conclusion
ý Sources and PDF
HOST TRANSFER MECHANISMS
Now that Iýve caught your attention and
you are thoroughly salivating with creative thoughts, itýs time to
think about how you are going to communicate with the host computer.
Unless your platform already has a device class supported for your
device, you will need to write a custom host application for your
new, fabulous gizmo.
The EZ-USB driver used in this example
uses the older file name mechanism for opening the driver. Newer drivers
that conform to the WDM standard will use a globally unique ID (GUID)
to access the driver. In order to open the USB device driver for reading
and writing, the host application makes a call to bOpenDriver()
with the file name specifying the device it wants to open. The system
then returns a handle to the device (bOpenDriver( &hDevice,
"Ezusb-0");.).
The identifier "Ezusb-0"
is the first USB peripheral plugged in that uses the EZ-USB driver.
If you plug in additional devices, the driver identifier will be "Ezusb-1",
"Ezusb-2", and so forth for each additional device attached.
If you need to randomly plug in your devices (as is practical), you
need to poll the device on a WM_DEVICECHANGE message for a
unique product ID or serial number.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |