ctrl_usb.h 983 B

12345678910111213141516
  1. // ctrl_usb.h -- the emulated controller's USB face (Valve 28DE:1302) + pairing command channel.
  2. //
  3. // Presents a single Valve HID control interface (usagePage 0x01, feature reports id 1/2) so Steam and
  4. // PairTUI treat us as a dockable Steam Controller. We ANSWER identity reads (0x83 product, 0xAE serial,
  5. // 0xB4 wireless state) and ACCEPT the steamless pairing writes that target the controller:
  6. // 0xEE keyed value write payload ["esb/bond"\0 or "esb/bond_2"\0][r1 4][r2 4][puck_serial 16]
  7. // 0xEF keyed value commit payload ["esb/bond"\0]
  8. // 0xA2 direct 24-byte bond write to slot 0 (PairTUI/Steam fallback shape)
  9. // 0x95 reboot into wireless mode (magic 0xA427AF52) -> NVIC_SystemReset after the flash flush
  10. // See protocol/USB_COMMANDS.md for the full steamless flow.
  11. #pragma once
  12. // register the HID interface (call from setup, before USBDevice.attach)
  13. void ctrlUsbBegin();
  14. // flush dirty bonds + honor a pending reboot (call each loop)
  15. void ctrlUsbPoll();