Type Alias embedded_hal_mock::eh1::i2c::Mock

source ·
pub type Mock = Generic<Transaction>;
Available on crate feature eh1 only.
Expand description

Mock I2C implementation

This supports the specification and evaluation of expectations to allow automated testing of I2C based drivers. Mismatches between expectations will cause runtime assertions to assist in locating the source of the fault.

Aliased Type§

struct Mock { /* private fields */ }

Trait Implementations§

source§

impl ErrorType for Mock

§

type Error = ErrorKind

Error type
source§

impl I2c for Mock

source§

fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error>

Reads enough bytes from slave with address to fill read. Read more
source§

fn write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Self::Error>

Writes bytes to slave with address address. Read more
source§

fn write_read( &mut self, address: u8, bytes: &[u8], buffer: &mut [u8] ) -> Result<(), Self::Error>

Writes bytes to slave with address address and then reads enough bytes to fill read in a single transaction. Read more
source§

fn transaction<'a>( &mut self, address: u8, operations: &mut [Operation<'a>] ) -> Result<(), Self::Error>

Execute the provided operations on the I2C bus. Read more