OpenStickCommunity / GP2040-CE

Multi-Platform Gamepad Firmware for Raspberry Pi Pico and other RP2040 boards
https://gp2040-ce.info
MIT License
1.24k stars 279 forks source link

Add a generic USB HID mode #1061

Closed bsstephan closed 2 weeks ago

bsstephan commented 2 weeks ago

All the existing HID modes have quirks and host-specific decisions --- specific VID/PIDs, how the analogs are ordered, weird counter stuff, undocumented analog button payloads, auth packets, etc. Meanwhile, Bounty 35 has requested additional inputs for USB HID devices, for people who want to map more than 14 buttons. That bounty also (rightly IMO) surmises that we'd have to break out a new mode. The goal might be one day that this new mode can be user-configurable with specific button counts or who knows what else, especially once we get I/O expanders integrated --- maybe you could define a bunch of analogs!

Anyway, this PR:

  1. copies the old USB HID mode into a "PS3" mode, since it has a couple PS3-specific quirks for the PS button and analog buttons
  2. starts a new Generic HID mode, largely from scratch, but based on what is now PS3 mode
  3. adds 12 "Extra" buttons, which only work in Generic HID mode, bringing Generic HID mode to:
  4. one dpad hat, two emulated analog sticks, and 32 buttons (two of which don't do anything due to current lack of use in the Gamepad code)
  5. exposes everything necessary to map them in the webconfig Pin Mapping page