Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hook to allow for external host class drivers #2685

Closed
1 task done
harbaum opened this issue Jun 20, 2024 · 2 comments
Closed
1 task done

Add hook to allow for external host class drivers #2685

harbaum opened this issue Jun 20, 2024 · 2 comments

Comments

@harbaum
Copy link

harbaum commented Jun 20, 2024

Related area

Allow developers to provide custom class drivers

Hardware specification

all

Is your feature request related to a problem?

I'd like to add xbox controller support to the tuh. The xbox controllers are vendor specific and the vendor class driver seems broken: #2684

Describe the solution you'd like

Allowing to add custom class drivers to usbh_class_drivers[] in usbh.c would allow custom class drivers without the need to change/add anything to tinyusb. A simple solution may to allow the user to statically add an entry to this list via some #define in tusb_config.h

There's some discussion about this at #1929. But that approach would IMHO only work if the device would report as a hid class device which the xbox controllers don't.

There seem to be variants of tinyusb that implement something like this as this code snipped suggests:
https://github.com/RT-Thread-Studio/sdk-bsp-ra8d1-vision-board/blob/master/projects/usb/vision_board_tinyusb_xpad/board/tinyusb/host_register.c

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.
@Ryzee119
Copy link
Contributor

You've been able to hook in your own USB host drivers since #2222

I made this a while ago but I try keep it up to date you https://github.com/Ryzee119/tusb_xinput

@harbaum
Copy link
Author

harbaum commented Jun 20, 2024

Excellent. Your driver works as advertised ... thanks a lot ...

@harbaum harbaum closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants