diff options
Diffstat (limited to 'lib/vusb/examples/hid-data/Readme.txt')
-rw-r--r-- | lib/vusb/examples/hid-data/Readme.txt | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/lib/vusb/examples/hid-data/Readme.txt b/lib/vusb/examples/hid-data/Readme.txt new file mode 100644 index 000000000..cb17baa01 --- /dev/null +++ b/lib/vusb/examples/hid-data/Readme.txt | |||
@@ -0,0 +1,75 @@ | |||
1 | This is the Readme file for the hid-data example. In this example, we show | ||
2 | how blocks of data can be exchanged with the device using only functionality | ||
3 | compliant to the HID class. Since class drivers for HID are included with | ||
4 | Windows, you don't need to install drivers on Windows. | ||
5 | |||
6 | |||
7 | WHAT IS DEMONSTRATED? | ||
8 | ===================== | ||
9 | This example demonstrates how the HID class can be misused to transfer fixed | ||
10 | size blocks of data (up to the driver's transfer size limit) over HID feature | ||
11 | reports. This technique is of great value on Windows because no driver DLLs | ||
12 | are needed (the hid-custom-rq example still requires the libusb-win32 DLL, | ||
13 | although it may be in the program's directory). The host side application | ||
14 | requires no installation, it can even be started directly from a CD. This | ||
15 | example also demonstrates how to transfer data using usbFunctionWrite() and | ||
16 | usbFunctionRead(). | ||
17 | |||
18 | |||
19 | PREREQUISITES | ||
20 | ============= | ||
21 | Target hardware: You need an AVR based circuit based on one of the examples | ||
22 | (see the "circuits" directory at the top level of this package), e.g. the | ||
23 | metaboard (http://www.obdev.at/goto.php?t=metaboard). | ||
24 | |||
25 | AVR development environment: You need the gcc tool chain for the AVR, see | ||
26 | the Prerequisites section in the top level Readme file for how to obtain it. | ||
27 | |||
28 | Host development environment: A C compiler and libusb on Unix. On Windows | ||
29 | you need the Driver Development Kit (DDK) Instead of libusb. MinGW ships | ||
30 | with a free version of the DDK. | ||
31 | |||
32 | |||
33 | BUILDING THE FIRMWARE | ||
34 | ===================== | ||
35 | Change to the "firmware" directory and modify Makefile according to your | ||
36 | architecture (CPU clock, target device, fuse values) and ISP programmer. Then | ||
37 | edit usbconfig.h according to your pin assignments for D+ and D-. The default | ||
38 | settings are for the metaboard hardware. | ||
39 | |||
40 | Type "make hex" to build main.hex, then "make flash" to upload the firmware | ||
41 | to the device. Don't forget to run "make fuse" once to program the fuses. If | ||
42 | you use a prototyping board with boot loader, follow the instructions of the | ||
43 | boot loader instead. | ||
44 | |||
45 | Please note that the first "make hex" copies the driver from the top level | ||
46 | into the firmware directory. If you use a different build system than our | ||
47 | Makefile, you must copy the driver by hand. | ||
48 | |||
49 | |||
50 | BUILDING THE HOST SOFTWARE | ||
51 | ========================== | ||
52 | Make sure that you have libusb (on Unix) or the DDK (on Windows) installed. | ||
53 | We recommend MinGW on Windows since it includes a free version of the DDK. | ||
54 | Then change to directory "commandline" and run "make" on Unix or | ||
55 | "make -f Makefile.windows" on Windows. | ||
56 | |||
57 | |||
58 | USING THE COMMAND LINE TOOL | ||
59 | =========================== | ||
60 | The device implements a data store of 128 bytes in EEPROM. You can send a | ||
61 | block of 128 bytes to the device or read the block using the command line | ||
62 | tool. | ||
63 | |||
64 | To send a block to the device, use e.g. | ||
65 | |||
66 | hidtool write 0x01,0x02,0x03,0x04,... | ||
67 | |||
68 | and to receive the block, use | ||
69 | |||
70 | hidtool read | ||
71 | |||
72 | |||
73 | ---------------------------------------------------------------------------- | ||
74 | (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH. | ||
75 | http://www.obdev.at/ | ||