Skip to content

Please add support for embedded-hal-async #5

Open
@quentinmit

Description

@quentinmit

The I2c trait from embedded-hal-async would allow this crate's usage with embassy.

Unfortunately, I can only think of hacky solutions to support both blocking and async:

  • Make a second copy of all the functions, doing the rote fn -> async fn transformation and sprinkling in some .await calls
  • Macro magic to define two copies using the same source

and then another question is:

  • Keep the same type names and swap in async using a feature, or
  • Expose the methods on a different type or in a different module (still feature-gated).

I asked in rust-embedded/embedded-hal#356 if there's any best practice here. I think most of the other crates I've seen have gone for some form of duplicate code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions