-
Notifications
You must be signed in to change notification settings - Fork 5
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
Wrong example, not working #15
Comments
I tested it again and for me the auto-completion worked. You can try reloading the workspace in the rust-analyser extension. How do you create the i2c variable? |
It is possible that maybe my i2c is not compatible with the trait wanted by the library? use stm32f1xx_hal::{
i2c::{BlockingI2c, DutyCycle, Mode},
prelude::*,
stm32,
};
let i2c = BlockingI2c::i2c1(
dp.I2C1,
(scl, sda),
&mut afio.mapr,
Mode::Fast {
frequency: 400_000.Hz(),
duty_cycle: DutyCycle::Ratio2to1,
},
clocks,
1000,
10,
1000,
1000,
); I'm just using the plain i2c from the stm32 HAL |
The hal you are using is using the old A workaround would be to write a wrapper around the i2c impl which impls the new |
Oh ok so its actually the stm32 HAL that is using an old embedded_hal? i actually did not notice that. |
Yes, that's correct. I hope the workaround will work, or the PR is merged soon. |
So im writing a firmware for STM32 in rust using this sensor, there is something wrong in the lib. Following the example (disabled std feature of course), once created the object it does not have all the fields and methods that it should:
The text was updated successfully, but these errors were encountered: