# X-Input Component [](https://components.espressif.com/components/espp/xinput) `xinput.hpp` is the wire format of X-Input, the protocol of the wired Xbox 360 controller (and of most third-party controllers in their "X-input" mode). It is header-only and dependency-free (no ESP-IDF or TinyUSB headers), so it builds and is tested on a computer too, and it serves both ends of the cable: - [`usb_device`](../usb_device) presents an X-Input controller to a PC or console: it packs `xinput::GamepadState::report()` and reads the host's rumble with `xinput::decode_rumble()`; - [`xbox_host`](../xbox_host) reads an X-Input controller plugged into a USB host port: it parses `xinput::parse_report()` and sends `xinput::rumble_report()` / `xinput::led_report()`. ## Wire format An X-Input controller presents a vendor-specific interface (class `0xFF`, subclass `0x5D`, protocol `0x01`) with one interrupt IN and one interrupt OUT endpoint. | Direction | Message | Bytes | |-----------|---------|-------| | IN | input report | `00 14 <buttons lo> <buttons hi> <LT> <RT> <LX> <LY> <RX> <RY>` + 6 reserved (sticks int16 little-endian, Y up positive) | | IN | LED status | `01 03 <pattern>` | | OUT | rumble | `00 08 00 <left motor> <right motor> 00 00 00` | | OUT | LED ring | `01 03 <pattern>` (`xinput::Led`, `xinput::player_led(n)`) | See `include/xinput.hpp` for the button bits (`xinput::Button`) and the interface + XID descriptor builder.
0bb7b005ab1fc333a4ebad1a2ab86ae1d8b9cf95
idf.py add-dependency "espp/xinput^1.5.0"