THE DESIGN CYCLE
Endpoint 0 is used to
interrogate and configure
a downstream USB device.
Also, endpoint 0 can be used
to send data to a downstream
USB device’s functions. The
IO-Warrior 24 USB driver
firmware employs endpoint 0
for output data (host to IO-Warrior 24) and as a vehicle
for the host to send commands
to the IO-Warrior’s special
mode functions. The path used
to set the logical state of the
IO-Warrior 24 GPIO pins flows
through endpoint 0 and
interface 0. The commands
destined for the special mode
functions also enter the IO-Warrior 24 via endpoint 0 but
flow through to interface 1.
The IO-Warrior 24 can
only report the state of the
GPIO pins when it is asked
to do so by the host. Endpoint
1 is used for this purpose.
When logic states on the IO-Warrior 24’s GPIO pins change,
the new data is transferred
on the next host request.
Thus, when the state of the GPIO pins change, a report is
generated and flows from the GPIO function through
interface 0 and out to the host via endpoint 1. Replies from
the special mode functions pass from interface 1 through
endpoint 2 to the host. Endpoints 1 and 2 are called
■ SCHEMATIC 1. Nothing you can’t handle
here. The TSOP1736 is the 36 kHz variant of a
line of IR remote control receiver modules.
The Lumex LCD I used for this discussion is a
pin-for-pin match to the schematic LCD pinout.
interrupt-in endpoints. In this case, interrupt means that data is
transferred only when there is new data to pass along. The
host determines when the new data is transferred which
(due to the USB protocol) is once every 8 to 10 mS.
■ SCREENSHOT 1. There’s no need to get fancy and complicated.
All we want to do is display the results of the IO-Warrior
API calls. Visual C++ is easy to learn and allows you to
associate the IO-Warrior API calls with buttons and controls.
IO-WARRIOR 24 FIRE CONTROL
We’ve already discussed more USB concepts than
■ SCREENSHOT 2. Things just don’t work well in the compilation
and link processes without including this library into the
mix. The library is included with the IO-Warrior Software
Development Kit which is part of the IO-Warrior 24 Starter
Kit. This window can be found in the Project pull-down menu.
November 2009 51