Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nephirus
committed
Sep 18, 2012
1 parent
9e599e4
commit 8f0ee99
Showing
38 changed files
with
9,364 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
This is the Readme file for the hid-data example. In this example, we show | ||
how blocks of data can be exchanged with the device using only functionality | ||
compliant to the HID class. Since class drivers for HID are included with | ||
Windows, you don't need to install drivers on Windows. | ||
|
||
|
||
WHAT IS DEMONSTRATED? | ||
===================== | ||
This example demonstrates how the HID class can be misused to transfer fixed | ||
size blocks of data (up to the driver's transfer size limit) over HID feature | ||
reports. This technique is of great value on Windows because no driver DLLs | ||
are needed (the hid-custom-rq example still requires the libusb-win32 DLL, | ||
although it may be in the program's directory). The host side application | ||
requires no installation, it can even be started directly from a CD. This | ||
example also demonstrates how to transfer data using usbFunctionWrite() and | ||
usbFunctionRead(). | ||
|
||
|
||
PREREQUISITES | ||
============= | ||
Target hardware: You need an AVR based circuit based on one of the examples | ||
(see the "circuits" directory at the top level of this package), e.g. the | ||
metaboard (http://www.obdev.at/goto.php?t=metaboard). | ||
|
||
AVR development environment: You need the gcc tool chain for the AVR, see | ||
the Prerequisites section in the top level Readme file for how to obtain it. | ||
|
||
Host development environment: A C compiler and libusb on Unix. On Windows | ||
you need the Driver Development Kit (DDK) Instead of libusb. MinGW ships | ||
with a free version of the DDK. | ||
|
||
|
||
BUILDING THE FIRMWARE | ||
===================== | ||
Change to the "firmware" directory and modify Makefile according to your | ||
architecture (CPU clock, target device, fuse values) and ISP programmer. Then | ||
edit usbconfig.h according to your pin assignments for D+ and D-. The default | ||
settings are for the metaboard hardware. | ||
|
||
Type "make hex" to build main.hex, then "make flash" to upload the firmware | ||
to the device. Don't forget to run "make fuse" once to program the fuses. If | ||
you use a prototyping board with boot loader, follow the instructions of the | ||
boot loader instead. | ||
|
||
Please note that the first "make hex" copies the driver from the top level | ||
into the firmware directory. If you use a different build system than our | ||
Makefile, you must copy the driver by hand. | ||
|
||
|
||
BUILDING THE HOST SOFTWARE | ||
========================== | ||
Make sure that you have libusb (on Unix) or the DDK (on Windows) installed. | ||
We recommend MinGW on Windows since it includes a free version of the DDK. | ||
Then change to directory "commandline" and run "make" on Unix or | ||
"make -f Makefile.windows" on Windows. | ||
|
||
|
||
USING THE COMMAND LINE TOOL | ||
=========================== | ||
The device implements a data store of 128 bytes in EEPROM. You can send a | ||
block of 128 bytes to the device or read the block using the command line | ||
tool. | ||
|
||
To send a block to the device, use e.g. | ||
|
||
hidtool write 0x01,0x02,0x03,0x04,... | ||
|
||
and to receive the block, use | ||
|
||
hidtool read | ||
|
||
|
||
---------------------------------------------------------------------------- | ||
(c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH. | ||
http://www.obdev.at/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Name: Makefile | ||
# Project: hid-data example | ||
# Author: Christian Starkjohann | ||
# Creation Date: 2008-04-11 | ||
# Tabsize: 4 | ||
# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH | ||
# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) | ||
# This Revision: $Id$ | ||
|
||
# Please read the definitions below and edit them as appropriate for your | ||
# system: | ||
|
||
# Use the following 3 lines on Unix and Mac OS X: | ||
USBFLAGS= `libusb-config --cflags` | ||
USBLIBS= `libusb-config --libs` | ||
EXE_SUFFIX= | ||
|
||
# Use the following 3 lines on Windows and comment out the 3 above: | ||
#USBFLAGS= | ||
#USBLIBS= -lhid -lusb -lsetupapi | ||
#EXE_SUFFIX= .exe | ||
|
||
CC= gcc | ||
CFLAGS= -O -Wall $(USBFLAGS) | ||
LIBS= $(USBLIBS) | ||
|
||
OBJ= hidtool.o hiddata.o | ||
PROGRAM= hidtool$(EXE_SUFFIX) | ||
|
||
all: $(PROGRAM) | ||
|
||
$(PROGRAM): $(OBJ) | ||
$(CC) -o $(PROGRAM) $(OBJ) $(LIBS) | ||
|
||
strip: $(PROGRAM) | ||
strip $(PROGRAM) | ||
|
||
clean: | ||
rm -f $(OBJ) $(PROGRAM) | ||
|
||
.c.o: | ||
$(CC) $(ARCH_COMPILE) $(CFLAGS) -c $*.c -o $*.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Name: Makefile.windows | ||
# Project: hid-data example | ||
# Author: Christian Starkjohann | ||
# Creation Date: 2008-04-11 | ||
# Tabsize: 4 | ||
# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH | ||
# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) | ||
# This Revision: $Id$ | ||
|
||
# You may use this file with | ||
# make -f Makefile.windows | ||
# on Windows with MinGW instead of editing the main Makefile. | ||
|
||
include Makefile | ||
|
||
USBFLAGS= | ||
USBLIBS= -lhid -lsetupapi | ||
EXE_SUFFIX= .exe |
Oops, something went wrong.