Jan Axelson's Lakeview Research

Home > USB Central > The HID Page > HID Frameworks Code

HID code
using frameworks for the EZ-USB

This is the readme file for fwhid.zip. Fwhid is HID firmware for Cypress Semiconductors' EZ-USB chip. The code is based on Cypress' frameworks C code and is available from Lakeview Research at http://www.lvr.com.

About the code

I developed the firmware using Keil's C compiler and uVision V1.32. The firmware is an adaptation of Cypress' bulktest example. The code requires the full (not evaluation) version of the C compiler.

The firmware defines the device as a member of the human-interface device (HID) class. It enables the device to send and receive 2 bytes of generic data. The code works with the usbhidio application available from www.lvr.com.

These are the major changes I made to the bulktest code:

  • In dscr.a51, the class in the interface descriptor is HID, and I added a HID descriptor, a report descriptor, and two interrupt endpoint descriptors.
  • In fw.c, I added code to enable the host to retrieve the report descriptor.
  • In periph.c, I adapted the code to enable the HID endpoints to send and receive data.
  • Dscr.h and ezsub.h have additions required for the above changes.

I left the rest of the code intact, even though some of it (such as code for the other endpoints) is unused.

I surrounded each change or addition to the code with the following comments:

//HID code start

//Hid code end

To avoid problems with paths, I recommend copying the program files to a new folder in the same location used for the other EZ-USB examples. (The default is Anchor\EzUsb\Examples).

Limitations

This version of the code has limitations:

  • The host must be running Win98SE , Win2K, or later. This is because the code uses interrupt transfers for both In and Out reports. Windows 98 gold (original) supports only HID 1.0 and thus uses control transfers for Out reports.
  • The code supports only one report (report 0).
  • The code doesn't support Feature reports.

 

Partner Links

Embedded Programming
Experts in embedded software development. Microchip Certified Consults.
absolute-software.co.uk

USB Protocol Analyzers
ELLISYS protocol analyzers, generators, automated compliance solutions.
www.ellisys.com

USBTrace - USB Analyzer
Software-based USB Protocol Analyzer. Easy-to-use and affordable.
www.sysnucleus.com

Powerful USB Analyzer
Real-time USB 2.0 display & class decoding. See a video demo now.
www.totalphase.com

USB to Ethernet Connector
Share & access USB devices over local network or even Internet!
www.eltima.com

USB Duplicator
Copy up to 77 USB Drives at once with a stand-alone USB Duplicator.
www.premiumusb.com

Creative Promo USB Drives
Custom designed promotional drives w/ branded printing and duplication.
www.CreativeUSB.com