• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

src/04-Jan-2025-290229

CMakeLists.txtD04-Jan-2025292 107

KconfigD04-Jan-2025373 107

README.rstD04-Jan-20251.2 KiB3727

app.overlayD04-Jan-2025283 1614

large_in_report.overlayD04-Jan-2025254 1513

large_out_report.overlayD04-Jan-2025266 1613

out_report.overlayD04-Jan-2025253 1613

prj.confD04-Jan-2025257 1310

sample.yamlD04-Jan-2025810 3231

README.rst

1.. zephyr:code-sample:: usb-hid-keyboard
2   :name: USB HID keyboard
3   :relevant-api: usbd_api usbd_hid_device input_interface
4
5   Implement a basic HID keyboard device.
6
7Overview
8********
9
10This sample application demonstrates the HID keyboard implementation using the
11new experimental USB device stack.
12
13Requirements
14************
15
16This project requires an experimental USB device driver (UDC API) and uses the
17:ref:`input` API. There must be a :dtcompatible:`gpio-keys` group of buttons
18or keys defined at the board level that can generate input events.
19At least one key is required and up to four can be used. The first three keys
20are used for Num Lock, Caps Lock and Scroll Lock. The fourth key is used to
21report HID keys 1, 2, 3 and the right Alt modifier at once.
22
23The example can use up to three LEDs, configured via the devicetree alias such
24as ``led0``, to indicate the state of the keyboard LEDs.
25
26Building and Running
27********************
28
29This sample can be built for multiple boards, in this example we will build it
30for the nRF52840DK board:
31
32.. zephyr-app-commands::
33   :zephyr-app: samples/subsys/usb/hid-keyboard
34   :board: nrf52840dk/nrf52840
35   :goals: build flash
36   :compact:
37