eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
148 stars 88 forks source link

custom usb device with two interrupt endpoints #65

Closed sw2mrc closed 1 year ago

sw2mrc commented 2 years ago

Hello!

I have played with HID and CDC-ACM device BX examples on STM32, and the project requires a custom class with two interrupt endpoints one IN EP and one OUT EP. Looking at the USBX API documentation (PDF version published on MSFT website) does not give clues on which APIs i can use to achieve this? any examples i can look at?

Thanks much in advance!

xiaocq2001 commented 1 year ago

You can refer to ST's HID_CDC_ACM example, where HID mouse with IN EP is demoed.

HID optional interrupt OUT endpoint is supported by compile with UX_DEVICE_CLASS_HID_INTERRUPT_OUT_SUPPORT. With it, you can add OUT EP descriptor to device framework and use ux_device_class_hid_read to read data from interrupt OUT endpoint (blocking current thread).