Esempio n. 1
0
def test_smbus_io():
    bus = MockSMBus(1)
    bus.write_i2c_block_data(0x00, 0x00, [0xff, 0x00, 0xff])
    assert bus.read_i2c_block_data(0x00, 0x00, 3) == [0xff, 0x00, 0xff]
Esempio n. 2
0
 def write_i2c_block_data(self, i2c_address, register, values):
     # Prevent the reset bit from being written
     # simulating an immediate soft reset success
     if register == 0x09:
         values[0] &= ~0b01000000
     MockSMBus.write_i2c_block_data(self, i2c_address, register, values)