-
Notifications
You must be signed in to change notification settings - Fork 254
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
Implement the embedded-hal-async
Traits once stabilized
#70
Comments
Commented on the wrong issue 😄 |
I think we could and should do this in a separate crate which will use esp-hal under the hood. That way
For I2C and SPI we will need interrupt support which we don't have yet. But probably we could implement delay and wait for digital inputs any time since we have support for it |
I tried something here: https://github.com/bjoernQ/esp32c3-async-rs-experiment |
Cool, thanks for sharing! Should we just add an |
Didn't even think about that - probably a good idea. I'm just not sure if we want one Async-HAL with features for each chip or one Async-HAL for each chip (similar to what we have for |
Working on |
|
Working on |
Async SPI (except spi device) implemented in #385 |
I'm planning to start working on |
@JurajSadel Any progress here? I'm looking into working on this and would be happy to pick up any work in progress and/or hear any insight. |
Hi, @konkers I haven't spent much time on this yet. Feel free to pick it up. |
@konkers Do you have any update regarding async i2c? |
Marking |
@JurajSadel I didn't make too much progress before getting sidetracked. I did some initial digging into the code. The i2c driver doesn't have interrupt support and the current code relies on busy waiting to feed/drain the fifo. The i2c peripheral does not support DMA so the code would need to be refactored into something a bit more state machine like in order to feed/drain the fifo in response the the appropriate fifo interrupts. That's all before adding any of the async support. I'm heading out on vacation next week and may take my esp32 c3 rust board with me to hack on this. |
Working on |
Is there a way to use this with esp-hal-common at the moment? I would like to pass something that implements I presume that using both, alpha.9 and alpha.10 at the same time is not an option. But maybe someone know a workaround? Details
|
@MabezDev did you ever make any progress with |
@jessebraham back-burnered, I didn't really make a start so feel free to take over :) |
I'm working on |
Forgot to comment but I'm working on |
Hello, Another point that they've mentioned is using See this comment for more details: rust-embedded/embedded-hal#349 (comment) |
Thanks for adding that, we do have a separate tracking issue already for other peripherals: #361 I suppose we should identify which peripherals should/can have async drivers and list them there, though. Haven't updated it in awhile 😁 |
Just as a small update, there is talk of removing the |
I believe it's still too early to begin work on this, but once a stable release (or at the very least a more stable alpha release) is available we can revisit this topic.In
embedded-hal-async@0.2.0-alpha.1
the traits to implement are:embedded_hal_async::delay::DelayUs
embedded_hal_async::digital::Wait
embedded_hal_async::i2c::I2c
embedded_hal_async::spi::SpiBus
embedded_hal_async::spi::SpiBusFlush
embedded_hal_async::spi::SpiBusRead
embedded_hal_async::spi::SpiBusWrite
embedded_hal_async::spi::SpiDevice
embedded_hal_async::spi::SpiDeviceRead
embedded_hal_async::spi::SpiDeviceWrite
embedded_hal_async::serial::Write
The text was updated successfully, but these errors were encountered: