I found a problem with the SMBus.py write_i2c_block_data definition. The command self.mcp2221.I2C_Write(addrs,[cmd,vals]) has a problem. Specifically, the parameter [cmd,vals] ends up sending a LIST of LISTS into the I2C_Write function and triggers the error "TypeError: 'list' object cannot be interpreted as an integer."
I changed the code to the following:
def write_i2c_block_data(self, addrs,cmd,vals):
vals.insert(0, cmd) # Insert the CMD into the beginning of the vals LIST.
self.mcp2221.I2C_Write(addrs,vals)
I found a problem with the SMBus.py write_i2c_block_data definition. The command self.mcp2221.I2C_Write(addrs,[cmd,vals]) has a problem. Specifically, the parameter [cmd,vals] ends up sending a LIST of LISTS into the I2C_Write function and triggers the error "TypeError: 'list' object cannot be interpreted as an integer."
I changed the code to the following:
This fixes the error.