The HID Page

For developers of USB devices in the human interface device (HID) class.
Basics | Tools | My example code | Other code

Basics

My HID FAQ.
HID webpage from the USB-IF.

Windows programming



You can use Windows' built-in HID (human interface device) drivers to communicate with devices that conform to the USB's HID class specification. There's no need for a custom driver; the device uses the drivers included in Windows. Use any programming language that supports calling API functions. The device doesn't have to have a "human interface." Any device that can function within the limits of the HID specification (control and interrupt transfers only) may be able to be designed as a HID.
Microsoft's WDK has documentation for the HID functions and an overview of how to use them. The WDK also includes the header files to use with Visual C++ programs that access HID-class devices (hidsdi.h, hidusage.h, hidpi.h).
Human Input Devices. The Windows HID API from Microsoft.
Microsoft's DirectX technology includes DirectInput, which supports communications with HID-class game controllers (in both directions, in spite of the name), without requiring custom drivers. Microsoft's DirectX Developer Center has the latest info.
Use Raw Input to read data from a specific keyboard, mouse, or game controller.
A Usenet discussion about using HIDs under Windows CE. For other posts on this topic, search the newsgroups microsoft.public.windowsce* from groups.google.com/advanced_search.

Articles

HIDs Up by Jan Axelson, Embedded Systems Programming. From Embedded Systems Programming.
Using the HID class eases the job of writing USB device drivers by Stuart Allman. From EDN.
Making USB C# friendly. Article by Ashley Deakin in VSJ.

Books

USB Complete includes three chapters on HID firmware and application programming.
Chapter 13: Human Interface Devices. From Programming the Microsoft Windows Driver Model, Second Edition by Walter Oney.

Tools

Software

HIDMaker creates device firmware and a Windows application from information you provide. Also available are the AnyHID test program and the USBWatch software-only protocol analyzer. From Trace Systems Inc.
The SimpleHIDWrite utility tests HID-class devices. The HidTest utility also tests HIDs with a variety of API calls. HidTest.zip contains the application and HidTestSource.zip contains the source files in Delphi. All from Robert Marquardt.
Robert Marquardt's HID Controller component suite for Delphi.
USB HID API Function Library. From Kadtronix.
HID API for Linux, Mac OS X, and Windows. From Alan Ott.
USB HID driver for Windows. From embedded24.net.
YAT: USB HID based serial communication. From Matthias.

Hardware

MouseWarrior, KeyWarrior, JoyWarrior, IO-Warrier, and IO-Warrior 24PowerVampire (for using USB as a power supply). Available as programmed chips or kits. From Code Mercenaries.

My example code

Host applications and device firmware to work with them. Thank you to everyone who has helped by contributing bug reports and often the fixes along with them.

Host applications

My HID applications below communicate with generic (custom) HIDs. Each supports exchanging Input, Output, and Feature reports and shows how to search for devices that use a particular interface GUID. All except the Visual Basic 6 code show how to use RegisterDeviceNotification and WM_DEVICE_CHANGE messages to detect when a device is attached or removed.

Visual Basic .NET

generic_hid_vb. Created with Visual Studio 2008 for the .NET Framework 2.0 or later. Updated 4/1/11.

Visual C# (C Sharp)

generic_hid_cs. Created with Visual Studio 2008 for the .NET Framework 2.0 or later. Updated 4/1/11.
usbhidio_V2.3.cs. My VB HIDClass application ported to C#. From Gordon Vance. (Bug report: change: if (MyEnvironment.Version >= Version98SE) to if (MyEnvironment.Version <= Version98SE).

Visual Basic 6

Usbhidio2

Visual C++ 6

Usbhidio_vc6. This project will load into and run in Visual Studio. The project requires the header files hid.lib, hid.h, and hidsdi.h from the WDK.
1. If you get this errror on attempting to compile:
DBT_DEVTYP_DEVICEINTERFACE, PDEV_BROADCAST_DEVICEINTERFACE, HDEVNOTIFY, DEVICE_NOTIFY_WINDOW_HANDLE undeclared
Set WINVER = 0x0500 or higher in stdafx.h
For more info, go to groups.google.com and search on:
"DEV_BROADCAST_DEVICEINTERFACE" "undeclared identifier"
2. HidD_GetInputReport and HidD_SetInputReport require Windows XP or later.

Linux

Generic HID example using libusb-1.0.

Generic HID device firmware

HID firmware for communicating with the Windows host code above.

Microchip PIC18F4550

pic_usb_device_hid_generic_10.zip is is my Microchip PIC microcontroller firmware for generic HIDs. Written for the PIC 18F4550 and Microchip's MPLAB C18 compiler with the Microchip Application Libraries V2.6a. See the readme file to find out how to create the project in the Framework directory structure. (The Framework includes a HID example, but my code also supports vendor-defined control transfers.) Updated 4/22/10.

Older versions

Use the newest Framework and firmware unless you have a compelling reason not to.
For the Framework V2.5. generic_hid_fsusb_fw2-5.zip
For the Framework V2.3. Generic_HID_c18_fsusb_fwv2-3.zip
For the Framework. V2.1. Generic_HID_C18_FSUSB
For the Framework V1.x. mchpfsusb_ghid.zip

Cypress Semiconductor EZ-USB FX2

fx2hid.zip runs on Cypress' FX2 EZ-USB chips at full and high speeds. It's adapted from Cypress' frameworks examples and requires the full version of the Keil C compiler.

Cypress Semiconductor Encore

Enchid.zip for Cypress Encore chips (CY637xx). Assembly code.

Cypress Semiconductor EZ-USB

fwhid.zip for Cypress EZ-USB chips. In C. More information.

Cypress Semiconductor EZ-USB Buttons and Lights

A version of John Hyde's buttons and lights code for the USBSimm module. (The module is no longer available.) My code supports interrupt Out transfers for Output reports.

Cypress Semiconductor CY63000

Usbhidio.zip (61k) contains assembly-code firmware and host software for communicating with a Cypress CY7C63000 microcontroller (obsolete). The code runs on Cypress' 3650 Developer's Kit and CY3640 Starter Kit. Cypress has discontinued the Starter Kit. The Hi-Lo EPROM programmer included in the Starter Kit was Cypress part CY3649. The host software is Visual Basic 6 code. Bug list and fixes for usbhidio.

Cypress Semiconductor CY63000 firmware plus Visual Basic code using an ActiveX Exe server

HIDDemo2.zip (70k) is an enhanced version of usbhidio. Like usbhidio that uses an ActiveX Exe server to handle reading from the device.

Other code

Code from other sources.

Device firmware for use with my .NET HID applications

These firmware examples are designed to work with my PC HID applications above.

Cypress Semiconductor 66113

Hidhub1.zip contains a version of my generic HID-class firmware for Cypress' CY7C66113 hub & peripheral chip. The firmware enumerates as a compound device made up of a 4-port hub and my usbhidio device. It runs on the 3652 development kit and will communicate with my hidvb and usbhidioc software. This code is provided by Mat Laibowitz.

Microchip PIC

Firmware for the PIC16C745/765 to enable using my HID .NET and usbhidioc software. From Microchip. For more PIC advice, see USB and PIC Microprocessors 16C745 and 18F2455 from Alan Macek.
Assembly code and C firmware for the PIC16C745 and PIC18F2455. From Bradley A. Minch at Olin College
The PICBasic Pro Basic compiler includes instructions to perform HID communications, for use with PICMicros with USB support. From microEngineering Labs Inc.
My Very First USB Peripheral. A description of a PIC16C745 HID project. From Technology Stir Fry.

More HID firmware

Atmel

Atmel's AT90USBKey demonstration board for the AT90USB AVR microcontroller has generic HID, keyboard, and mouse applications.
Automator is a HID project for the Atmel AVR-USB. Includes host code. From Objective Development Software.

Cypress Semiconductor

Example HID Firmware in C for Cypress enCoRe devices. From Stephen Santarelli.
John Hyde's USB Design By Example site has HID examples in Visual Basic and Visual C++. I have a version of the buttons and lights firmware that supports interrupt Out transfers.
The MO1002 USB to UART is a HID device that translates between asynchronous serial data and USB using Windows' HID drivers. Includes schematics, firmware, and a Visual C++ application. The chip used is Cypress' CY7C63001. From Moto Development Group.

Microchip

Microchip's USB Framework firmware includes HID examples..
FMSUSB is a RC(PPM) to FMS (Flying Model Simulator) USB interface. Uses a PIC16C745. From Walter Zanette.
A firmware-only HID (no hardware device controller) using a Microchip 16F84A to control a parallel LCD module (HD44780 compatible) via USB. (Spanish)

ST-Ericsson (formerly NXP Semiconductors/Philips)

Interfacing a Game Boy Advance to a PC using a PIC16F877 and PDIUSBD12. From Rob Meerman.

Host code

HID USB Driver / Library. A C# DLL. From Florian Leitner.
USB Hid Device Library for .NET. From Mike O'Brien.
HID component for C# .NET. A project from the Avans Hogeschool in The Netherlands.
Controlling the Logitech iFeel Mouse. Experiments with force feedback. Daniel C. Moore

1 comment:

  1. custom hids very nice blog to i have found to read and to get in sequence for my hid lights so i would like to thank you dear for sharing it with us so nicely so keep it
    up dear

    ReplyDelete

Labels

PROJECTS 8086 PIN CONFIGURATION 80X86 PROCESSORS TRANSDUCERS 8086 – ARCHITECTURE Hall-Effect Transducers INTEL 8085 OPTICAL MATERIALS BIPOLAR TRANSISTORS INTEL 8255 Optoelectronic Devices Thermistors thevenin's theorem MAXIMUM MODE CONFIGURATION OF 8086 SYSTEM ASSEMBLY LANGUAGE PROGRAMME OF 80X86 PROCESSORS POWER PLANT ENGINEERING PRIME MOVERS 8279 with 8085 MINIMUM MODE CONFIGURATION OF 8086 SYSTEM MISCELLANEOUS DEVICES MODERN ENGINEERING MATERIALS 8085 Processor- Q and A-1 BASIC CONCEPTS OF FLUID MECHANICS OSCILLATORS 8085 Processor- Q and A-2 Features of 8086 PUMPS AND TURBINES 8031/8051 MICROCONTROLLER Chemfet Transducers DIODES FIRST LAW OF THERMODYNAMICS METHOD OF STATEMENTS 8279 with 8086 HIGH VOLTAGE ENGINEERING OVERVOLATGES AND INSULATION COORDINATION Thermocouples 8251A to 8086 ARCHITECTURE OF 8031/8051 Angle-Beam Transducers DATA TRANSFER INSTRUCTIONS IN 8051/8031 INSTRUCTION SET FOR 8051/8031 INTEL 8279 KEYBOARD AND DISPLAY INTERFACES USING 8279 LOGICAL INSTRUCTIONS FOR 8051/8031 Photonic Transducers TECHNOLOGICAL TIPS THREE POINT STARTER 8257 with 8085 ARITHMETIC INSTRUCTIONS IN 8051/8031 LIGHTNING PHENOMENA Photoelectric Detectors Physical Strain Gage Transducers 8259 PROCESSOR APPLICATIONS OF HALL EFFECT BRANCHING INSTRUCTIONS FOR 8051/8031 CPU OF 8031/8051 Capacitive Transducers DECODER Electromagnetic Transducer Hall voltage INTEL 8051 MICROCONTROLLER INTEL 8251A Insulation Resistance Test PINS AND SIGNALS OF 8031/8051 Physical Transducers Resistive Transducer STARTERS Thermocouple Vacuum Gages USART-INTEL 8251A APPLICATIONs OF 8085 MICROPROCESSOR CAPACITANCE Data Transfer Instructions In 8086 Processors EARTH FAULT RELAY ELECTRIC MOTORS ELECTRICAL AND ELECTRONIC INSTRUMENTS ELECTRICAL BREAKDOWN IN GASES FIELD EFFECT TRANSISTOR (FET) INTEL 8257 IONIZATION AND DECAY PROCESSES Inductive Transducers Microprocessor and Microcontroller OVER CURRENT RELAY OVER CURRENT RELAY TESTING METHODS PhotoConductive Detectors PhotoVoltaic Detectors Registers Of 8051/8031 Microcontroller Testing Methods ADC INTERFACE AMPLIFIERS APPLICATIONS OF 8259 EARTH ELECTRODE RESISTANCE MEASUREMENT TESTING METHODS EARTH FAULT RELAY TESTING METHODS Electricity Ferrodynamic Wattmeter Fiber-Optic Transducers IC TESTER IC TESTER part-2 INTERRUPTS Intravascular imaging transducer LIGHTNING ARRESTERS MEASUREMENT SYSTEM Mechanical imaging transducers Mesh Current-2 Millman's Theorem NEGATIVE FEEDBACK Norton's Polarity Test Potentiometric transducers Ratio Test SERIAL DATA COMMUNICATION SFR OF 8051/8031 SOLIDS AND LIQUIDS Speed Control System 8085 Stepper Motor Control System Winding Resistance Test 20 MVA 6-digits 6-digits 7-segment LEDs 7-segment A-to-D A/D ADC ADVANTAGES OF CORONA ALTERNATOR BY POTIER & ASA METHOD ANALOG TO DIGITAL CONVERTER AUXILIARY TRANSFORMER AUXILIARY TRANSFORMER TESTING AUXILIARY TRANSFORMER TESTING METHODS Analog Devices A–D BERNOULLI’S PRINCIPLE BUS BAR BUS BAR TESTING Basic measuring circuits Bernoulli's Equation Bit Manipulation Instruction Buchholz relay test CORONA POWER LOSS CURRENT TRANSFORMER CURRENT TRANSFORMER TESTING Contact resistance test Current to voltage converter DAC INTERFACE DESCRIBE MULTIPLY-EXCITED Digital Storage Oscilloscope Display Driver Circuit E PROMER ELPLUS NT-111 EPROM AND STATIC RAM EXCITED MAGNETIC FIELD Electrical Machines II- Exp NO.1 Energy Meters FACTORS AFFECTING CORONA FLIP FLOPS Fluid Dynamics and Bernoulli's Equation Fluorescence Chemical Transducers Foil Strain Gages HALL EFFECT HIGH VOLTAGE ENGG HV test HYSTERESIS MOTOR Hall co-efficient Hall voltage and Hall Co-efficient High Voltage Insulator Coating Hot-wire anemometer How to Read a Capacitor? IC TESTER part-1 INSTRUMENT TRANSFORMERS Importance of Hall Effect Insulation resistance check Insulator Coating Knee point Test LEDs LEDs Display Driver LEDs Display Driver Circuit LM35 LOGIC CONTROLLER LPT LPT PORT LPT PORT EXPANDER LPT PORT LPT PORT EXTENDER Life Gone? MAGNETIC FIELD MAGNETIC FIELD SYSTEMS METHOD OF STATEMENT FOR TRANSFORMER STABILITY TEST METHODS OF REDUCING CORONA EFFECT MULTIPLY-EXCITED MULTIPLY-EXCITED MAGNETIC FIELD SYSTEMS Mesh Current Mesh Current-1 Moving Iron Instruments Multiplexing Network Theorems Node Voltage Method On-No Load And On Load Condition PLC PORT EXTENDER POTIER & ASA METHOD POWER TRANSFORMER POWER TRANSFORMER TESTING POWER TRANSFORMER TESTING METHODS PROGRAMMABLE LOGIC PROGRAMMABLE LOGIC CONTROLLER Parallel Port EXPANDER Paschen's law Piezoelectric Wave-Propagation Transducers Potential Transformer RADIO INTERFERENCE RECTIFIERS REGULATION OF ALTERNATOR REGULATION OF THREE PHASE ALTERNATOR Read a Capacitor SINGLY-EXCITED SOLIDS AND LIQUIDS Classical gas laws Secondary effects Semiconductor strain gages Speaker Driver Strain Gages Streamer theory Superposition Superposition theorem Swinburne’s Test TMOD TRANSFORMER TESTING METHODS Tape Recorder Three-Phase Wattmeter Transformer Tap Changer Transformer Testing Vector group test Virus Activity Voltage Insulator Coating Voltage To Frequency Converter Voltage to current converter What is analog-to-digital conversion Windows work for Nokia capacitor labels excitation current test magnetic balance voltage to frequency converter wiki electronic frequency converter testing voltage with a multimeter 50 hz voltages voltmeter

Search More Posts

Followers