examples/device/hid_generic_inout/README.md
A USB HID device that exchanges raw IN/OUT reports over a vendor-defined usage page, with no standard keyboard/mouse usage. It simply echoes back whatever the host sends.
tud_hid_report.hid_test.js (node-hid) and hid_test.py (Python hid) scripts to send and receive data.| Interface | Class driver |
|---|---|
| 0 | HID (generic in/out, raw vendor reports) |
Notable tusb_config.h settings:
#define CFG_TUD_HID 1
#define CFG_TUD_HID_EP_BUFSIZE 64
CMake:
mkdir build && cd build
cmake -DBOARD=raspberry_pi_pico ..
cmake --build .
Make:
make BOARD=raspberry_pi_pico all
After flashing, run the bundled host tool — node hid_test.js or python3 hid_test.py — to send a buffer to the device and observe the same data echoed back.