modm-io / modm

modm: a C++23 library generator for AVR and ARM Cortex-M devices
https://modm.io
Mozilla Public License 2.0
733 stars 131 forks source link

Upgrade TinyUSB to v0.16.0, allow dual role operations, fix HS port operations #1116

Closed salkinium closed 8 months ago

salkinium commented 8 months ago

Had a look at what TinyUSB is capable of now, it doesn't prevent you anymore from running Device and Host at the same time, so I refactored the code to allow generating both.

Also fixed some very embarrassing oversight of not configuring the USB pins for high speed, which prevented the ULPI signals from working. In addition, the HS port can also be used in FS mode, in which case the ULPI clock must remain disabled! This is now correctly being done, together with the GPIO config.

I don't have a way to test host mode, due to lack of the correct adapter. I would do that later and fix whatever is broken then.

TinyUSB changes:

STM32 changes:

Tested: