Programming simple USB devices in Delphi. Book: USB interface (practice of use and programming)

The book contains the information necessary to create USB devices and drivers for the operating system
Microsoft Windows 2000/XP. The process of creating a USB device is considered: from writing a microcontroller program
(example implemented for microprocessor AT89C5131) before the actual development WDM-drivers. Contained
description of special device classes: HID class, which eliminates the need for driver development, and
CDC class, which allows you to work with USB as with a regular COM port. The use of functions is considered
Raw Input, Direct Input and Setup API, contained a large number of practical advice and examples
programs in Delphi, C and C#. For the convenience of readers, everything source codes are given in the attached
CD.

The book is a continuation of the 2004 book ""
The basis of the book is mainly the questions readers had while reading the first book.
In addition, some features that can be added to the operating room are considered. Windows system XP,
significantly simplify the work with the USB interface. The DirectX Reader feature will also be discussed
HID device data - function class DirecInput

Who is this book for?
This book is intended for practicing programmers.
It does not contain information about USB hardware, but is entirely devoted to questions
programming.

Book Title: USB Programming Practice
Author: Agurov Pavel Vladimirovich
Year of release: 2006
Edition: BHV-Petersburg
Number of pages: 624
File format: DjVu
File size: 6.1 MB

Content
Introduction
Part 1. General information about USB
Chapter 1.USB Specification
Chapter 2. Programming in C for a microcontroller
Chapter 3.Tools
Chapter 4. Principles of using Win32 functions in .NET
Part 2 USB Classes
Chapter 5. CDC Class
Chapter 6.HID Class
Chapter 7. Other USB classes
Part 3: USB Programming Practice
Chapter 8.Creating a USB device based on the AT89C5131
Chapter 9 Implementing the CDC Class
Chapter 10. Implementing the HID Class
Chapter 11. Special Windows features
Chapter 12.Driver Development
Part 4 Handbook
Chapter 13.INF file format.
Chapter 14. Basic functions Windows
Chapter 15. Windows Structures and Functions for Serial Ports
Chapter 16.Windows Setup API Structures and Functions
Chapter 17. Windows HID API Structures and Functions
Applications.

But it’s not enough just to physically connect the device to the computer, you also need to establish data exchange between them. How to choose a port and organize a connection? A few years ago, the standard solution was to use a COM port. By the way, various specialists are still installing 8, 16, or even 32 COM ports on industrial computers (there are whole category various PCI serial expansion cards, controllers, etc.). Thus, if you need to connect several external devices with an RS-232 interface, you may need expensive adapters and exotic expansion cards, which, according to the old tradition, travel to Russia by ship for weeks. By the way, the name of a regular adapter “DB9m/DB25f adapter” can only cause irritation for a computer store manager.

What is an HID device

Nowadays, almost all devices are connected to a computer via a USB interface. Therefore, many new PCs do not have a COM port at all.

USB interface - standard solution to pair a new external device with a computer, more precisely, it is an HID interface based on USB protocol 1.1.

Although many people think that the HID (Human Interface Device) interface is intended solely for the keyboard, mouse and joystick, it is suitable for many solutions related to pairing external devices with a computer.

If the user needs to carry out low-speed data exchange (up to 64 kbit/s) and at the same time wants to reduce the time on tedious development of his own drivers, then HID is quite suitable for him. The output will be simple and completely modern solution based on a standard USB software interface with guaranteed support on all common software platforms.

HID Device Properties

From the point of view of organizing software support for an HID device, everything looks quite attractive: to work under Windows control you can quickly create understandable, compact code based on ready-made, proven algorithms. At the same time, the developer will have a lot of time to implement his own data exchange protocol top level, since the necessary level of abstraction is already organized through the HID protocol (see table). In addition, it is easy for a programmer to debug a written exchange protocol (of course, if there is a working HID device) - due to the relative rigidity of the protocol itself, it is enough to simply develop a computer support program for the device. Still would! The creator of the HID device has already taken on a lot of work.

Organization of data exchange between the HID device and the computer

To describe the interaction of an HID device with a computer, we will use the term “host”. In this case, it means control device in the general physical architecture of interaction via the USB protocol. So, all ports on a computer are hosts. You can connect to them various USB devices(flash drives, mice, webcams, cameras, etc.) that do not have a host. The host provides device discovery, connection, disconnection, configuration, as well as statistics collection and energy management.

The HID device can set its own polling frequency to determine if it contains any new data. This means that even at such a low level the programmer can trust the system, since the polling frequency and other communication parameters must be pre-set in the HID device controller program. This is how the HID protocol differs from general description USB 1.1 or USB 2.0, which does not have strict protocol requirements. However, for specific tasks requiring higher level security, it can be quite difficult to get rid of cyclic polling when almost the same blocks of data are constantly transmitted.

HID device programming features

HID devices have special descriptors. When the host determines that the device belongs to the HID class, it transfers control of it to the appropriate driver. It is assumed that further data exchange is carried out under his leadership.

In Windows, it is responsible for accessing HID devices system service HidServ. More details about the functions of requests to HID devices and other features of working with the HID driver are described in the work of P. V. Agurov “ USB interface. Practice of use and programming" (St. Petersburg: BHV-Petersburg, 2005).

Programming HID devices at the “top level”

The hard life of “application” programmers working in Pascal is made easier by the proven HID module. P.A.S. shell for hid. dll (Hid User Library - as specified in the file properties). The comments to the file indicate that it is based on the hidsdi.h and hidpi.h modules from Microsoft. And the HID file itself. PAS is part of the JEDI() package.

To work with an HID device in the Delphi for win32 environment, the TJvHidDeviceController component is used, which is a convenient global manager for accessing HID devices. And already on its basis you can get an object instance for working with a specific device.

Basic properties and events of the TJvHidDeviceController component

Let's look at the TJvHidDeviceController component in more detail. The OnArrival event is triggered when an HID device enters (connects) to the system; access to the device is provided in the handler of this event through an instance of the TJvHidDevice class. The simple OnDeviceChange event reacts to changes in the state of the device; it only signals changes in the system. The OnDeviceData event is triggered when data arrives from one of the HID devices and passes the following to the handler: HidDev: TJvHidDevice; - the device from which the data was received;

The OnDeviceDataError event notifies about a data transfer error by passing the HidDev parameters to the processing procedure: TJvHidDevice; - HID device and Error: DWORD; - error code. The OnDeviceUnplug event notifies that a device is removed from the list of installed ones on the system. The types of event handlers on Plug and Unplug are the same (in source text: TJvHidUnplugEvent = TJvHidPlugEvent). An object of the TJvHidDevice class corresponding to the HID device is passed to the handler.

To sequentially enumerate the HID devices available in the system by calling the Enumerate method, the OnEnumerate event is intended, i.e., in the event handler, the found devices are sequentially transferred as objects. This event is forced by the Enumerate method, which is used to “pass” existing HID devices through a handler, for example, when revising the state of HID devices at the initiative of the host (computer).

The OnRemoval event is triggered when a device is physically removed from the system and has the same handler type TJvHidUnplugEvent as for OnDeviceUnplug. The CountByProductName function returns the number of devices that match the product name specified in the argument, and CountByVendorName returns the manufacturer name specified in the argument.

Main properties and events of the TJvHidDevice class

The TJvHidDevice class is a virtual representation of a single HID device. A new object of this class can be obtained, as already mentioned, from the OnArrival or OnEnumerate event. The functionality of the TJvHidDeviceController and TJvHidDevice classes is partially duplicated, since the first of them integrates common tools for working with a set of HID devices available in the system and a mechanism for accessing one of them. A device can be uniquely identified by its SerialNumber, ProductName, and VendorName properties. To obtain information about the arrival of data using such an object, you can use the OnData event. Data is sent through the WriteFile method (in the strict sense - through a function). WriteFile is a wrapper system function WriteFile(kernel32).

To control whether the device has been removed, you should assign your own handler to the OnUnplug event. Before you start exchanging data with an HID device, you need to make sure that such exchange is possible using HasReadWriteAccess. This class even has a separate OnDataError event when a data exchange error occurs.

Now let’s look at code fragments from a “live” project that implements a test client application for organizing data exchange with a non-standard device - HID-based plastic chip cards. In the fight for realism, the author took it upon himself not to throw out “extra” technological code connections from the listings.

The ScanDevices method (Listing 1) is intended to initiate the process of searching the system for the required HID device. Most of the code, with the exception of the call to the Enumerate method, is optional and provides flexibility to the application, for example, so that the ability to work on a non-HID interface could be added to the same test program. The AddError method displays debugging information in the window while the program is running.

Listing 2 shows an OnEnumerate event handler to find the required external device. For simplicity, we will assume that the program can only work with one device of the type it needs.

Before considering the further implementation of the project, we should talk a little about the adopted top-level data exchange format, i.e., about the structure designed to be an intermediary between the methods of receiving and transmitting data and the specific problem being solved. applied task. The fact is that here the developer is given the opportunity to realize his creative abilities. Or rather, developers, because the process of creating a new protocol is very often two-way, and the first fiddle is played by the one who finds it more difficult to implement the exchange algorithm. In general, no matter what the exchange protocol is, it is always nice to make each software entity as visual and self-sufficient as possible, even at the expense of some generally accepted traditions. For The best decision- something that will be implemented in a short time with minimal connection to software environment and with great possibilities further development. Based on these principles, a top-level exchange protocol was created, where the main concept is “command”. Listing 3 shows how much the author loves string data, which has saved him more than once during debugging. software modules. How wonderful it is that we even have a String type! All protocol commands are divided into categories (classes), within which there is a command code that uniquely characterizes its purpose. The edParam parameter is used to send data to the device, and the edAnswerData parameter contains data received from the device. String type The described members of the record allow you to freely and clearly manipulate data in HEX string format. And what’s best is that the format of the described record ideologically stands somewhere in the middle between its direct purpose and the various forms of its presentation (INI, HEX, XML, etc.)

Executing the command, i.e. sending data to the device, is implemented using sending data packets 8 bytes long (Listing 4). This length is not the only solution; this choice is dictated by the requirements of the upper-level protocol and may be different in each specific case. This is, as they say, a matter of taste. The strange IsUSBMode flag in the ExecuteCommand method (Listing 5 in PC World) is left as a reminder that we may need to use a COM port or some other interface instead of working with USB. At the beginning of the sent group of data, a sync series of a randomly selected format (for example, 3E3E3E2B) is transmitted to the device, informing the device that it has completely legal data at the input. Let me remind you that in this case we're talking about not so much about HID, but about a specific top-level protocol, ideologically separated from the hardware and designed to solve special application problems.

The GetDataExecutor handler for data received from the device (a packet of 8 bytes) uses a specially created OnNewInputData event to transfer the initially processed data for further processing, indicating their old and new values ​​(Listing 6 on the “World of PC Disk”). In this way, raw data arrival events and indications for further processing are decoupled, allowing some specific algorithm to be added early on to warn against erroneous, duplicate, or unnecessary input information.

The examples presented here of working with an HID device illustrate general idea articles - the relative ease of programming non-standard HID devices using Delphi.

Good book, explains a lot. It will be useful for those who want to understand how data is transferred over the USB bus.

Introduction 1
Who is this book for: 2
What you will find in book 2
Software requirements 3
Hardware requirements 4
ABOUT program code 4
Brief description of chapters 4
Notation 6
Thanks 7
PART I. INTRODUCTION TO USB 9
Chapter 1. What is USB 11
1.1. History of USB 11
1.2. USB comparison with other interfaces 14
1.3. USB 16 Concepts
1.3.1. General architecture tires 16
1.3.2. Physical and logical architecture tires 16
1.3.3. Components of USB 18
1.3.4. USB Device Properties 18
1.3.5. Hub properties 19
1.3.6. Host properties 20
1.4. 20 USB Device Examples
1.4.1. Mouse and keyboard., 21
1.4.2. Monitors 21
1.4.3. USB-to-COM and USB-to-LPT adapters 22
1.4.4. Scanners 23
1.4.5. Modems 23
1.4.6. Speakers 24
1.4.7. Flash drives 25
1.4.8. Hubs 28
1.4.9. Measuring technology 28
1.4.10. Exotic devices 29
1.5. Network connection via USB 30
1.5.1. USB-Ethernet converter 31
1.5.2. Direct connection via USB port 31
1.6. Data transfer 31
1.6.1. Data transmission principles 32
1.6.2. Interrupt mechanism 32
1.6.3. Host adapter interfaces 32
1.6.4. DMA capability 34
1.6.5. Data transfer modes 34
1.7. Installing and Configuring USB Devices 35
1.7.1. BIOS Settings for USB 38
1.7.2. Troubleshooting 41
1.8. USB Limitations 45
1.9. If you buy a computer 46
1.9.1. HS and USB 2.0 are not the same thing! 46
1.9.2. Motherboard 47
1.9.3. Building 48
1.9.4. USB for “old” computer models 48
1.10. Online Resources for This Chapter 49
Chapter 2. USB Hardware 51
2.1. Cables and connectors 51
2.1.1. Cable types 52
2.1.2. Cable length 53
2.1.3. Connectors 53
2.2. Physical interface 55
2.2.1. Data coding 57
2.2.2. Device identification 58
2.3. Nutrition 59
2.3.1. USB power types 59
2.3.2. Energy management 60
2.3.3. Entering Low Power Mode 61
2.4. Online Resources for This Chapter 61
PART II. INTERNAL ORGANIZATION USB 63
Chapter 3. Internal organization of the bus 65
3.1. Logical communication levels 65
3.1.1. Client software level 66
3.1.2. Level system driver USB 67
3.1.3. Interface Host Controller Layer 68
3.1.4. Peripheral bus level 68
3.1.5. USB Logical Device Level 69
3.1.6. Functional level of USB device 69
3.2. Data transfer across 69 levels
3.3. Types of data transfers 71
3.4. Synchronization with isochronous transmission 73
3.5. Personnel 77
3.6. Endpoints 78
3.7. Channels 79
3.8. Packages 81
3.8.1. Format of IN, OUT, SETUP and PING marker packets 83
3.8.2. SOF 83 packet format
3.8.3. Data packet format 84
3.8.4. Acknowledgment Packet Format< 84
3.8.5. Package format SPLIT * 84
3.9. Check sum 85
3.9.1. Algorithm for calculating CRC 86
3.9.2. Software calculation of CRC 87
3.10. Transactions 90
3.10.1. Transaction types 91
3.10.2. Transaction confirmation and flow control 92
3.10.3. Transaction protocols 93
Chapter 4. Internal organization of the device 96
4.1. Requests to USB devices 96
4.1.1. Configuration package 96
4.1.2. Standard queries to devices 99
4.1.3. Device Descriptors 105
Chapter 5. Internal organization of the host and hubs 123
5.1. Hubs 123
5.1.1. Interaction of the host controller with the hub 126
5.1.2. Hub descriptor 127
5.1.3. Hub requests 129
5.1.4. Request CLEAR_HUB_FEATURE 130
5.1.5. Request CLEAR PORT_FEATURE 130
5.1.6. Request GET_BUS_STA TE 131
5.1.7. Request GET_HUB_DESCRfPTOR 131
5.1.8. Request GET_HUB_STATUS 131
5.1.9. Request GET_PORT_STA TUS 132
5.1.10. Request SET_HUB_DESCRIPTOR 134
5.1.11. Request SET_HUB_FEATURE 134
5.1.12. SET PORT FEATURE request. 134
5.2. Collaboration devices from at different speeds 135
Chapter 6. USB without PC 137
6.1. OTG 138 connectors
6.2. Types of OTG devices 138
6.3. OTG device descriptor 139
6.4. Online Resources for This Chapter 140
PART III. PROGRAMMING PRACTICE 141
Chapter 7. USB support in Windows 143
7.1. Model WDM 144
7.2. Interaction with USB driver 146
Chapter 8. HID Devices * 149
8.1. HID Device Properties 149
8.2. How to communicate with an HID device 151
8.3. Installing an HID Device 152
8.4. HID Device Identification 152
8.4.1. Identification boot devices 153
8.4.2. HID Device Configuration Descriptor 153
8.4.3. HID descriptor 154
8.4.4. Report descriptor 156
8.5. Report descriptor structure 156
8.5.1. Structure of report elements 156
8.5.2. Types of report elements 157
8.5.3. Examples of descriptors 165
8.6. HID Device Queries 168
8.6.1. GET_REPORT request. 169
8.6.2. Request SET_REPORT 169
8.6.3. GETJDLE request. 170
8.6.4. Query SETJDLE 170
8.6.5. Request GET_PROTOCOL 171
8.6.6. Request SET_PROTOCOL 171
8.7. Tools 171
8.8. Interaction with HID driver 172
Chapter 9. Introduction to WDM 181
9.1. Driver layers 183
9.2. Symbolic device names 184
9.3. WDM Driver Basic Procedures 189
9.3.1. Procedure DriverEntry 190
9.3.2. Procedure AddDevice 192
9.3.3. Procedure Unload 194
9.3.4. Driver Operating Procedures 196
9.3.5. Serving IOCTL 203 requests
9.4. Loading the driver and accessing driver procedures 209
9.4.1. Procedure for working with the driver 209
9.4.2. Driver registration 210
9.4.3. Referring to Operating Procedures 217
9.4.4. Storing the driver inside executable file 218
9.5. Driver Creation Tools 220
9.5.1. NuMega Driver Studio 220
9.5.2. Jungo WinDriver 220
9.5.3. Jungo Kernel Driver 220
Chapter 10. USB PnP Specification 221
10.1. Introduction to Plug and Play 221
10.1.1. Plug and Play Tasks and Functions 221
10.1.2. Running PnP procedure 222
10.1.3. Software components PnP 224
10.2. Plug and Play for USB 225
10.2.1. Configuring USB 226 devices
10.2.2. USB device numbering 226
10.2.3. PnP USB device identifiers 228
10.3. Getting a list of USB devices 229
10.4. INF file 234
10.4.1. INF file structure 234
10.4.2. Section Version 235
10.4.3. Section Manufacturer 237
10.4.4. Section DestinationDirs 239
10.4.5. Model Description Section 241
10.4.6. Section xxx.AddReg and xxx.DelReg. 242
10.4.7. Section xxx.LogConfig 244
10.4.8. Section xxx.CopyFiles 244
10.4.9. Section Strings 245
10.4.10. Section connections 246
10.4.11. Creating and testing INF files 247
10.4.12. Installing Devices Using an INF File 248
10.5. Registry branches for USB 249
Chapter 11. BIOS Features 251
11.1. Service BIOS 1AN 251
11.1.1. Function B101H - determining the presence of PCI BIOS 252
11.1.2. Function В102Н - search for PCI device by identifiers
device and manufacturer 253
11.1.3. Function B103H - search for PCI device by class code 254
11.1.4. Function B108N - reading configuration register (Byte) 255
11.1.5. Function VYu9N - reading the configuration register (Word) 256
11.1.6. Function B10AN - reading configuration register (DWord) 256
11.1.7. Function В10ВН - write configuration register (Byte) 257
11.1.8. Function B10CH - writing a configuration register (Word) 257
11.1.9. Function B10DH - Configuration Register Write (DWord) 258
11.2. Example of use 259
PART IV. CREATING USB DEVICES 283
Chapter 12. USB Peripherals 285
12.1. Atmel 286 chips
12.1.1. Microcontrollers with MSC-51 286 architecture
12.1.2. Hub controllers 289
12.1.3. Hub microprocessors with AVR 289 core
12.1.4. Other Atmel 290 chips
12.2. Cygnal 291 chips
12.2.1. Microprocessors C8051F320 and C8051F321 291
12.2.2. Other Cygnal 293 chips
12.3. FTDI 296 chips
12.3.1. Chips FT232AM and FT232BM 297
12.3.2. Chips FT245AM and FT245BM 298
12.3.3. Chip FT2232BM 299
12.3.4. Chip FT8U100AX 300
12.3.5. Debug kits and modules 301
12.3.6. Drivers 302
12.3.7. Additional utilities 303
12.3.8. Other 304 modules
12.4. Intel 304 chips
12.5. Microchip 308 chips
12.6. Motorola 308 chips
12.7. Philips 309 chips
12.7.1. USB 310 chips
12.7.2. Hubs 311
12.7.3. Other Philips 313 chips
12.8. Texas Instruments 314 chips
12.9. Trans Dimension 317 chips
12.10. 318 power protection chips
12.11. Online Resources for This Chapter 319
Chapter 13. HID device based on Atmel AT89C5131 322
13.1. Structural scheme AT89S5131 322
13.2. USB registers AT89С5131 324
13.2.1. USBCON Register 324
13.2.2. USBADDR Register 326
13.2.3. USBINT Register 327
13.2.4. USBIEN 328 register
13.2.5. UEPNUM register. 329
13.2.6. Register UEPCONX 330
13.2.7. UEPSTAX register. 331
13.2.8. Register UEPRST. 334
13.2.9. UEPINT register. 335
13.2.10. Register UEPIEN 336
13.2.11. Register UEPDATX 337
13.2.12. Register UBYCTLX 337
13.2.13. UFNUML Register 338
13.2.14. UFNUMH register. 338
13.3. Circuitry AT89S5131 338
13.4. Programming Tools 339
13.4.1. Compiler 341
13.4.2. Programmer 342
13.5. Program for microprocessor 349
13.5.1. First version of the program for AT89S5131 349
13.5.2. Adding string descriptors 369
13.5.3. Adding endpoints 374
13.5.4. Creating an HID Device 377
13.5.5. Communication with HID Device 381
13.6. Reading reports in Windows 388
13.7. Additional functions Windows XP 396
13.8. Device with multiple reports 397
Chapter 14. Creating a USB device based on ATMEL AT89C5131 402
14.1. Non-HID device 402
14.2. Creating a driver with using Driver Studio 405
14.2.1. A few words about the Driver Studio 407 library
14.2.2. Other Driver Studio 411 classes
14.2.3. Creating a Driver Template Using Driver Studio 412
14.2.4. Improvement of driver template 422
14.2.5. Basic Methods device class 423
14.2.6. Implementation of reading data 426
14.2.7. Installing the 428 driver
14.2.8. Data Reader 429
14.2.9. Reading data from other types of endpoints 438
14.2.10. “Clean” USB driver 439
Chapter 15: Using FTDI 457 Chips
15.1. Functional diagram FT232BM 457
15.2. Circuit design FT232BM 460
15.3. Functions of D2XX 460
15.4. Transition from COM to USB 465
15.4.1. Description of the 465 converter circuit
15.4.2. Setting the baud rate 467
PART V. HANDBOOK 469
Chapter 16: Basic Windows Features 471
16.1. CreateFile and CloseHandle functions: opening and closing an object.471
16.1.1. additional information 472
16.1.2. Return value 472
16.1.3. Example call 472
16.2. Read File function: reading data 473
16.2.1. Additional information 474
16.2.2. Return value 474
16.2.3. Example call 474
16.3. WriteFile function: data transfer 475
16.3.1. Additional information 476
16.3.2. Return value 476
16.3.3. Example call 476
16.4. ReadFileEx function. APC data reading 477
16.4.1. Return value 479
16.4.2. Additional information 479
16.4.3. Example call 479
16.5. WriteFileEx function: APC data transfer 480
16.5.1. Return value 481
16.5.2. Example call 481
16.6. Function WaitForSingleObject waiting for signal
object state 482
16.6.1. Return value 482
16.7. WaitForMultipleObjects function: waiting for signal
object states 483
16.7.1. Return value 484
16.8. GetOverlappedResult function result of asynchronous operation 484
16.8.1. Return value 485
16.9. DeviceIoControl function: Direct driver control 485
16.9.1. Return value 487
16.10. QueryDosDevice function: getting the device name
by his DOS name 487
16.10.1. Return value 488
16.10.2. Example call 488
16.11: Define Dos Device function: operations with DOS device name 489
16.11.1. Return value 490
16.11.2. Example call 490
Chapter 17. HID API Functions. 492
17.1. HidD_Hello function: checking library 492
17.2. Function HidD_GetHidGuid: getting GUID 492
17.3. HidD_GetPreparsedData function: creating a device handle 493
17.4. HidD_FreePreparsedData function: freeing the device handle 493
17.5. Function HidD_GetFeature: receiving FEATURE report 494
17.6. HidD_SetFeature function: sending FEATURE report 494
17.7. HidD_GetNumInputBuffers function: getting the number of buffers 495
17.8. Function HidD_SetNumInputBuffers: setting the number of buffers to 495
17.9. Function HidD_GetAttribntes: getting device attributes 495
17.10. Function HidD_GetMamifactnrerStnng. getting manufacturer string 496
17.11. Function HidD_GetProductString. getting product line 497
17.12. Function HidD_ Get Serial MumberString. getting string
serial number 497
17.13. Function HidD_GetIndexedString. getting a row at index 498
17.14. Function HidDjGetlnputReporr. receiving INPUT report 498
17.15. Function HidD_SetOutputReport. sending OUTPUT report 499
17.16. HidP_GetCaps function: getting device properties 499
17.17. Function HidP_MaxDataListLength: getting report sizes 500
Chapter 18. UCH 502 Host Controller
18.1. Host Controller Control Registers 502
18.1.1. USB Command Register (USBCMD) ..504
18.1.2. USB Status Register (USBSTS) 506
18.1.3. Interrupt Control Register (USBINTR) 506
18.1.4. Frame number register (FRNUM) 507
18.1.5. Register base address frame (FLBASEADD) 508
18.1.6. Start of Frame Modifier Register (SOFMOD) 508
18.1.7. Port Status and Control Register (PORTSC) 509
18.2. UCH 510 Host Controller Data Structures
18.2.1. List of frames 510
18.2.2. Transfer descriptor i 511
18.2.3. Queue header 514
18.3. Processing a list of UCH 516 descriptors
Chapter 19. Tools 518
19.1. Microsoft Visual Studio Tools 518
19.1.1. Depends 518
19.1.2. Error Lookup 518
19.1.3. GuidGen 518
19.2. Microsoft DDK 520 Tools
19.2.1. DeviceTree 520
19.2.2. DevCon.-521
19.2.3. Chklnf and Genlnf. 526
19.3. CompuWare Corporation Tools 527
19.3.1. Monitor 527
19.3.2. SymLink 527
19.3.3. EzDriverlnstaller 527
19.3.4. WdmSniff 527
19.4. Means Syslntemals 528
19.4.1. Winobj 528
19.5. USB Tools Forum 531
19.5.1. HID Descriptor Tool 531
19.6. HDD Software 533
19.7. Sourceforge Tools 533
APPLICATIONS 535
Appendix 1. Additional functions 537
Appendix 2. Table of language identifiers (LangID) 539
Appendix 3. Table of manufacturer codes (Vendor ID, Device ID) 543
Appendix 4. Description of the CD 546
Literature 548
Subject index 549