eeprog - Man Page

reads and writes 24Cxx EEPROMs connected to I2C serial bus

Synopsis

eeprog [-fqxdh] [-16|-8] [-r addr[:count]|-w addr] <device> <i2c-addr>

Description

eeprog uses the SMBus protocol used by most of the recent chipsets.

Note

Don't forget to load your i2c chipset and the i2c-dev drivers.

The following environment variables could be set instead of the command line arguments:

   EEPROG_DEV              device
   EEPROG_I2C_ADDR         i2c-addr

Parameters

Address modes

-8

Use 8bit address mode for 24c0x...24C16 [default]

-16

Use 16bit address mode for 24c32...24C256

Actions
-r addr[:count]

Read count (1 if omitted) bytes from addr and print them to the standard output

-w addr

Write input (stdin) at address addr of the EEPROM

-h

Print this help

Options
-x

Set hex output mode

-d

Dummy mode, display what *would* have been done

-f

Disable warnings and don't ask confirmation

-q

Quiet mode

Bus
device

Device file representing the I2C bus (eg. /dev/i2c-0)

i2c-addr

I2C bus address of the EEPROM (eg. 0x3A)

Examples

Read 64 bytes from the EEPROM at address 0x54 on bus 0 starting at address 123 (decimal)

eeprog /dev/i2c-0 0x54 -r 123:64

Print the hex codes of the first 32 bytes read from bus 1 at address 0x22

eeprog /dev/i2c-1 0x51 -x -r 0x22:0x20

Write the current timestamp at address 0x200 of the EEPROM on bus 0 at address 0x33

date | eeprog /dev/i2c-0 0x33 -w 0x200

Author

Stefano Barbato

Info

Jul 2013 i2c-tools System Administration