ftd2xx icon indicating copy to clipboard operation
ftd2xx copied to clipboard

Support reading EEPROM from FT-X devices

Open krister-ts opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. To read EEPROM from FT-X devices, you must use FT_EEPROM_Read

Describe the solution you'd like Add this method.

Describe alternatives you've considered

Additional context

krister-ts avatar May 12 '22 23:05 krister-ts

@snmishra I have it working for my X series device. I'm not sure how it should be returned in the python method. Right now I just return a tuple of struct and strings.

I would copy eeReadEx if that was implemented... Maybe you could implement that and I can make the eepromRead method to keep the same output format?

krister-ts avatar May 13 '22 17:05 krister-ts

I'm curious @krister-ts . Since Python is perfectly happy with FT_EE_Read, what is the use case for FT_EE_ReadEx? Calling the function would be a bit clunky.

EDIT: never mind. I see FT_EEPROM_Read is the only API on some devices. I think adding ReadEx doesn't make sense. We can use whatever you have for FT_EEPROM_Read. What do you think?

snmishra avatar May 13 '22 21:05 snmishra

@snmishra That should be fine. It might not be a bad idea to add in some convenience that will use the right method for the device.

krister-ts avatar May 13 '22 21:05 krister-ts

What about an eeprom class with methods read, write, ua_read, ua_write? Will that work? It only needs to know device type and also have the handle. The device info is collected on init (FTD2XX class) so I don't see any issue there.

krister-ts avatar May 13 '22 22:05 krister-ts

@snmishra I noticed ProgramData class doesn't really seem to be used. Was it meant to be used as the return type of eeRead?

krister-ts avatar May 13 '22 22:05 krister-ts

@snmishra Maybe I should just make a typed dict for x series and we can add more chips as needed. No need to do more work than necessary.

krister-ts avatar May 13 '22 22:05 krister-ts