Skip to content
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

Async API? #1

Open
tazz4843 opened this issue Oct 7, 2023 · 3 comments
Open

Async API? #1

tazz4843 opened this issue Oct 7, 2023 · 3 comments

Comments

@tazz4843
Copy link

tazz4843 commented Oct 7, 2023

Would be great to see an async API wrapper option here. For some context on my use case: I'm looking to set up a weather station using this sensor. My main board is a Raspberry Pi Pico W, which requires special setup for the WiFi chip, and I'm using embassy for this, which is a fully async runtime.

@sirhcel
Copy link
Owner

sirhcel commented Oct 25, 2023

Hello @tazz4843, I'm not opposed to this but I have to admit that I did not have worked with embassy so far. Could you sketch out how an async API for this sensor should look like? Or do you have a good example of such an async API you could point me to?

Is diy-weather-station the project in question?

@tazz4843
Copy link
Author

embassy implements embedded-hal-async traits for all its HALs so such an API could match the sync API 1:1, just with an async implementation of the I2C bus instead. I haven't dug much into the code, but I doubt it would be difficult for me to make a PR if that's something you'd want.

Yes, that's the project in question, however most of the code is only locally on my computer and hasn't been updated on GitHub in a while.

@tazz4843
Copy link
Author

See #2

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

No branches or pull requests

2 participants