Friday, March 17, 2023

GP2040-CE: gamepad firmware for the Raspberry Pi Pico #Gaming #RP2040 #PiDay #Raspberry_Pi @Hackaday

GP2040-CE is a gamepad firmware for the Raspberry Pi Pico and other boards based on the RP2040 microcontroller, and provides high performance with a rich feature set across multiple platforms. GP2040-CE is compatible with PC, MiSTer, Android, Raspberry Pi, Nintendo Switch, PS3 and PS4 (legacy controller support).

Features

  • Selectable input modes – XInput, DirectInput, and Nintendo Switch
  • Overclocked polling rate for less than 1 ms of input latency in all modes
  • Multiple SOCD cleaning modes – Neutral, Up Priority (a.k.a. Stickless), and Second Input Priority
  • Left and Right stick emulation via D-pad inputs as well as dedicated toggle switches
  • Dual direction via D-pad + LS/RS
  • Reverse input via button
  • Turbo and Turbo LED with selectable speed
  • Per-button RGB LED support
  • PWM Player indicator LED support (XInput only)
  • Multiple profile support
  • Support for 128×64 monochrome I2C displays – SSD1306, SH1106, and SH1107 compatible
  • Custom startup splash screen and easy image upload via web configuration
  • Support for passive buzzer speaker (3v or 5v)
  • Built-in, embedded web configuration – no download required!

But how does the humble RP2040 (be it in Pico guise or compatible) provide a web page, you ask? The quick answer comes thanks to Microsoft and their Remote Network Driver Interface Specification (RNDIS) support. RNDIS implements a network device over USB, and luckily, other OSs have caught up and implemented it also. The GP2040 firmware leverages TinyUSB to implement the RNDIS protocol, lwIP to implement a lightweight network stack (whilst only occupying a rather paltry 40k of flash), and finally react-bootstrap to code the actual web logic. (Aren’t modern open source libraries awesome?) If you feel the need to use the source (whether you are named Luke or not) the project can be found on the GP2040 GitHub.

Read more on the official website and in a Hackaday article.

No comments:

Post a Comment