#!/usr/bin/python3 from PyHT6022.LibUsbScope import Oscilloscope scope = Oscilloscope() scope.setup() scope.open_handle() scope.flash_firmware() print( "FW version", hex( scope.get_fw_version() ) ) # read 1st 8 bytes eeprom = scope.read_eeprom( 0, 8 ) # print( eeprom ) # EE_SIZE = 128 # 16 KByte 24C128 EE_SIZE = 2 # 256 Byte 24C02 # clear eeprom empty = bytearray( 128 ) adr = 0 while adr < EE_SIZE * 128: print( "Erase", hex(adr) ) scope.write_eeprom( adr, empty ) adr += 128 # get the Hantek6021 id f = open( "eeprom_6021.dat", "rb" ) hantek_id = (f.read()) f.close() for b in hantek_id:
__author__ = 'Jochen Hoenicke' from PyHT6022.LibUsbScope import Oscilloscope scope = Oscilloscope() scope.setup() scope.open_handle() eeprom = scope.read_eeprom(0, 256) scope.close_handle() print eeprom.encode('hex')
#!/usr/bin/python3 __author__ = 'Jochen Hoenicke' from PyHT6022.LibUsbScope import Oscilloscope scope = Oscilloscope() scope.setup() scope.open_handle() # read at end-16, 8 bytes eeprom = scope.read_eeprom(256 - 16, 8) # write at end-8 scope.write_eeprom(256 - len(eeprom), eeprom) scope.close_handle() print(eeprom)