October 1, 2022
  • October 1, 2022

GP2040: a configurable gamepad firmware

By on September 4, 2022 0

[feralAI] and other GitHub contributors present for your viewing pleasure GP2040: an open-source gamepad firmware for RP2040-based hardware. The dual-core RP2040 is a good rig to use for gaming inputs, as there’s plenty of CPU power to achieve sub-1ms USB polling time, whatever other tasks the controller may be doing. perform. Currently, the firmware supports PC, Android, RPi, Nintendo Switch, PS3, PS4 (legacy mode) and MiSTer FPGA retro game platform.

The firmware supports both the old DirectInput API and the shiny (but rather restrictive) new XInput API (no, it’s not the old X11 input extension of the same name) – as well as the usual controller features like as SOCD cleanup, D-pad mapping, and RGB support for additional distractions. There’s even support for those tiny OLED displays (SSD1306 and friends), though we can’t think of a use case for that just yet. The configuration is however particularly interesting because it is based on an embedded web application. This is where the pin mappings to your actual hardware are set, along with all that RGB bling, if you like.

But how does the humble RP2040 (whether Pico or compatible version) deliver a webpage, you ask? The quick answer comes from Microsoft and its support for the Remote Network Driver Interface Specification (RNDIS). RNDIS implements a network device over USB, and fortunately other operating systems have also caught up and implemented it. The GP2040 firmware leverages TinyUSB to implement the RNDIS protocol, lwIP to implement a lightweight networking stack (while only taking up a measly 40k of flash), and finally react-bootstrap to encode the actual web logic. (Aren’t modern open source libraries awesome?) If you feel the need to use the source (whether your name is Luke or not), the project can be found on the GP2040 GitHub.

If you love gaming on gamepads, but love the responsiveness of the trusty mouse, look no further than this neat hybrid controller. But if that modern thing with 45 buttons and levers everywhere is just too much, and you have a fondness for controllers from days gone by, this might be more your style.

Thanks to [DJBiohazard] for the tip!