I'd like to use I2C on a STM32L011D4P7 using Embassy. It needs to be a shared bus, too, as I have two I2C devices.
https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/shared_bus.rs is presented as an example (based on the RP2040), but
- StaticCell uses atomics that I don't have; the crate docs mention this and say that you need to import something that provides
critical-section, but I don't actually know how to do that. I already importcritical-section; how do I link them up?
This crate uses portable-atomic, so on targets without native atomics you must import a crate that provides a critical-section implementation. See the critical-section README for details.
- I'm not even halfway to implementing it, and running into the fact that
i2c::Asyncis private on the STM32 implementation
Am I missing some docs somewhere? Is there an example of the stm32 with shared-bus i2c's anywhere (or just i2c in general)? I feel like I'm missing something with how discordant these docs seem to be. Is there a better way to use the stm32 with Rust? The last library I tried (https://github.com/stm32-rs/stm32l0xx-hal) had examples where even the blink function had a dozen issues.
I'm fairly new to embedded dev in Rust, and the last project I did was with a relatively well-supported Arduino.