Struct trellis::mock::MockDevice [] [src]

pub struct MockDevice {
    // some fields omitted
}

A I2CMasterDevice implementation that exists solely for testing. The MockDevice delegates writes and reades to the supplied callback functions/data that are used in tests for checking the correct device communication.

Methods

impl MockDevice
[src]

fn new_write_only(write_block_cb: WriteCb) -> MockDevice

fn new_read_only(read_block_data: Vec<u8>) -> MockDevice

fn new(write_block_cb: WriteCb, read_block_data: Vec<u8>) -> MockDevice

Trait Implementations

impl I2CMasterDevice for MockDevice
[src]

fn write_block(&mut self, register: u8, values: &[u8]) -> Result<()>

fn read_block(&mut self, _register: u8, _len: u8) -> Result<Vec<u8>>