-
Notifications
You must be signed in to change notification settings - Fork 72
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
Using an async I2C instance errors on I2CDisplayInterface::new()
#215
Comments
Fwiw you can use the I2C interface directly by doing e.g. Creating a Async version with maybe_async_cfg should be trivial; The other option is to just drop the trait bound, though that would push the error down to later in the code if it doesn't do i2c (or async i2c) |
unfortunately, using I2CInterface doesn't seem to work either (unless I'm missing something) as this does not satisfy the other trait bound. |
This worked for me which might help you @Sycrosity code
|
ssd1306
in use (if applicable): v0.9.0Description of the problem/feature request/other
When using an asynchronous I2C instance to initialise
I2CDisplayInterface
, (such asesp_hal::i2c::I2C<'static, esp_hal::peripherals::I2C0, Async>,
), which implementsembedded_hal_async::i2c::I2c
rather thanembedded_hal::i2c::I2c
, an error occurs.I wrote an implimentation in embedevices-rs/ssd1306 which creates the trait bounds for this, except it doesn't account for people using the library without async. Maybe an async version of
I2CDisplayInterface
(e.g.I2CDisplayInterfaceAsync
) or additional trait bounds which are enabled when theasync
feature is enabled would fix this issue?While this error isn't particularly readable, it shows the problem:
The text was updated successfully, but these errors were encountered: