Skip to content

Rust backend: inject_adc, attach_i2c, attach_spi - #41

Merged
ShahriarAhnaf merged 1 commit into
agent/inject-can-7c21from
agent/inject-buses-7c21
Oct 6, 2026
Merged

ShahriarAhnaf merged 1 commit into
agent/inject-can-7c21from
agent/inject-buses-7c21

Conversation

@ShahriarAhnaf

Copy link
Copy Markdown
Contributor

Stacked on #40.

Sim(backend="rust") gains inject_adc(peripheral, channel, volts), attach_i2c(peripheral, address, device) and attach_spi(peripheral, device). The device is a Python object: I2C write(bytes) / read(n) -> bytes / optional stop(); SPI a callable mosi -> miso. An exception a device raises comes out of the next run_for / expect. The Renode backend raises NotSupported for all three, and an older Rust engine raises NotSupported. Docs tables updated.

Needs a Rust engine build that includes these. Unit tests use a fake engine; checked against a real engine with a bare-metal image (ADC codes, an SPI byte exchange and an I2C register read through Python devices).

🤖 Generated with Claude Code

Calls the engine's set_adc / attach_i2c / attach_spi; an older engine raises
NotSupported. Docs table updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ShahriarAhnaf
ShahriarAhnaf marked this pull request as ready for review October 6, 2026 19:04
@ShahriarAhnaf
ShahriarAhnaf merged commit 394fafd into agent/inject-can-7c21 Oct 6, 2026
4 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.

1 participant