We’re developing some robot-side code to ensure it is seeing the right joystick configuration on the DS, and lighting up an indicator on the dashboard. To figure this out, we’ve been experimenting with
HAL_GetJoystickDescriptor() which provides a structure called
This structure is pretty self explanatory, except for the
type field. This is only documented as “This is device specific, and different depending on what system input type the joystick uses.”.
After trying it with a variety of joysticks and gamepads, there wasn’t an obvious pattern, and the values don’t correlate to any USB device descriptors I’ve found. My best guess is it relates to the driver that Windows on the DS uses to talk to the Joystick.
Anybody know exactly what the
HAL_JoystickDescriptor.type field means?
Ultimately, I don’t think it matters too much; we’ll just look for the three devices we expect to find by name (or at least match the first 3 letters).
BTW, here are the details for all the joysticks/pads I tried:
|Description||Notes||.name||.type (dec)||.type (hex)||.isXbox||.buttonCount||.axisCount||.povCount|
|Logitech Gamepad F310||Same regardless of mode toggle||“Controller (Gamepad F310)”||1||01||1||10||6||1|
|Logitech Extreme 3D||“Logitech Extreme 3D”||20||14||0||12||4||1|
|Saitek ST290 Pro||“Saitek ST290 Pro”||20||14||0||6||4||1|
|Playstation3 Controller||via USB; doesn’t actually work||“PLAYSTATION®3 Controller”||20||14||0||19||4||0|
|VKBsim Gladiator Mk. II||Thumb & Pinkie buttons not recognized||“VKBsim Gladiator”||24||18||0||29||7||1|
|TI LaunchPad||Option 1 Firmware||“MSP430-USB Gamepad”||24||18||0||11||8||0|
|Arduino Leonardo||With Joystick Library||“Arduino Leonardo"||28||1C||0||~||~||~|
|eStop Robotics CCI||Custom control interface||eStop Robotics HID||21||15||0||12||4||1|