-
Notifications
You must be signed in to change notification settings - Fork 254
Add embedded-io, embedded-io-async, remove serial traits. #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fe08b3f to
e5af237
Compare
ryankurte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approach seems reasonable and examples are solid, lgtm (and thanks for your work on this)!
therealprof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks a lot.
eldruin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for all your work!
This looks great to me.
Something to do after merging this would be to document how to go about something like the older serial::Write trait and how e-h and e-io fit together.
Co-authored-by: Diego Barrios Romero <[email protected]>
|
adressed @eldruin 's review comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you again!
It seems we are all fine with this so let's merge it.
As discussed previously and in today's meeting (chatlog, minutes), we've decided to not have serial traits, in favor of a more general "io" abstraction.
This PR moves the embedded-io crate to the embedded-hal repo. The crate currently living at https://github.com/embassy-rs/embedded-io, that repo will be archived once the move is complete.
Changes from the embassy repo:
defmtimpls, needed for 1.0.embedded-ioandembedded-io-async. Needed for 1.0, so we don't have to wait for AFIT to be stable.tokioandfutures. I'm not sure if we want them here or it's better to leave them to community crates. If we do, I'll add them in a future PR.embedded-io::{ReadReady, WriteReady}. They're separate from theRead/Writetraits since they can't be trivially implemented on top ofstd::iotraits, so this would present a problem for the adapters. (It's likely implementable with e.g. some weirdpoll()/select()contraption, but that's OS-specific and I'm sure has other tradeoffs, so I'd rather not make the adapters do that by default.)The crate has been added by parts in several commits to make review easier.
The
embedded-iocrate has been around for more than 1 year, so it's somewhat "proven". The design is the same asstd::io, which is more than proven. Highlights of uses ofembedded-ioin the field (see more)embassy-nrfDMA-powered UART implembassy-stm32irq-driven UARTembassy-stm32DMA-powered UARTembassy-rpirq-driven UARTembassy-syncPipeembassy-netTcpSocketembedded-tlsTLS client, uses embedded-io to work on top of any TCP socket.reqwlessHTTP client, uses embedded-io to work on top of any TCP socket or on top ofembedded-tls.rust-mqtt, same.embedded-svcabstractions, widely used in the ESP32 ecosystem.embedded-nal-asyncmodels TCP sockets asRead+Write.es-wifi-driver, AT commands over uartesp8266-at-driver, AT commands over uart