Replies: 2 comments 1 reply
-
late response, but the approach can be much simpler. There is an example that handle PS4 dual shock controller using vid/pid matching https://github.com/hathach/tinyusb/blob/master/examples/host/hid_controller/src/hid_app.c . I don't have an xbox controller and therefore couldn't test/add its support yet. It is strange that xbox does not contain hid descriptor and report descriptor, would you mind pasting/attaching its configuration descriptor here. |
Beta Was this translation helpful? Give feedback.
-
implement the host driver to support Xbox Controller with RT-Thread and integration with DOOM, video on https://streamable.com/4xs72c |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I've implemented support for the XBOX controller in host mode, but would like some ideas on the best way to cleanly integrate this into the tinyusb source.
XBOX Controllers are HID Devices, with 2 exceptions:
Otherwise it behaves exactly like a HID device and can be handled by hid_host.c
The way I've implemented support is to provide 3 callbacks so that user-code can provide the missing descriptors.
This seems to work quite well for my purposes, with minimal changes to hid_host.c.
Does this seem like a valid approach? My concern that this is going to be quite specific to the XBOX controller and not generally applicable. But I can't see a better way as making an xbox-specific class is basically going to duplicate all of the hid_host code.
The user-code looks something like below (Note the HID report descriptor is not correct, it's a very minimal one that suits my purpose)
If the approach makes sense, I'll send through a pull request with the changes and an example.
Beta Was this translation helpful? Give feedback.
All reactions