examples/device/hid_multiple_interface/README.md
A composite USB device with two separate HID interfaces — one keyboard and one mouse — each with its own report descriptor, endpoint, and interface string.
A keycode; releasing sends an empty report.| Interface | Class driver |
|---|---|
| 0 | HID (keyboard) |
| 1 | HID (mouse) |
Notable tusb_config.h settings:
#define CFG_TUD_HID 2 // keyboard + mouse
#define CFG_TUD_HID_EP_BUFSIZE 8
CMake:
mkdir build && cd build
cmake -DBOARD=raspberry_pi_pico ..
cmake --build .
Make:
make BOARD=raspberry_pi_pico all
After flashing, the board enumerates as two distinct HID devices, a keyboard and a mouse. Press and hold the button: the host receives repeated A key presses and the pointer drifts toward the bottom-right.