AN249 Silicon_Laboratories, AN249 Datasheet - Page 21

no-image

AN249

Manufacturer Part Number
AN249
Description
Human Interface Device Tutorial
Manufacturer
Silicon_Laboratories
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN2490NFHP
Manufacturer:
PANASONIC/松下
Quantity:
20 000
Part Number:
AN2491NFHP
Manufacturer:
PANASON
Quantity:
5 510
Part Number:
AN2491NFHP
Manufacturer:
MAXIM
Quantity:
5 510
6. CHIDDeviceclass Object Class
The files HIDDevice.cpp and HIDDevice.h define an object that can be declared and associated with an HID-class
device. Host-side applications can communicate with HID-class devices using the following member functions
included with this class:
GetConnectedDeviceNum()
GetSerialString()
Open()
IsOpened()
SetFeatureReport()
GetFeatureReport()
SetReport_Interrupt()
GetReport_Interrupt()
SetReport_Control()
GetReport_Control()
GetInputReportBufferLength()
GetOutputReportBufferLength()
GetFeatureReportBufferLength()
GetMaxReportRequest()
FlushBuffers()
The following sections describe how to use the CHIDDeviceclass.
6.1. Using The Class
To use the CHIDDeviceclass, the file HIDDevice.cpp must be added to the host application's build, and files using
the class must include the HIDDevice.h header file.
The object requires that the Windows DDK has been installed on the developer's system. Please contact Microsoft
for a copy of the DDK. After the DDK is installed, the following modifications must be made to the host application
project before the HID device class will function properly:
6.2. GetConnectedDeviceNum
Description:
Prototype:
Parameters:
Return Value:
In the project's properties' list of included directories, the following two directories must be added to the "Include
files" list: C:\WINDDK\3790.1830\inc\wxp and C:\WINDDK\3790.1830\inc\crt
In the project's properties' list of included directories, the following directory must be added to the "Library files"
list: c:\WINDDK\3790.1830\lib\wxp\i386
In the properties' Linker list of input sources, the following two files must be added to the "Additional
Dependencies" list: setupapi.lib and hid.lib
This function returns the number of devices found on the USB that have PIDs and
DWORD GetConnectedDeviceNum(WORD vid, WORD pid)
1. vid - device VID used in search.
Number of devices with matching vid and pid attached to the USB
VIDs matching the function's input parameters
2. pid - device PID used in search.
- Returns number of device connected
- Retrieves a string from device
- Initiates communication
- Shows whether device is connected
- Sends feature report
- Receive feature report
- Send OUT report
- Receive IN report
- Send OUT report
- Receive IN report
- Returns size of biggest input report
- Returns size of biggest output report
- Returns size of biggest feature report
- Number of reports that can be retrieved
- Clear all of the object's buffers
Rev. 0.2
AN249
21

Related parts for AN249