rust-embedded-community / usbd-serial

Work-in progress minimal CDC-ACM (USB serial port) class for usb-device
MIT License
118 stars 35 forks source link

Add read_ep_address and make write_ep_address pub #19

Closed thalesfragoso closed 8 months ago

thalesfragoso commented 3 years ago

This make it possible to re-use this to write other serial drivers, like an async one...

https://github.com/akiles/embassy/pull/75

mvirkkunen commented 3 years ago

Do you think it'd make sense to just go all the way and remove the read/write and such methods and just expose the entire endpoint objects via accessors or even pub fields? CdcAcmClass is meant to be used as a helper to implement other things anyways so hiding stuff probably isn't that important.

Also it'd be nice if global reformatting could be a separate commit so it's nicer to read :slightly_smiling_face: (I know the formatting is a mess right now, I can reformat it myself before next release)

thalesfragoso commented 3 years ago

Although I don't need to go all the way right now, I agree with you, it makes sense to even have them as pub, do you think this should be in this PR ?

Sorry for the formatting, it was automatic... I can remove it.

ianrrees commented 3 years ago

I like the idea of making the endpoints pub - ran in to the same issue in https://github.com/mvirkkunen/usbd-serial/issues/21