MDK-ARM Keil, MDK-ARM Datasheet - Page 133

KIT REALVIEW MCU DEVELOPMENT

MDK-ARM

Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Datasheets

Specifications of MDK-ARM

For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Getting Started: Building Applications with RL-ARM
133
HID Client
Once the USB firmware has been configured on the microcontroller, it will
enumerate with the host. It can then begin to transfer data to and from the
Windows HID driver. The next task is to access the relevant HID driver from an
application program running on the host. Access to the HID driver is made
through Win32 API calls. This can be complicated if you are not used to host
programming. However, the source code for a complete HID client application is
located in
. The client HID can be rebuilt with
C:\KEIL\ARM\UTILITIES\HID_CLIENT
Visual C++. You will also need the Microsoft Driver Development Kit, which
can be downloaded from the Microsoft web site. To make life easy, all of the
necessary Win32 API calls have been placed in wrapper functions in the
HID.c
module. This allows them to be easily reused to build a new custom client.
When a new device is attached to the USB network, it enters the enumeration
process with the USB host, identifying itself as an HID device. On a host, this
causes the Windows operating system to load a new instance of its HID driver.
The HID driver is created with a new Globally Unique Identifier (GUID). This is
a 128-bit number identifying the type of object and its access control. When a
HID client is started on the host, it can examine the current Windows system for
running HID drivers.
HID_Init ();
int HID_FindDevices ();
The first two functions are used to initialize the HID client and clear the list of
attached devices. Next, the HID_FindDevices() function builds a list of currently
connected HID devices and their capabilities. The results of this function call are
held in a set of structures. By examining the data held in these structures, you
can locate your device from its VendorID and ProductID or other unique feature.
BOOL HID_GetName (int num, char *buf, int sz);
For a more general purpose, the product strings can be read by calling the
HID_GetName() function. The product string data can be displayed in the client,
allowing the user to make the selection.
BOOL HID_Open (int num);
Once an HID device has been selected, the HID_Open() function is used to
connect the client to the HID driver. This is done using the Win32 CreateFile()
API call.

Related parts for MDK-ARM