Micrium provides a demo application that lets you test and evaluate the class implementation. Source template files are provided for the device. Executable and source files are provided for Windows host PC.
Note that the demo application provided by Micriµm is only an example and is intended to be used as a starting point to develop your own application.
Configuring PC and Device Applications
The HID class provides two demos:
- Mouse demo exercises Input reports sent to the host. Each report gives periodically the current state of a simulated mouse.
- Vendor-specific demo exercises Input and Output reports. The host sends an Output report or receives an Input report according to your choice.
On the device side, the demo application file, app_usbd_hid.c
, offering the two HID demos is provided for µC/OS-II and µC/OS-III. It is located in this folder:
\Micrium\Software\uC-USB-Device-V4\App\Device\
The use of these constants usually defined in app_cfg.h
or app_usbd_cfg.h
allows you to use one of the HID demos.
On the Windows side, the mouse demo influences directly the cursor on your monitor while the vendor-specific demo requires a custom application. The latter is provided by a Visual Studio solution located in this folder:
\Micrium\Software\uC-USB-Device-V4\App\Host\OS\Windows\HID\Visual Studio 2010
The solution HID.sln
contains two projects:
- “HID - Control” tests the Input and Output reports transferred through the control endpoints. The class-specific requests
GET_REPORT
andSET_REPORT
allows the host to receive Input reports and send Output reports respectively. - “HID - Interrupt” tests the Input and Output reports transferred through the interrupt IN and OUT endpoints.
An HID device is defined by a Vendor ID (VID) and Product ID (PID). The VID and PID will be retrieved by the host during the enumeration to build a string identifying the HID device. The “HID - Control” and “HID - Interrupt” projects contain both a file named app_hid_common.c
. This file declares the following local constant:
Running the Demo Application
The mouse demo does not require anything on the Windows side. You just need to plug the HID device running the mouse demo to the PC and see the screen cursor moving.
presents the mouse demo with the host and device interactions:
The vendor-specific demo requires you to launch a Windows executable. Two executables are already provided in the following folder:
\Micrium\Software\uC-USB-Device-V4\App\Host\OS\Windows\HID\Visual Studio 2010\exe\
The two executables have been generated with a Visual Studio 2010 project available in \Micrium\Software\uC-USB-Device-V4\App\Host\OS\Windows\HID\Visual Studio 2010\
.
- HID - Control.exe for the vendor-specific demo utilizing the control endpoints to send Output reports or receive Input reports.
- HID - Interrupt.exe for the vendor-specific demo utilizing the interrupt endpoints to send Output reports or receive Input reports.
presents the vendor-specific demo with the host and device interactions:
and show screenshot examples corresponding to HID - Control.exe and HID - Interrupt.exe respectively.