Type Alias embedded_hal_mock::eh0::i2c::Mock

source ·
pub type Mock = Generic<Transaction>;
Available on crate feature eh0 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 WriteIter for Mock

§

type Error = MockError

Error type
source§

fn write<B>(&mut self, address: u8, bytes: B) -> Result<(), Self::Error>
where B: IntoIterator<Item = u8>,

Writes bytes to slave with address address Read more
source§

impl WriteIterRead for Mock

§

type Error = MockError

Error type
source§

fn write_iter_read<B>( &mut self, address: u8, bytes: B, buffer: &mut [u8] ) -> Result<(), Self::Error>
where B: IntoIterator<Item = u8>,

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

impl Read for Mock

§

type Error = MockError

Error type
source§

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

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

impl Write for Mock

§

type Error = MockError

Error type
source§

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

Writes bytes to slave with address address Read more
source§

impl WriteRead for Mock

§

type Error = MockError

Error type
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 buffer in a single transaction Read more