Skip to content

dgjohnson/GP2040-CE

 
 

Repository files navigation

GP2040-CE

Multi-Platform Gamepad Firmware for RP2040


GP2040-CE (Community Edition) is a gamepad firmware for the Raspberry Pi Pico and other boards based on the RP2040 microcontrollers that combines multi-platform compatibility, low latency and a rich feature set to provide endless customization possibilities without sacrificing performance.

GP2040-CE is compatible with PC, PS3, PS4, PS5, Nintendo Switch, Xbox One, Steam Deck, MiSTer and Android.

Links

Downloads | Installation | Wiring | Usage | FAQ | GitHub

Full documentation can be found at https://gp2040-ce.info

Release notes

0.8.x (DIY) — Rotary encoder fixes

  • Behavior change — Analog stick modes: one full revolution at multiplier 1 now sweeps the full joystick range (previously only swept half). If you were using an analog-stick rotary encoder, expect roughly 2x the existing sensitivity; halve your Multiplier to keep the old feel.
  • Behavior change — Auto-Center After (formerly "Reset After"): now only auto-centers analog stick modes. Trigger, DPAD, and volume modes keep their last value (previously all modes reset to zero on inactivity).
  • Bug fix — DPAD modes now respect SOCD: rotary-driven DPAD bits are now applied before SOCD cleaning, so simultaneous physical Left + rotary Right (or any opposing-cardinals combination) is resolved by your configured SOCD mode instead of leaking onto the wire.
  • Improved quadrature decoding: legitimate "double-edge" transitions (typical when a higher-priority interrupt briefly delays the encoder ISR) are now extrapolated in the most recent direction instead of being silently dropped, reducing under-counting on fast spinners.
  • Hardened setup() so re-running it (future "apply without reboot" path) no longer trips the Pico SDK's duplicate-handler hard_assert.
  • Volume-mode burst events are now collapsed into a single event with a magnitude field instead of allocating one event per step.
  • DPAD pulse timing is now safe across the 49.7-day getMillis() rollover.
  • Various validation / clamping tightened (encoder-disabled-but-half-configured no longer claims an addon slot, countsPerDetent strictly clamped to {1,2,4}, web-side enums locked).

Features

  • Select from 14 input modes including X-Input, Nintendo Switch, Playstation 4/5, Xbox One, D-Input, and Keyboard
  • Input latency average of 0.76ms in Xinput and 0.91ms for Playstation 5.
  • Multiple SOCD cleaning modes - Up Priority (a.k.a. Stickless), Neutral, 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.
  • Reversed input via a button.
  • Turbo and Turbo LED with selectable speed
  • Per-button RGB LED support.
  • PWM Player indicator LED support (XInput only).
  • Multiple LED profiles support.
  • Support for 128x64 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!

Visit the GP2040-CE Usage page for more details.

Performance

Input latency is tested using the methodology outlined at WydD's inputlag.science website, using the default 1000 Hz (1 ms) polling rate in the firmware. You can read more about the setup we use to conduct latency testing HERE if you are interested in testing for yourself or would just like to know more about the devices used to do the testing.

Version Mode Poll Rate Min Max Avg Stdev % on time %1f skip %2f skip
v0.7.12 Xinput 1 ms 0.45 ms 1.28 ms 0.76 ms 0.24 ms 98.48% 1.52% 0%
v0.7.12 Switch 1 ms 0.41 ms 1.22 ms 0.72 ms 0.24 ms 98.53% 1.47% 0%
v0.7.12 HID USB 1 ms 0.42 ms 1.25 ms 0.73 ms 0.24 ms 98.52% 1.48% 0%
v0.7.12 PS3 1 ms 0.52 ms 1.46 ms 0.83 ms 0.24 ms 98.37% 1.63% 0%
v0.7.12 PS4 1 ms 0.55 ms 2.33 ms 0.90 ms 0.32 ms 98.19% 1.81% 0%
v0.7.12 PS5 1 ms 0.55 ms 2.38 ms 0.91 ms 0.32 ms 98.18% 1.82% 0%

Full results can be found in the GP2040-CE v0.7.12 Firmware Latency Test Results .xlsx Sheet.

Results from v0.7.11 can be found HERE. Previous results can be found in the latency_testing folder.

Support

If you would like to discuss features, issues or anything else related to GP2040-CE please create an issue or join the OpenStick GP2040-CE Discord support channel.

Contributing

Want to help improve GP2040-CE? There are a bunch of ways to contribute!

Community Participation

Have an idea for a cool new feature, or just want to discuss some technical details with the developers? Join the OpenStick GP2040-CE Discord server to participate in our active and ever-growing community!

Pull Requests

Pull requests are welcome and encouraged for enhancements, bug fixes and documentation updates.

Please respect the coding style of the file(s) you are working in, and enforce the use of the .editorconfig file when present.

Acknowledgements

About

Multi-Platform Gamepad Firmware for Raspberry Pi Pico and other RP2040 boards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 40.5%
  • C 30.5%
  • JavaScript 15.5%
  • TypeScript 6.5%
  • Python 4.8%
  • CMake 1.0%
  • Other 1.2%