Registry / testing / embedded-hal-mock

embedded-hal-mock

JSON →
library0.11.1rscratesunverified

A collection of mocked devices that implement the embedded-hal traits.

# Cargo.toml [dependencies] embedded-hal-mock = "0.11.1"
INSTALL
IMPORT
SIG · EMBEDDED-HAL-MOCK
E
embedded-hal-mock
testingrustv0.11.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

I2cMock
use embedded_hal_mock::eh1::i2c::Mock as I2cMock;

Create a mock I2C device for testing embedded-hal code.

use embedded_hal_mock::eh1::i2c::{Mock as I2cMock, Transaction}; fn main() { let expectations = vec![ Transaction::write(0x42, vec![0x00]), Transaction::read(0x42, vec![0x01]), ]; let mut i2c = I2cMock::new(&expectations); // Use i2c in tests i2c.done(); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.11.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
embedded-hal-mock — cargo add embedded-hal-mock · libregistry