#playstation #gamepad #embedded-hal-driver

nightly no-std pscontroller-rs

A hardware-level platform agnostic driver for PlayStation 1 or 2 contoller peripherals. Requires soldering. 😁

4 releases (breaking)

Uses old Rust 2015

0.6.0 Sep 2, 2018
0.5.0 May 6, 2018
0.4.0 May 5, 2018
0.1.0 Apr 15, 2018

#8 in #playstation

MIT/Apache

40KB
613 lines

PlayStation Controller (PAD) Driver for Rust Embedded

This project is an attempt to support any PlayStation controller device for the PlayStation 1 or 2 consoles via the SPI port on any platform which support's Rust's embedded-hal abstraction layer. The main system this library is tested on is a Raspberry Pi 3 via the SPI bus on the board.

So far quite a few devices are supported, and random notes are kept in the research folder in this project. Here's the current list:

  • Original PlayStation digital mode
  • DualShock 1/2 analog sticks
  • DualShock 2 pressure sensitive buttons
  • DualShock rumble
  • Guitar Hero controller
  • Mad Maestro baton
  • JogCon
  • JogCon force feedback
  • GunCon
  • NegCon
  • PSX Multitap (SCPH-1070)

Most PlayStation games assume the controller which is plugged in, so it's difficult to automatically detect which controller is being used automatically. Currently, there is a best-effort based on a 16-value identifier, but there are heavy overlaps. For example, there is no conventient way to differentiate a Guitar Hero controller from an original Dual Shock controller. Because of this and the design of the library, there are a number of controllers that this library cannot support until a refactoring is done.

This project is immediately usable today, but work needs to be done to increase error detection and allow the ergonimc use of un-detectable controllers. There are examples to go on to learn how to use this library and discover some secrets of the PlayStation controllers you might own.

If you want to contribute new controller info or are having trouble wiring up your devices, open an issue and we can help you out. The bibliography below should also be a good jumping-off point as many of those authors are better writers. 😃

Bibliography

Dependencies

~305KB