Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

USB human interface device class

From Wikipedia, the free encyclopedia
Type of USB specification
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "USB human interface device class" – news ·newspapers ·books ·scholar ·JSTOR
(November 2009) (Learn how and when to remove this message)

Incomputing, theUSB human interface device class (USB HID class) is a part of theUSB specification forcomputer peripherals: it specifies a device class (a type ofcomputer hardware) forhuman interface devices such askeyboards,mice,touchscreen,touchpad,game controllers and alphanumericdisplay devices.

The USB HID class is defined in a number of documents provided by theUSB Implementers Forum's Device Working Group. The primary document used to describe the USB HID class is the Device Class Definition for HID 1.11.[1]

Devices

[edit]

The USB HID class describes devices used with nearly every modern computer. Many predefined functions exist in the USB HID class. These functions allow hardware manufacturers to design a product to USB HID class specifications and expect it to work with any software that also meets these specifications.

The same HID protocol is used unmodified inBluetooth human interface devices.[2] The Bluetooth profile specification only points readers to the USB HID documentation. In this sense those devices also belong to the USB HID class.

Keyboards

[edit]

Keyboards are a common kind of USB HID class device. The USB HID class keyboard is normally designed with an IN endpoint that communicates keystrokes to the computer and an OUT endpoint that communicates the status of the keyboard's LEDs from the computer to the keyboard. ThePC 97 standard requires that a computer'sBIOS must detect and work with USB HID class keyboards that are designed to be used during the boot process.

Some keyboards implement theUSB Boot Keyboard profile specified in the USB Device Class Definition for Human Interface Devices (HID) v1.11 and are explicitly configured to use the boot protocol. These are limited to6-key rollover (6KRO) and will interrupt the CPU every time the keyboard is polled (even if there is no state change) unless the USB controller is programmed to tell the keyboard to respond with negative acknowledgments, which the USB controller discards in hardware without interrupting the CPU, when there are no state changes to report. This profile is intended to allow the BIOS to handle a USB keyboard in the absence of a USB-aware operating system. The recommended profile for keyboards that are not in boot mode in this specification limits keyboards to 6KRO and causes them to respond to an interrupt with a status report at least every half second (again, even if there is no state change) in order to implement typematic (repeating thescancode when the key is pressed long enough) unless the USB controller is programmed to tell the keyboard to reply with negative acknowledgments whenever there are no state changes to report. However, keyboards in non-boot mode are free to implement an alternative HID profile.[1]

The above-mentioned behavior is in contrast to thePS/2 interface, which supportsn-key rollover (NKRO) for keyboards capable of supporting it.

Mouse

[edit]

Computer mouse is another common USB HID class device. USB HID mice can range from single-button simple devices to multi-button compound devices. Most modern operating systems ship with drivers for standard HID mouse designs (the most common modern mouse design has two dedicated buttons and amouse wheel that doubles as the third button); mice with extended functionality require custom drivers from the manufacturer.

USB mice have lower latencies than PS/2 mice because standard USB mice are often polled at a default rate of 125 Hz while standard PS/2 mice send interrupts at a default rate of 100 Hz when they have data to send to the computer.[3][4] Also, USB mice do not cause the USB controller to interrupt the system when they have no status change to report according to the USB HID specification's default profile for mouse devices.[1] Both PS/2 and USB allow the sample rate to be overridden, with PS/2 supporting a sampling rate of up to 200 Hz[5] and USB supporting a polling rate up to 1 kHz[3] given the USB mouse runs at full-speed or up to 8kHz given the USB mouse runs at high-speed.[6]

Game controllers

[edit]

Modern game controllers andjoysticks are often USB HID class devices. Unlike legacygame port devices, USB HID class game devices do not normally require proprietary drivers to function. Nearly all game devices will function using onboard drivers as long as the device is designed around the drivers and the USB HID class specifications.

Other devices

[edit]

The USB HID class specifications allow for myriad other devices under the USB HID class. Some examples are automobile simulation controllers, exercise machines,telephony devices, thermometers, audio controls and medical instrumentation. Evenuninterruptible power supplies andsoftware protection dongles[7] declare themselves under this class, despite the fact they often have no human interface at all. Any device can be a USB HID class device as long as a designer meets the USB HID class logical specifications. This is not to say that there is no need to ship drivers for these devices, nor that an operating system will immediately recognize the device. This only means that the device can declare itself under the human interface device class.

Security vulnerabilities

[edit]

The USB interface is vulnerable to security exploits such asBadUSB that abuse the combination of USB's ability to connect many different kinds of devices, its inability to verify that devices are actually what they claim to be, the possibility for USB devices to change their type or announce additional subdevices while plugged in, and its default behavior of accepting any device that connects to it. As a partial countermeasure, PS/2 peripherals may be used instead together with disabling all USB ports.[8]

Drivers

[edit]

One of the benefits of a well-defined specification like the USB HID class is the abundance ofdevice drivers available in most modern operating systems. The USB HID class devices and their basic functions are defined in USB-IF documentation without any specific software in mind. Because of these generic descriptions, it is easy for operating system designers to include functioning drivers for devices such as keyboards, mice, and other generic human interface devices. The inclusion of these generic drivers allows for faster deployment of devices and easier installation by end-users.Windows 98 was the first version of Windows that supported USB HID.

Logical specifications

[edit]

Functional characteristics

[edit]

The USB human interface device class can be used to describe both device and interface classes. The interface class is used when a USB device can contain more than one function. It is possible, therefore, to have USB devices with two different interfaces at the same time (for example, a USB telephone may use a keypad covered by the HID class and a speaker covered by theUSB communications device class).

The interface devices are also defined with subclass descriptors. The subclass descriptor is used to declare a device bootable. Aboot device meets a minimum adherence to a basicprotocol and will be recognized by a computer'sBIOS.

Each USB HID interface communicates with the host using either acontrol pipe or aninterrupt pipe.Isochronous andbulk pipes are not used in HID class devices. Both IN and OUT control transfers are required for enumeration; only an IN interrupt transfer is required for HID reports. OUT interrupt transfers are optional in HID-class devices.

Reports

[edit]

The USB HID class requires that every device describes how it will communicate with the host device in order to accurately predict and define all current and future human interface devices. During enumeration the device describes how its reports are to be structured so that the host device can properly prepare to receive this information.

The host periodically polls the device's interrupt IN endpoint during operation. When the device has data to send it forms a report and sends it as a reply to the poll token. Common devices such as keyboards and mice send reports that are compliant with standards set by theUSB Implementers Forum (USB-IF).[9] When a vendor makes a custom USB HID class device, the reports formed by the device need to match the report description given during enumeration and the driver installed on the host system. In this way it is possible for the USB HID class to be extremely flexible.

USB HID API

[edit]

There are two levels of APIs related to USB HID: the USB level and theoperating system level. At the USB level, there is a protocol for devices to announce their capabilities and the operating system to parse the data it gets. The operating system then offers a higher-level view to applications, which do not need to include support for individual devices but for classes of devices. Thisabstraction layer allows a game to work with any USB controller, for example, even ones created after the game.

See also

[edit]

References

[edit]
  1. ^abc"Device Class Definition for HID 1.11"(PDF).
  2. ^"HID Spec v1_0.zip". Retrieved2013-01-22.
  3. ^ab"Mouse Optimization Guide: Acceleration Fix and Polling Rate". eu.cybergamer.com. 2007-04-09. Archived fromthe original on 2014-07-09. Retrieved2014-07-09.
  4. ^"LCOM 2012/2013: Lab5". web.fe.up.pt. Retrieved2014-07-09.
  5. ^Adam Chapweske."PS/2 Mouse Interfacing". computer-engineering.org. Retrieved2014-07-09.
  6. ^"Technical Documentation".docs.nordicsemi.com. Retrieved2025-11-02.
  7. ^"USB Dongle is driverless, HID device., SecuTech Solution Inc". News.thomasnet.com. Retrieved2014-01-18.
  8. ^Anthony, Sebastian (31 July 2014)."Massive, undetectable security flaw found in USB: It's time to get your PS/2 keyboard out of the cupboard".ExtremeTech. Retrieved26 October 2015.
  9. ^"Microsoft Related HID Documentation". USB.org. Archived fromthe original on 2012-08-19. Retrieved2013-01-22.

External links

[edit]
Versions
Device classes
Security
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=USB_human_interface_device_class&oldid=1335637665"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp