smbus/smbus.py
def read_i2c_block_data(self, addr, cmd, len=32):
        """read_i2c_block_data(addr, cmd, len=32) -> results

        Perform I2C Block Read transaction.
        """
        self._set_addr(addr)
        data = ffi.new("union i2c_smbus_data *")
        data.block[0] = len
        if len == 32:
            arg = SMBUS.I2C_SMBUS_I2C_BLOCK_BROKEN
        else:
            arg = SMBUS.I2C_SMBUS_I2C_BLOCK_DATA
        if SMBUS.i2c_smbus_access(self._fd,
                                  int2byte(SMBUS.I2C_SMBUS_READ),
                                  ffi.cast("__u8", cmd),
                                  arg, data):
            raise IOError(ffi.errno)
        return smbus_data_to_list(data)
def read_i2c_block_data(self, addr, cmd, len=32):
        """read_i2c_block_data(addr, cmd, len=32) -> results

        Perform I2C Block Read transaction.
        """
        self._set_addr(addr)
        data = ffi.new("union i2c_smbus_data *")
        data.block[0] = len
        if len == 32:
            arg = SMBUS.I2C_SMBUS_I2C_BLOCK_BROKEN
        else:
            arg = SMBUS.I2C_SMBUS_I2C_BLOCK_DATA
        if SMBUS.i2c_smbus_access(self._fd,
                                  int2byte(SMBUS.I2C_SMBUS_READ),
                                  ffi.cast("__u8", cmd),
                                  arg, data):
            raise IOError(ffi.errno)
        return smbus_data_to_list(data)
def read_i2c_block_data ( self , addr , cmd , len = 32 ) : self . _set_addr ( addr ) data = ffi . new ( "union i2c_smbus_data *" ) data . block [ 0 ] = len if len == 32 : arg = SMBUS . I2C_SMBUS_I2C_BLOCK_BROKEN else : arg = SMBUS . I2C_SMBUS_I2C_BLOCK_DATA if SMBUS . i2c_smbus_access ( self . _fd , int2byte ( SMBUS . I2C_SMBUS_READ ) , ffi . cast ( "__u8" , cmd ) , arg , data ) : raise IOError ( ffi . errno ) return smbus_data_to_list ( data )
read_i2c_block_data(addr, cmd, len=32) -> results

        Perform I2C Block Read transaction.
read_i2c_block_data ( addr cmd len = 32 ) - > results