def _int_2_byte_array(self, value): ''' int value to byte array function, called inside. ''' byte_array = hi_functions.byteArray(value) for i in range(VDM001002Def.INT_2_BYTE_ARRAY_LEN - len(byte_array)): byte_array.append(VDM001002Def.INT_2_BYTE_ARRAY_FILLING_VAL) return byte_array
def _FLrd(self, handle, address): ''' Flash memory read 16_Byte from address ''' data_in = hi_functions.byteArray(address) for i in range(PhoenixDef.FLRD_WRITE_DATA_LEN - len(data_in)): data_in.append(0) device_rw.write_reg(handle, PhoenixDef.FLRD_WRITE_ADDR, data_in) device_rw.write_reg_4cc(handle, PhoenixDef.FLRD_WRITE_4CC_ADDR, 'FLrd') cmdret = hi_functions.verify_cmd_completed( handle, hi_functions.FLASH_HI_TIMEOUT) if (cmdret == "Success"): (count, data_out) = device_rw.read_reg(handle, PhoenixDef.FLRD_WRITE_ADDR, PhoenixDef.FLRD_CHECK_DATA_LEN) return data_out return cmdret