rsta2/uspi — pull request #1 by maccasoft (2014-11-24 12:05:02+00:00)
Title: Added support for joystick/gamepad devices

Code to support gamepad devices.

The report descriptor decoder supports buttons and analog axes. It doesn't currently supports hats or other type of controls.

Public API added:

USPiGamePadAvailable - Returns 1 or 0
USPiGamePadGetStatus - Reads the report from the device and returns the updated status structure
USPiGamePadRegisterStatusHandler - Registers the handle to receive updates from the device

The status handler functions are using the USPiGamePadState structure which holds the status of buttons and axes. The structure is shared so no allocation/deallocations are needed.