microzig
microzig copied to clipboard
Rework USB driver
This PR is my (yet another) shot at a better USB driver implementation.
Key changes:
- Multi-function (composite) devices possible
- Descriptors are automatically constructed at compile time by drivers
- More type safety around descriptors
- Supporting other USB controllers as well as multiple drivers per controller (eg. interrupted/polled) and writing new drivers should be much easier
- Removed a lot of global variables
This is a succesor to #658, but this time I tried to change as little controller logic as possible to avoid bugs. As last time, I'm open to suggestions.
There is still much work to be done in this area, but this PR is already big. Nice additions would include:
- Better way of constructing HID descriptors
- Using the new types in stm32 examples
- More and better examples (eg. actual HID keyboard/mouse/gamepad, mass storage)