flpgbti2c version 26070300
Tool to read or write from and to an I2C slave device (register)
through an lpGBT I2C Master connected to an FLX-device link.
NB: works for lpGBTv1 or v2 only, for the time being.
Usage:
 flpgbti2c -h|V -d<devnr> -D<dma> -G<link> -I<i2c> -f<freq>
           -m<master> -i<iaddr> -a|A<addr> -r<nbytes> -X -Z
           [<value-to-write>]
  -h         : Show this help text.
  -V         : Show version.
  -d <devnr> : FLX-device to use (default: 0).
  -D <dma>   : DMA controller number for receiving (default: 0).
  -G <link>  : lpGBT-link number.
  -I <i2c>   : lpGBT I2C address (hexadecimal; optional),
               if not provided probes addresses 0x70-0x77.
  -m <master>: I2C Master index (0,1 or 2; default:0).
  -f <freq>  : I2C bus frequency, in KHz
               (100,200,400 or 1000, default: 400).
  -i <iaddr> : I2C device address (hex).
  -a|A <addr>: I2C register address ('a':1-byte, 'A':2-byte).
               (decimal or '0x..' for hexadecimal).
  -L         : In case of 2-byte address (-A) LSByte first,
               e.g. for an lpGBT device (default: MSB first)
  -r <nbytes>: Number of register/data bytes,
               for now limited to 4 (default: 1).
  -X         : Debug mode: display bytes of received frames;
               also: continue, even when nothing is received
               (e.g. in combination with option -Z).
  -Z         : Do NOT receive and process/display replies.
 <value-to-write>: value to write (decimal or '0x..' for hexadecimal).

=> Examples (with lpGBTv1/v2 I2C address 0x70):
Read 2-byte register at address 6 (1-byte address)
from I2C device with I2C address 0x30 using lpGBT I2C Master 1:
  flpgbti2c -G3 -I70 -m1 -i30 -a6 -r2 

Read 1-byte register at address 6 (2-byte address)
from I2C device with I2C address 0x30 using lpGBT I2C Master 1:
  flpgbti2c -G3 -I70 -m1 -i30 -A6 -r1 

Write 0x1234 to 4-byte register at address 6 (2-byte address)
to I2C device with I2C address 0x30 using lpGBT I2C Master 1:
  flpgbti2c -G3 -I70 -m1 -i30 -A6 -r4 0x1234 
