]> sigrok.org Git - sigrok-cli.git/blob - doc/sigrok-cli.1
bbd138de82c0d39be7c37b0b4114f4ab8a3c7ae2
[sigrok-cli.git] / doc / sigrok-cli.1
1 .TH SIGROK\-CLI 1 "January 19, 2011"
2 .SH "NAME"
3 sigrok\-cli \- Command-line client for the sigrok logic analyzer software
4 .SH "SYNOPSIS"
5 .B sigrok\-cli \fR[\fB\-hVDiIodptwaf\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-D\fR|\fB\-\-list\-devices\fR] [\fB\-i\fR|\fB\-\-input\-file\fR filename] [\fB\-I\fR|\fB\-\-input\-format\fR format] [\fB\-o\fR|\fB\-\-output\-file\fR filename] [\fB\-d\fR|\fB\-\-device\fR device] [\fB\-p\fR|\fB\-\-probes\fR probelist] [\fB\-t\fR|\fB\-\-triggers\fR triggerlist] [\fB\-w\fR|\fB\-\-wait\-triggers\fR] [\fB\-a\fR|\fB\-\-protocol\-decoders\fR sequence] [\fB\-f\fR|\fB\-\-format\fR format] [\fB\-\-time\fR ms] [\fB\-\-samples\fR numsamples] [\fB\-\-continuous\fR]
6 .SH "DESCRIPTION"
7 .B sigrok\-cli
8 is a cross-platform command line utility for the
9 .B sigrok
10 logic analyzer software.
11 .PP
12 The command-line frontend for sigrok cannot display graphical output, but is
13 still sufficient to run through the whole process of hardware initialization,
14 acquisition, protocol analysis and saving the session.
15 .PP
16 It is useful for running on remote or embedded systems, netbooks, PDAs,
17 and for various other use-cases. It can display samples on standard output or
18 save them in various file formats.
19 .SH "OPTIONS"
20 .TP
21 .B "\-V, \-\-version"
22 Show version, driver and module information.
23 .TP
24 .B "\-h, \-\-help"
25 Show a help text and exit.
26 .TP
27 .B "\-D, \-\-list\-devices"
28 List all logic analyzer devices found on the system.
29 .TP
30 .BR "\-i, \-\-input\-file " <filename>
31 Load input from a file instead of a device. If the
32 .B \-\-input\-format
33 option is not supplied, sigrok-cli attempts to autodetect the file format of
34 the input file.
35 .TP
36 .BR "\-I, \-\-input\-format " <format>
37 When loading an input file, assume it's in the specified format. If this
38 option is not supplied (in addition to
39 .BR \-\-input\-file ),
40 sigrok-cli attempts to autodetect the file format of the input file.
41 .TP
42 .BR "\-o, \-\-output\-file " <filename>
43 Save output to a file instead of writing it to stdout. The default format
44 used when saving is the sigrok session file format. This can be changed with
45 the
46 .B \-\-format
47 option, below.
48 .TP
49 .BR "\-d, \-\-device " <device>
50 The device to use for acquisition. It can be specified by ID as reported by
51 .BR "\-\-list\-devices" ,
52 or by the name of the driver as reported by
53 .BR \-\-version .
54 .sp
55 A device can optionally be followed by a colon-separated list of device
56 options, where each option takes the form
57 .BR key=value .
58 For example, to set the samplerate on the first device you might specify
59 .sp
60 .RB "  $ " "sigrok\-cli \-d 0:samplerate=1m"
61 .sp
62 Samplerate is a option common to most devices. The argument specifies the
63 samplerate in Hz. You can also specify the samplerate in kHz, MHz or GHz.
64 The following are all equivalent:
65 .sp
66 .RB "  $ " "sigrok\-cli \-\-samples 100 \-d 0:samplerate=1000000"
67 .sp
68 .RB "  $ " "sigrok\-cli \-\-samples 100 \-d 0:samplerate=1m"
69 .sp
70 .RB "  $ " "sigrok\-cli \-\-samples 100 \-d ""0:samplerate=1 MHz""
71 .TP
72 .BR "\-p, \-\-probes " <probelist>
73 A comma-separated list of probes to be used in the session.
74 .sp
75 The default is to use all the probes available on a device. You can name
76 a probe like this:
77 .BR "1=CLK" .
78 A range of probes can also be given, in the form
79 .BR "1\-5" .
80 .sp
81 Example:
82 .sp
83  $
84 .B "sigrok\-cli \-\-samples 100 \-\-probes 1=CLK,2\-4,7"
85 .br
86  CLK:11111111 11111111 11111111 11111111 [...]
87    2:11111111 11111111 11111111 11111111 [...]
88    3:11111111 11111111 11111111 11111111 [...]
89    4:11111111 11111111 11111111 11111111 [...]
90    7:11111111 11111111 11111111 11111111 [...]
91 .sp
92 The comma-separated list is processed from left to right, i.e. items farther
93 to the right override previous items. For example
94 .B "1=CS,1=MISO"
95 will set the name of probe 1 to
96 .BR "MISO" .
97 .sp
98 Also, while
99 .B "5=MOSI,6=MISO"
100 will only select probes 5 and 6, and set their names to MISO and MOSI, the
101 command line
102 .B "5=MOSI,6=MISO,1\-8"
103 will select probes 1\-8 (including 5 and 6, of course), but the names specified
104 for probes 5 and 6 will be reset to the defaults by the
105 .B "1\-8"
106 probe selection.
107 .TP
108 .BR "\-t, \-\-triggers " <triggerlist>
109 A comma-separated list of triggers to use, of the form
110 .BR "<probe>=<trigger>" .
111 You can use the name or number of the probe, and the trigger itself is a
112 series of characters:
113 .sp
114 .BR "0 or 1" :
115 A low or high value on the pin.
116 .br
117 .BR "r or f" :
118 A rising or falling value on the pin. An
119 .B r
120 effectively corresponds to
121 .BR 01 .
122 .br
123 .BR "c" :
124 Any kind of change on a pin.
125 .sp
126 Not every device supports all of these trigger types. Use the
127 .B "\-d <device>"
128 argument (with no other arguments) to see which triggers your device supports.
129 .TP
130 .BR "\-w, \-\-wait-trigger"
131 Don't output any sample data (even if it's actually received from the logic
132 analyzer) before the trigger condition is met. In other words, do not output
133 any pre-trigger data. This option is useful if you don't care about the data
134 that came before the trigger (but the logic analyzer hardware delivers this
135 data to sigrok nonetheless).
136 .TP
137 .BR "\-f, \-\-format " <formatname>
138 Set the output format to use. Use the
139 .B \-V
140 option to see a list of available output formats. The format name may
141 optionally be followed by a colon-separated list of options, where each
142 option takes the form
143 .BR "key=value" .
144 .sp
145 Supported formats currently include
146 .BR bits ,
147 .BR hex ,
148 .BR ascii ,
149 .BR binary ,
150 .BR vcd ,
151 .BR ols ,
152 .BR gnuplot ", and"
153 .BR analog .
154 .sp
155 The
156 .B bits
157 or
158 .B hex
159 formats, for an ASCII bit or ASCII hexadecimal display, can take a "width" option, specifying the number of samples (in bits) to display per line. Thus
160 .B hex:width=128
161 will display 128 bits per line, in hexadecimal:
162 .sp
163  1:ffff ffff ffff ffff ffff ffff ffff ffff
164  2:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
165 .sp
166 The lines always start with the probe number (or name, if defined), followed by a colon. If no format is specified, it defaults to
167 .BR bits:width=64 ,
168 like this:
169 .sp
170  1:11111111 11111111 11111111 11111111 [...]
171  2:11111111 00000000 11111111 00000000 [...]
172 .TP
173 .BR "\-\-time " <ms>
174 Sample for
175 .B <ms>
176 milliseconds, then quit. You can optionally follow the number by
177 .B s
178 to state the number of seconds to sample instead. For example,
179 .B "\-\-time 2s"
180 will sample for two seconds.
181 .TP
182 .BR "\-\-samples " <numsamples>
183 Acquire
184 .B <numsamples>
185 samples, then quit.
186 .TP
187 .BR "\-\-continuous"
188 Sample continuously until stopped. Not all devices support this.
189 .SH "EXAMPLES"
190 In order to get exactly 100 samples from the (only) detected logic analyzer
191 hardware, run the following command:
192 .TP
193 .B "  sigrok\-cli \-\-samples 100"
194 .TP
195 If you want to sample data for 3 seconds, use:
196 .TP
197 .B "  sigrok\-cli \-\-time 3000"
198 .TP
199 Alternatively, you can also use:
200 .TP
201 .B "  sigrok\-cli \-\-time 3s"
202 .TP
203 To capture data from 4 probes lasting 100ms at 10 MHz starting at the trigger condition 1:high, 2:rising, 3:low, 4:high, use:
204 .TP
205 .B "  sigrok\-cli \-f bits \-p 1\-4 \-\-time 100 \-o samplerate=10m \\\\"
206 .B "      \-\-wait\-trigger \-\-triggers 1=1,2=r,3=0,4=1 "
207 .SH "EXIT STATUS"
208 .B sigrok\-cli
209 exits with 0 on success, 1 on most failures.
210 .SH "SEE ALSO"
211 \fBsigrok\-qt\fP(1),
212 \fBsigrok\-gtk\fP(1)
213 .SH "BUGS"
214 Please report any bugs on the sigrok\-devel mailing list
215 .RB "(" sigrok\-devel@lists.souceforge.net ")."
216 .SH "LICENSE"
217 .B sigrok\-cli
218 is covered by the GNU General Public License (GPL). Some portions are
219 licensed under the "GPL v2 or later", some under "GPL v3 or later".
220 .SH "AUTHORS"
221 Please see the individual source code files.
222 .PP
223 This manual page was written by Uwe Hermann <uwe@hermann\-uwe.de>.
224 It is licensed under the terms of the GNU GPL (version 2 or later).