In this utility you can read the i2c device registers in raw binary output and feed the write data via file.
- Linux machine,
- Cross-compiler
iQ-i2c.c
withGCC
"Welcome to iQ-i2c helper utility"
" Usages:"
" Read register:"
" [-opts] read <bus> <device> <register> <length> [raw]"
" 'raw' will dump the data as is, without this"
" option it will be printed in hex."
"
" Write register:
" [-opts] write <bus> <device> <register>|-> "
" {<path>|<hexbytes>}"
"
"
" <bus> - i2c-bus id 1-4"
" <device> - i2c device address in hex"
" <register> - i2c device address in hex (any length)"
" if specified as '-' the register is ignored."
" same format as <hexbytes>"
" <length> - length in bytes to read"
" raw - print data as is, else print as hex"
" <path> - file path with binary data"
" @<path> - file path with hex data"
" <hexbytes> - In the format hh x N, i.e:"
" c1ffc4d3abed02"
"
" [-opts] options:"
" -v - verbose"
" -r - raw binary output (not hex)"
" -f - force device access even if locked by driver"
You can read as mentioned below
" [-opts] read <bus> <device> <register> <length> [raw]"
" 'raw' will dump the data as is, without this"
" option it will be printed in hex"
You can feed the file by providing its path
" Write register:"
" [-opts] write <bus> <device> <register>|-> "
" {<path>|<hexbytes>}"