Skip to content

Fix CH32V203 I2C slave lowering - #73

Merged
Alan-Jowett merged 2 commits into
mainfrom
fix/ch32v203-i2c-slave-lowering
Jul 30, 2026
Merged

Fix CH32V203 I2C slave lowering#73
Alan-Jowett merged 2 commits into
mainfrom
fix/ch32v203-i2c-slave-lowering

Conversation

@Alan-Jowett

Copy link
Copy Markdown
Owner

Summary

  • correct CH32V203 I2C slave initialization ordering so PE is enabled before ACK
  • regenerate the Embassy I2C HAL and retain the async master interpolation fix
  • simplify master/slave hardware smokes and report received register/value pairs over CDC

Validation

  • cargo test generate_embassy_uses_raw_wch_pfic_irq_indices`n- release builds for the SHT40 control, I2C master, and I2C slave smokes
  • hardware-validated repeated slave ISR packet reception using the generated init_slave() and set_own_address_7bit(0x42) paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 30, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes CH32V203 I2C slave initialization and refines generated Embassy I2C support, including an async master bus-idle wait improvement, while simplifying the I2C master/slave hardware smoke binaries (with the slave smoke now reporting observed register/value pairs over USB CDC).

Changes:

  • Update generated async I2C master helpers to await bus-idle using the async wait mechanism (instead of a blocking spin wait).
  • Correct CH32V203 I2C slave init semantics/order (PE before ACK) and adjust own-address ADD0 handling in evidence + generated HAL.
  • Simplify I2C master/slave smoke binaries; slave smoke now streams received register/value pairs over CDC.

Reviewed changes

Copilot reviewed 2 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main.rs Updates Embassy I2C codegen for async bus-idle waiting; strengthens generator output assertions.
evidence/wch/ch32v203g6u6/hair.json Adjusts semantic operation descriptions for slave init ordering and ADD0 handling.
evidence/wch/ch32v203g6u6/generated/embassy/src/i2c.rs Regenerated Embassy I2C HAL reflecting async bus-idle waits and corrected slave init/address behavior.
evidence/wch/ch32v203g6u6/generated/embassy-i2c-slave-slave-smoke/src/main.rs Reworks slave smoke to use USB CDC logging and ISR-captured register/value reporting.
evidence/wch/ch32v203g6u6/generated/embassy-i2c-slave-slave-smoke/Cargo.toml Adds USB + heapless deps needed for CDC logging in the slave smoke.
evidence/wch/ch32v203g6u6/generated/embassy-i2c-slave-slave-smoke/Cargo.lock Lockfile updates for new slave smoke dependencies.
evidence/wch/ch32v203g6u6/generated/embassy-i2c-slave-master-smoke/src/main.rs Simplifies master smoke to periodically send an I2C request (no USB logging).
evidence/wch/ch32v203g6u6/generated/embassy-i2c-slave-master-smoke/Cargo.toml Removes USB-related deps/features from master smoke.
evidence/wch/ch32v203g6u6/generated/embassy-i2c-slave-master-smoke/Cargo.lock Lockfile updates reflecting removed master smoke dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main.rs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 30, 2026 22:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 9 changed files in this pull request and generated no new comments.

@Alan-Jowett
Alan-Jowett merged commit 510f832 into main Jul 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants