EmbeddedNim / picostdlib

Nim wrapper for the raspberry pi stdlib
MIT License
70 stars 11 forks source link

Make the tusb module functional for HID/CDC #39

Closed auxym closed 2 years ago

auxym commented 2 years ago

Implement basic TinyUSB support:

A small part of descriptor definition is wrapped, but most of it still has to be done in C. An example is provided that demonstrates HID and CDC functionality and descriptor config in C (taken from tinyusb examples).

Please review and ~nitpick~ provide constructive criticism on the tusb.nim exported API. API design is hard and now is the time to get it close to right. I tried to make it slightly higher level than the "raw" tinyusb API so it's less complex to use for library users, but still exposes most functionality (in a sane way). I also tried to model the interface types (UsbSerialInterface and UsbHidInterface) after the GPIO api.

Closes #38

auxym commented 2 years ago

Alright, pushed a few commits that:

Let me know what you think about the remaining C stuff.