def eeProgram(self, progdata=None, **kwargs): """Program the EEPROM with custom data. If SerialNumber is null, a new serial number is generated from ManufacturerId""" if progdata is None: progdata = _ft.ft_program_data(**kwargs) ## if self.devInfo['type'] == 4: ## version = 1 ## elif self.devInfo['type'] == 5: ## version = 2 ## else: ## version = 0 progdata.Signature1 = _ft.DWORD(0) progdata.Signature2 = _ft.DWORD(0xffffffff) progdata.Version = _ft.DWORD(2) call_ft(_ft.FT_EE_Program, self.handle, progdata) return None
def eeRead(self): """Get the program information from the EEPROM""" ## if self.devInfo['type'] == 4: ## version = 1 ## elif self.devInfo['type'] == 5: ## version = 2 ## else: ## version = 0 progdata = _ft.ft_program_data(Signature1=0, Signature2=0xffffffff, Version=2, Manufacturer=c.cast(c.c_buffer(256), c.c_char_p), ManufacturerId=c.cast(c.c_buffer(256), c.c_char_p), Description=c.cast(c.c_buffer(256), c.c_char_p), SerialNumber=c.cast(c.c_buffer(256), c.c_char_p)) call_ft(_ft.FT_EE_Read, self.handle, c.byref(progdata)) return progdata