mode_xinput.h 900 B

123456789101112131415161718
  1. // mode_xinput.h -- Xbox 360 wired (XInput) personality (MODE_XBOX): XInput gamepad + right-pad mouse.
  2. //
  3. // Real Xbox 360 pads are NOT HID: they use a vendor interface (class 0xFF / sub 0x5D / proto 0x01) carrying a
  4. // 20-byte XInput report. We register a custom TinyUSB class driver for that interface (see mode_xinput.cpp)
  5. // plus a second boot-mouse interface for the right trackpad. Steam/SDL/Windows xusb bind by VID/PID
  6. // (045E:028E) + the FF/5D/01 interface. The host's OUT endpoint carries rumble, relayed to the controller as
  7. // a haptic by task().
  8. #pragma once
  9. #include "controllers.h"
  10. #include <stdint.h>
  11. class XboxController : public IController {
  12. public:
  13. void begin() override;
  14. void onReport45(const uint8_t* rep, bool fresh, uint8_t bodyTlen) override;
  15. void task() override; // legacy XInput rumble -> haptic relay + stuck-rumble watchdog
  16. };
  17. extern XboxController g_xboxCtl;