README.rst
1.. _usb_hid:
2
3USB HID Sample Application
4##########################
5
6Overview
7********
8
9This sample app demonstrates use of a USB Human Interface Device (HID) driver
10by the Zephyr project. This very simple driver is enumerated as a raw HID
11device. This sample can be found under :zephyr_file:`samples/subsys/usb/hid` in the
12Zephyr project tree.
13
14Requirements
15************
16
17This project requires a USB device driver.
18
19Building and Running
20********************
21
22This sample can be built for multiple boards, in this example we will build it
23for the reel_board board:
24
25.. zephyr-app-commands::
26 :zephyr-app: samples/subsys/usb/hid
27 :board: reel_board
28 :goals: build
29 :compact:
30
31After you have built and flashed the sample app image to your board, plug the
32board into a host device, for example, a PC running Linux.
33The board will be detected as shown by the Linux journalctl command:
34
35.. code-block:: console
36
37 $ journalctl -k -n 10
38 usb 7-1: New USB device found, idVendor=2fe3, idProduct=0006, bcdDevice= 2.03
39 usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
40 usb 7-1: Product: Zephyr HID sample
41 usb 7-1: Manufacturer: ZEPHYR
42 usb 7-1: SerialNumber: 86FE679A598AC47A
43 input: ZEPHYR Zephyr HID sample as /devices/platform/vhci_hcd.0/usb7/7-1/7-1:1.0/0003:2FE3:0100.0046/input/input81
44 hid-generic 0003:2FE3:0100.0046: input,hidraw0: USB HID v1.10 Device [ZEPHYR Zephyr HID sample] on usb-vhci_hcd.0-1/input0
45
46You can monitor report sending using standard Linux ``usbhid-dump`` command.
47
48.. code-block:: console
49
50 $ sudo usbhid-dump -d 2fe3:0006 -es
51 Starting dumping interrupt transfer stream
52 with 1 minute timeout.
53
54 007:012:000:STREAM 1537362690.341208
55 01 02
56