epicardium (&pycardium) USB API
Looking at the way the device and interface descriptors are configured in cdcacm.c, bootloader-usb.c and basically every MAXUSB sdk example, there is ample room for generalization and actually, if we want to add/remove USB interfaces at runtime, as is needed for USB mass storage, there is need for generalization. Looking at it, I've been thinking about building the descriptors at runtime - malloc'ing the memory region with the (easily determined) size needed and filling several iFooBar references dynamically to point to the corresponding enum_register_descriptor indizes. This way we don't need to have several hard-coded descriptors on RAM when we don't need them and would also buy lots of flexibility that way.
Furthermore, at least for me, an obvious fun thing to do, when handed a programmable badge with USB, is to implement own devices, HID being a prime example.
How about:
- an API for building descriptors
- offering our default built-in interfaces cdcacm and mass storage
- but also, for user-defined interfaces, exposing the endpoints via our stream interface.
This way it would be possible to implement HID devices in python via streams and struct.pack (or whatever it's called)
Thoughts?