Skip to content

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

Merged
merged 12 commits into from
Jul 12, 2023
Merged

Conversation

Dirbaio
Copy link
Member

@Dirbaio Dirbaio commented Jul 4, 2023

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:

  • Removed defmt impls, needed for 1.0.
  • Split embedded-io and embedded-io-async. Needed for 1.0, so we don't have to wait for AFIT to be stable.
  • Removed async adapters for tokio and futures. 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.
  • Added embedded-io::{ReadReady, WriteReady}. They're separate from the Read/Write traits since they can't be trivially implemented on top of std::io traits, so this would present a problem for the adapters. (It's likely implementable with e.g. some weird poll()/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-io crate has been around for more than 1 year, so it's somewhat "proven". The design is the same as std::io, which is more than proven. Highlights of uses of embedded-io in the field (see more)

@Dirbaio Dirbaio requested a review from a team as a code owner July 4, 2023 21:56
@Dirbaio Dirbaio force-pushed the io branch 3 times, most recently from fe08b3f to e5af237 Compare July 4, 2023 22:14
ryankurte
ryankurte previously approved these changes Jul 5, 2023
Copy link
Contributor

@ryankurte ryankurte left a 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
therealprof previously approved these changes Jul 11, 2023
Copy link
Contributor

@therealprof therealprof left a 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.

Copy link
Member

@eldruin eldruin left a 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.

@Dirbaio Dirbaio dismissed stale reviews from therealprof and ryankurte via efdccc2 July 12, 2023 10:48
@Dirbaio
Copy link
Member Author

Dirbaio commented Jul 12, 2023

adressed @eldruin 's review comments

This was referenced Jul 12, 2023
Copy link
Member

@eldruin eldruin left a 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.

@eldruin eldruin added this pull request to the merge queue Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants