EDITED: [In-game] Gamepad setup

[EDIT: Nevermind, getting this part figured out through trial and error] Is there any documentation to simplify setting up gamepad support (XInput) in a game? Like which button numbers go where, possible axis values, etc?

V Still interested in this part V
Also, would it be possible to allow a player to remap gamepad buttons within the game? Capture input and set it for a specific action?

This is my first time trying gamepad support, so I’m not sure where the best place is to start. Searching Google came up with mostly 3rd party programs for remapping.