-
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
embedded-hal v1.0.0 and embedded-hal-bus #205
Comments
Could you please try with |
Changing Cargo.toml so I have
and
Then when I compile I get
I find it strange that there is "no Also, when I look at cargo tree, it looks like $ cargo tree |
embedded-hal-bus isn't a simple plug-and-play crate, you don't get an I2c struct that "just works". You need to decide on how you share your bus between your devices, and for that you have three options. Why do you expect display-interface-i2c to depend on embedded-hal-bus? embedded-hal-bus doesn't define any new traits that would require any special handling in display-interface-i2c. |
Thanks for the hint @bugadani . I guess it is more complicated than I thought. I'll eventually figure it out. Not exactly a simple replacement for My thinking on |
I am using @bugadani 's
ehal1
fork ofssd1306
to make some examples work withembedded-hal-1.0.0
. One of my main problems has been usingssd1306
withshared-bus
. (see stm32-rs/stm32f4xx-hal#722 (comment)). @rursprung pointed out thatembedded-hal-bus
is a replacement forshared-bus
, but so far I have not been able to get the trait formulation and other pieces correct. I am not sure if this is just my newbie understanding, or if something is needed inssd1306
. The documentaion is written for HAL and crate developers, not for naive users. (I need a working example.)With a local fork of @bugadani 's
ehal1
I have modifiedexample/text_i2c.rs
and added a few lines toCargo.toml
.Click to expand modified examples/text_i2c.rs
Click to expand Cargo.toml diff
Without trying to share the bus, the code compiles in
ssd1306
with bothstm32f4xx-hal
andstm32h7xx-hal
usingWhen I try to make changes for sharing the bus (see https://crates.io/crates/embedded-hal-bus and https://github.com/rust-embedded/embedded-hal/blob/master/docs/migrating-from-0.2-to-1.0.md#error-type-bounds ) I cannot get the correct formulation or the proper trait. Commented out in the code are many of the lines I think I need, but I have not had any success with a very large number of attempts. Suggestions would be appreciated.
The text was updated successfully, but these errors were encountered: