fec version 21032300
Demo tool for control and read out of various devices on a GBT-SCA
through a GBT link's EC channel or any 2-bit wide, HDLC encoded E-link.
Receives (and displays) GBT-SCA replies, unless option -Z is given
(in that case use e.g. fedump or fdaq to receive the replies).
Usage:
 fec [-h|V] [-d <devnr>] [-i <dma>] [-I] [-N] [-G <lnk>] [-g <group>] [-p <path>]
     [-t <ms>] [-x <par>] [-A] [-C] [-R] [-T] [-P <secs>] [-X] [-Y <seq>] [-Z] [<ops>]
  -h         : Show this help text.
  -V         : Show version.
  -d <devnr> : FLX-device to use (default: 0).
  -i <dma>   : FLX-device DMA controller for receiving (default: 0).
  -I         : USE interrupt to receive data (default: polling)
  -N         : Receiver resets DMA at start-up (default: no reset).
  -G <lnk>   : GBT-link number (default: 0).
  -g <group> : Group number (default matches GBT EC 'group' = 7).
  -p <path>  : E-path number (default matches GBT EC 'path' = 7).
  -r <repeat>: Number of GPIO/ADC/DAC operations to perform (default: 1).
  -A         : Use SCA-V1 ADC commands (default: SCA-V2 ADC).
  -C         : Send GBT-SCA connect (HDLC control).
  -R         : Send GBT-SCA reset (HDLC control).
  -T         : Send GBT-SCA test (HDLC control).
  -t <ms>    : Time between some of the ops, in ms (default: 100).
  -P <secs>  : Enable FromHost (circular) DMA then pause for <secs> seconds
               (for DMA check/debug; default: no pause)
  -X         : Use single-shot DMA for upload (default: continuous).
  -x <par>   : Parameter to use in operations, e.g. GPIO number, ADC or DAC channel (default: 0).
  -Y <seq>   : Use <seq> as first HDLC 'receive sequence number'.
               (to keep receiving side happy in consecutive calls)
  -Z         : Do NOT receive and display the GBT-SCA replies.
  <ops>      : String of chars indicating which operation(s) to perform:
               o=GPIO-out, i=GPIO-in, a=ADC, d=DAC, I=I2C (no-string=default: none).
Examples:
Blink an LED on a VLDB (here connected to GBT link #3, EC-channel)
on GBT-SCA GPIO #18 (the other LED is on GPIO #21) 20 times
with a rate of 5Hz (100ms ON, 100ms OFF):
  fec -G3 -t100 -r20 -x18 o
Read GPIO inputs (GBT-SCA on GBT-link #3's EC-channel) 20 times
with a rate of 10Hz:
  fec -G3 -t100 -r20 i
