refactor(usb): dynamic endpoint descriptor generation#5405
refactor(usb): dynamic endpoint descriptor generation#5405digitalentity wants to merge 2 commits into
Conversation
|
@deadprogram please have a look |
Replace static endpoint variables with EndpointIN and EndpointOUT functions. Allows flexible endpoint remapping across USB configs.
35ef3d9 to
7c20bfb
Compare
|
@digitalentity please note test failure. |
|
@digitalentity that was fast! 😸 |
|
@deadprogram @sago35 I've tested this on a tiny2350, seems to work. |
|
Can some others please test out on various USB devices with your own projects e.g. TinyGo Keeb etc? I just want to make sure this does not cause any unexpected issues, or at least that people know about it. |
|
I’ll check on Monday or Tuesday. |
|
I'll look into it now. |
|
I am checking this with the RP2040. I found that it is more complex than I expected. Currently, USB CDC works fine because it uses endpoints 1 to 3 in a unidirectional manner rather than bidirectional. However, when trying to use USB HID, Endpoint 1 and Endpoint 2 need to be configured as bidirectional. The current This issue likely occurs on the ATSAMD and nRF52840 as well. I need to investigate a bit further. For now, I will focus on getting it to work on the RP2040 first. |
Replace static endpoint variables with EndpointIN and EndpointOUT functions.
Change the CDC, CDCHID and CDCMSC descriptors to fit into 4 endpoints.
This is a pre-requisite for supporting USB on STM32 which has only 4 EPs in hardware.