(deutsch)

embedded24.net - USB HID Host driver for Windows
USB HID devices are widely used in control and electronics in general. There are many microcontrollers from many manufacturers with build in USB support. The needful firmware for the devices is provided by the manufacturers. But on the Host side, it is still hard to develop a driver. Stop wracking your brain and start using AHID Dynamic Link Library - a simple way to interface USB HID devices!
Functions
- AHid_Init(): Driver initialization.
- AHid_Register(): Interface registration.
- AHid_Deregister(): Remove from registration.
- AHid_Write(): Write data.
- AHid_Read(): Read data.
- AHid_Request(): Request a Feature Report.
- AHid_Attached(): Device connected or removed?
- AHid_Find(): Find the device.
- AHid_Info(): Show an info box.
Concept
The AHID Dynamic Link Library is initialized by a call to AHid_Init(). Then, the
AHid_Register() function creates an interface used for transfers from and to the USB device.
AHid_Write() sends data from host to device. This is done using Interrupt or Control (Feature Reports)
transfers (depending on the settings in AHid_Register()).

Figure: Transfer between USB-Device and Host-Application
Data is received by a call to AHid_Read(). When using Interrupt transfers, an additional thread will be
started to catch the incoming data. After data reception, a RECEIVED message is send to the main window
where you can collect it using AHid_Read(). The reception of Feature Reports is an active task. You request
a Report Feature with the AHid_Request() function. When the data has arrived, another RECEIVED message was sent and
you can call AHid_Read() to get it. That approach keeps the system consistent. All data is received
in the same message loop by AHid_Read() (no matter about the transfer type). The implementation of a state
machine is much easier.
The AHid_Attached() function is called after a CHANGE message. The return value indicates the device
state (connected/disconnected). AHid_Find() is quite similar. It searches the USB device and returns true
when detected.
AHid_Info() has no function in normal operation. It simply displays a message box with some information
about the AHID Dynamic Link Library.

Figure: Transfer between USB-Device and Host-Application
Features
- HID USB Host Driver DLL for Windows
- Use with C++, C++/CLI, C#, VB and more
- Support of 32 and 64 Bit Windows
- Can be used with Composite Devices
- Including automatic Device Detection
- Multithreaded Approach for non blocking Data Transfer
- Based on Windows Messaging System
- To use with Input, Output and Feature Reports
- Allows different Report Id's
- Recommended for low and high Throughput
- Very high Data Rate with up to 64 kBytes/s
- Demo Applications for C++/CLI, C# and VB available