More sophisticated example, showing 8/16Bit eeprom read/write/erase. May be used as fully working i2c tool also. #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
./i2c-eeprom.py -h
usage: i2c-eeprom [-h] [-a <8 / 16>] -s -p [-e]
[-r ] [-w ] [-d <0-7>] [-c <0-524288>]
[-o <0-524287>]
[-S <ONE_HUNDRED_KHZ / FOUR_HUNDRED_KHZ/ ONE_MHZ>]
[-i <vendor_id:product_id>] [-I <A/B/C/D>] [-v]
i2c-eeprom utility based on python-mpsse
optional arguments:
-h, --help show this help message and exit
-a <8 / 16>, --addressbits <8 / 16>
addresstype (8 / 16), default to 8bits for <=16kbit
size, 16bits for eeprom > 16kbit
-s , --size
eeprom size in bytes
-p , --pagesize
count of bytes per page
-e, --erase erase eeprom (to FFh Values)
-r , --read
read eeprom to
-w , --write
write to eeprom
-d <0-7>, --eeprom-id <0-7>
3bit device-address of eeprom, hardwired, default = 0
-c <0-524288>, --count <0-524288>
number of bytes to read in read-mode. default = full
eeprom-size
-o <0-524287>, --offset <0-524287>
bytenumber to start reading at. default = 0
-S <ONE_HUNDRED_KHZ / FOUR_HUNDRED_KHZ/ ONE_MHZ>, --speed <ONE_HUNDRED_KHZ / FOUR_HUNDRED_KHZ/ ONE_MHZ>
I2C bus frequency. default = 100000KHz
-i <vendor_id:product_id>, --devicecode <vendor_id:product_id>
Vendor_ID:Product_ID default = 0403:6010
-I <A/B/C/D>, --interface <A/B/C/D>
Interface to use (if FTDI-device has multiple UART-
interfaces). default = A
-v, --verbose increase output verbosity