Difference between revisions of "Sigrok-cli"

From sigrok
Jump to navigation Jump to search
m
Line 60: Line 60:


* '''-f, --format <format>'''
* '''-f, --format <format>'''
Set the output format to use. This can be either 'b' or 'h', for binary or hexadecimal, optionally prefixed by a length argument specifying the number of samples (in bits). Thus '128h' would display 128 bits per line, in hexadecimal:
Set the output format to use. This can be either 'bin' or 'hex', for binary or hexadecimal, optionally followed by a length argument specifying the number of samples (in bits). Thus 'hex128' would display 128 bits per line, in hexadecimal:


  1:ffff ffff ffff ffff ffff ffff ffff ffff
  1:ffff ffff ffff ffff ffff ffff ffff ffff
  2:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
  2:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00


The lines always start with the probe number (or name, if defined), followed by a colon. If no format is specified, this defaults to '64b', like this:
The lines always start with the probe number (or name, if defined), followed by a colon. If no format is specified, it defaults to 'bin64', like this:


  1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
  1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
  2:11111111 00000000 11111111 00000000 11111111 00000000 11111111 00000000
  2:11111111 00000000 11111111 00000000 11111111 00000000 11111111 00000000

Revision as of 07:30, 25 March 2010

The command-line frontend cannot display graphical output, but is still sufficient to run through the whole process of hardware initialization, acquisition, protocol analysis and saving the session. It is useful for running on remote or embedded systems. It can display samples on standard output or save them in various file formats.

Arguments

Informational

  • -H, --list-hw-plugins

Output a list of all available hardware plugins.

  • -D, --list-devices

List devices found on the system.

  • -A, --list-analyzer-plugins

Output a list of all available protocol analysis plugins.

  • -V, --version

Show version.

Session control

  • -L, --load-session-file <filename>

Session file to load previously acquired data from. Any devices or protocols listed in the file will be reused, unless overridden by other commandline arguments.

  • -S, --save-session-file <filename>

Save session to file.

  • --seconds <sec>

Sample for <sec> seconds, then quit. TODO: Change to milliseconds.

  • --samples <num>

Acquire <num> samples, then quit.

  • -d, --device <string>

The device to use for acquisition, specified by ID as report by --list-devices.

  • -p --probes <string>

A comma-separated list of probes to be used in the session. The default is to use all the probes available on a device. You can name a probe, like this: '1=CLK'. A range of probes can also be given, in the form '1-5'. Thus a probe list given as '1=CLK,2-4' will give output like this:

CLK:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 
  2:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 
  3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 
  4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 
  • -t, --triggers <string>

A comma-separated list of triggers to use, of the form "<probe>=<trigger>". You can use the name or number of the probe, and the trigger itself is a series of characters:

  • 0 or 1: A 0 or 1 value on the pin.
  • r or f: A rising or falling value on the pin. An 'r' effectively corresponds to "01".
  • c: Any kind of change on a pin.

Not every device supports all of these trigger types. Use the "-d <device-id>" argument (with no other arguments) to see which triggers your device supports.

  • -a, --analyzers <string>

A string listing the sequence of protocol analysis plugins the signal should go through. Each element of the sequence consists of the plugin's name, with a pipe (|) symbol separating the elements.

Session options

  • -o, --device-option <option string>

Set a device-specific option. The argument takes the form of "option=value". Currently the only option supported is "samplerate", with the argument being the rate in MHz. This option can be used multiple times as needed.

  • -f, --format <format>

Set the output format to use. This can be either 'bin' or 'hex', for binary or hexadecimal, optionally followed by a length argument specifying the number of samples (in bits). Thus 'hex128' would display 128 bits per line, in hexadecimal:

1:ffff ffff ffff ffff ffff ffff ffff ffff
2:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00

The lines always start with the probe number (or name, if defined), followed by a colon. If no format is specified, it defaults to 'bin64', like this:

1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
2:11111111 00000000 11111111 00000000 11111111 00000000 11111111 00000000