Conversation
Remove the embedded-hal 0.2 dependency (previously marked 'TODO: remove this') and the blocking i2c Read/Write/WriteRead impls that forwarded to the inherent blocking_read/blocking_write/blocking_write_read methods. This was the only remaining use of eh 0.2 in the HAL. All drivers and examples already target embedded-hal 1.0 / embedded-hal-async 1.0, which provide the same functionality via embedded_hal::i2c::I2c and embedded_hal_async::i2c::I2c. Downstream code that still relies on the eh 0.2 trait impls should switch to the embedded-hal 1.0 traits. Note that embedded-hal 0.2.7 may still appear in dependency graphs transitively (e.g. via embassy-time), independently of this change. Verified: cargo build for all CI chip targets (ch32v103c8t6, ch32v203f8u6, ch32v208wbu6, ch32v303cbt6, ch32v305fbp6, ch32v307vct6, ch32x035f7p6, ch32l103c8t6, ch643 on riscv32imc; ch32v003f4u6, ch32v006k8u6, ch641 on riscv32i) and the i2c-using example crates (ch32v003 release, ch32v305, ch32v307).
ArthurHeymans
approved these changes
Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the
embedded-hal 0.2dependency and its last consumers: theembedded_hal_02::blocking::i2c::{Read, Write, WriteRead}impls insrc/i2c.rs. Pure deletion: −30 lines, no behavior change.Why
# TODO: remove this.blocking_read/blocking_write/blocking_write_readmethods; the same functionality is covered by the embedded-hal 1.0embedded_hal::i2c::I2cimpl (blocking mode) andembedded_hal_async::i2c::I2c(async mode), which are untouched.Breaking change
Downstream code that passed
I2cto drivers expecting eh 0.2 traits must switch to eh 1.0 (or use inherent methods /embassy-embedded-haladapters). Acceptable for a 0.x HAL.Note:
embedded-hal 0.2.xmay still appear in a resolver graph transitively (e.g. viaembassy-time); that is outside this HAL's control.Verification
Library, CI recipe (
cargo build --features <chip>,embassy,rt,memory-x --no-default-features --target <target>), zero errors on all matrix chips:ch32v103c8t6,ch32v203f8u6,ch32v208wbu6,ch32v303cbt6,ch32v305fbp6,ch32v307vct6,ch32x035f7p6,ch32l103c8t6,ch643(riscv32imc);ch32v003f4u6,ch32v006k8u6,ch641(riscv32i).Example crates that exercise I2C build clean:
ch32v003(--release, as in CI; includesembassy_i2c_shared_bus),ch32v305(blockingwrite_read),ch32v307(all bins, includingi2c-bmp180on eh-async).Cargo.lockunchanged. Commit is GPG-signed.Closes #204