Struct embedded_hal_mock::i2c::Mock[][src]

pub struct Mock<'a> { /* fields omitted */ }

Mock I²C implementation

The main idea behind this is that you set the data that will be read back by a read call in advance. Then the driver can read from the mock device, and will get exactly the data you prepared.

See the usage section in the module level docs for an example.

Methods

impl<'a> Mock<'a>
[src]

Set data that will be read by read().

Return the data that was written by the last write command.

Return the address that was used by the last read or write command.

Trait Implementations

impl<'a> Read for Mock<'a>
[src]

Error type

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

impl<'a> Write for Mock<'a>
[src]

Error type

Sends bytes to slave with address addr Read more

impl<'a> WriteRead for Mock<'a>
[src]

Error type

Sends bytes to slave with address addr and then reads enough bytes to fill buffer in a single transaction Read more

Auto Trait Implementations

impl<'a> Send for Mock<'a>

impl<'a> Sync for Mock<'a>