]>
Commit | Line | Data |
---|---|---|
3d1dae3c | 1 | .TH SIGROK\-CLI 1 "March 28, 2019" |
43e5747a | 2 | .SH "NAME" |
53155b2f | 3 | sigrok\-cli \- Command-line client for the sigrok software |
43e5747a | 4 | .SH "SYNOPSIS" |
53155b2f | 5 | .B sigrok\-cli [OPTIONS] [COMMAND] |
43e5747a | 6 | .SH "DESCRIPTION" |
10d98b47 UH |
7 | \fBsigrok\-cli\fP is a cross-platform command line utility for the |
8 | \fBsigrok\fP software. | |
43e5747a | 9 | .PP |
10d98b47 UH |
10 | It cannot display graphical output, but is still sufficient to run through |
11 | the whole process of hardware initialization, acquisition, protocol decoding | |
12 | and saving the session. | |
43e5747a UH |
13 | .PP |
14 | It is useful for running on remote or embedded systems, netbooks, PDAs, | |
15 | and for various other use-cases. It can display samples on standard output or | |
16 | save them in various file formats. | |
53155b2f | 17 | .SH OPTIONS |
43e5747a | 18 | .TP |
43e5747a UH |
19 | .B "\-h, \-\-help" |
20 | Show a help text and exit. | |
21 | .TP | |
7949dca0 UH |
22 | .B "\-V, \-\-version" |
23 | Show | |
3df03cc2 | 24 | .B sigrok\-cli |
6293db8a UH |
25 | version and the versions of libraries used. |
26 | .TP | |
3df03cc2 | 27 | .B "\-L, \-\-list\-supported" |
6293db8a | 28 | Show information about supported hardware drivers, input file |
7949dca0 UH |
29 | formats, output file formats, and protocol decoders. |
30 | .TP | |
3d1dae3c UH |
31 | .B "\-\-list\-supported\-wiki" |
32 | Show information about supported protocol decoders in MediaWiki syntax. | |
33 | This is generally only used by developers to easily update the list of | |
34 | supported protocol decoders in the sigrok wiki. | |
35 | .TP | |
b5ac81ad | 36 | \fB\-d, \-\-driver\fP <drivername> |
3d1dae3c UH |
37 | Unless doing a global scan, users typically select one of the available |
38 | drivers. This can speedup program start, and can avoid false matches for | |
39 | ambiguous configurations. Selecting a driver also allows to pass more | |
40 | driver specific options. Use the | |
41 | .BR "\-L " ( "\-\-list\-supported" ")" | |
3df03cc2 | 42 | option to get a list of available drivers. |
53155b2f | 43 | .sp |
10d98b47 UH |
44 | Drivers can take options, in the form \fBkey=value\fP |
45 | separated by colons. | |
46 | .sp | |
47 | Drivers communicating with hardware via a serial port always need the port | |
48 | specified as the \fBconn\fP option. For example, to use the | |
49 | Openbench Logic Sniffer: | |
53155b2f | 50 | .sp |
3df03cc2 | 51 | .RB " $ " "sigrok\-cli \-\-driver=ols:conn=/dev/ttyACM0" " [...]" |
53155b2f | 52 | .sp |
10d98b47 | 53 | Some USB devices don't use a unique VendorID/ProductID combination, and thus |
3d1dae3c UH |
54 | need that specified as well. Notice that colons are used to separate the |
55 | driver name from the \fBconn\fP option, thus colons cannot be used within the | |
56 | \fBconn\fP option's argument. To select a specific USB device, use either | |
57 | \fBVendorID.ProductID\fP or \fBbus.address\fP: | |
53155b2f | 58 | .sp |
3df03cc2 UH |
59 | USB \fBVendorID.ProductID\fP example: |
60 | .sp | |
61 | .RB " $ " "sigrok\-cli \-\-driver=uni\-t\-ut61e:conn=1a86.e008" " [...]" | |
62 | .sp | |
63 | USB \fBbus.address\fP example: | |
64 | .sp | |
65 | .RB " $ " "sigrok\-cli \-\-driver=uni\-t\-ut61e:conn=4.6" " [...]" | |
43e5747a | 66 | .TP |
3d1dae3c UH |
67 | .B "\-D, \-\-dont\-scan" |
68 | Do not automatically scan for device drivers in the absence of a | |
69 | .BR "\-d " ( "\-\-driver" ) | |
70 | specification. | |
71 | .TP | |
3df03cc2 | 72 | .BR "\-c, \-\-config " <deviceoption> |
53155b2f | 73 | A colon-separated list of device options, where each option takes the form |
1b4b6a7c | 74 | .BR key=value . |
3d1dae3c UH |
75 | Multiple occurances of the |
76 | .B \-\-config | |
77 | option are supported. | |
78 | The first item in the list of options can take the form | |
79 | .B channel_group=<name> | |
80 | which would override the | |
81 | .B \-\-channel\-group | |
82 | specification for this list of options. Other option lists in other | |
83 | .B \-\-config | |
84 | occurances are not affected by this list's channel group name. | |
85 | .sp | |
10d98b47 UH |
86 | For example, to set the samplerate to 1MHz on a device supported by the |
87 | fx2lafw driver, you might specify | |
1b4b6a7c | 88 | .sp |
3df03cc2 | 89 | .RB " $ " "sigrok\-cli \-d fx2lafw \-\-config samplerate=1m" " [...]" |
1b4b6a7c | 90 | .sp |
53155b2f BV |
91 | Samplerate is an option common to most logic analyzers. The argument specifies |
92 | the samplerate in Hz. You can also specify the samplerate in kHz, MHz or GHz. | |
1b4b6a7c UH |
93 | The following are all equivalent: |
94 | .sp | |
3df03cc2 | 95 | .RB " $ " "sigrok\-cli \-d fx2lafw \-\-config samplerate=1000000" " [...]" |
1b4b6a7c | 96 | .sp |
3df03cc2 | 97 | .RB " $ " "sigrok\-cli \-d fx2lafw \-\-config samplerate=1m" " [...]" |
1b4b6a7c | 98 | .sp |
3df03cc2 | 99 | .RB " $ " "sigrok\-cli \-d fx2lafw \-\-config \(dqsamplerate=1 MHz\(dq" " [...]" |
3d1dae3c UH |
100 | .sp |
101 | These examples specify options within a channel group. | |
102 | The first two are equivalent. | |
103 | .sp | |
104 | .RB " $ " "sigrok\-cli \-d demo \-\-channel\-group Logic \-\-config pattern=random [...]" | |
105 | .sp | |
106 | .RB " $ " "sigrok\-cli \-d demo \-\-config channel_group=Logic:pattern=random [...]" | |
107 | .sp | |
108 | .RB " $ " "sigrok\-cli \-d demo \-\-config samplerate=1m \-\-config channel_group=Logic:pattern=random [...]" | |
1b4b6a7c | 109 | .TP |
43e5747a | 110 | .BR "\-i, \-\-input\-file " <filename> |
3df03cc2 UH |
111 | Load input from a file instead of a hardware device. You can specify |
112 | "-" to use stdin as input. If the | |
43e5747a | 113 | .B \-\-input\-format |
3df03cc2 | 114 | option is not supplied, sigrok\-cli attempts to autodetect the file format of |
43e5747a | 115 | the input file. |
3df03cc2 UH |
116 | .sp |
117 | Example for loading a sigrok session file: | |
118 | .sp | |
119 | .RB " $ " "sigrok\-cli \-i example.sr" " [...]" | |
120 | .sp | |
121 | Example for loading a WAV file (autodetection of input format): | |
122 | .sp | |
123 | .RB " $ " "sigrok\-cli \-i example.wav" " [...] | |
124 | .sp | |
125 | Example for loading a VCD file from stdin (autodetection of input format): | |
126 | .sp | |
127 | .RB " $ " "cat example.vcd | sigrok\-cli \-i \-" " [...] | |
43e5747a UH |
128 | .TP |
129 | .BR "\-I, \-\-input\-format " <format> | |
130 | When loading an input file, assume it's in the specified format. If this | |
131 | option is not supplied (in addition to | |
132 | .BR \-\-input\-file ), | |
943d0c08 | 133 | sigrok-cli attempts to autodetect the file format of the input file. Use the |
3df03cc2 | 134 | .BR "\-L " ( "\-\-list\-supported" ")" |
10d98b47 UH |
135 | option to see a list of available input formats. |
136 | .sp | |
137 | The format name may optionally be followed by a colon-separated list of | |
138 | options, where each option takes the form | |
943d0c08 | 139 | .BR "key=value" . |
3df03cc2 UH |
140 | .sp |
141 | Example for loading a binary file with options: | |
142 | .sp | |
143 | .RB " $ " "sigrok\-cli \-i example.bin" | |
144 | .br | |
145 | .BR " \-I binary:numchannels=4:samplerate=1mhz" " [...]" | |
43e5747a UH |
146 | .TP |
147 | .BR "\-o, \-\-output\-file " <filename> | |
148 | Save output to a file instead of writing it to stdout. The default format | |
149 | used when saving is the sigrok session file format. This can be changed with | |
150 | the | |
76ae913d | 151 | .B \-\-output\-format |
7949dca0 | 152 | option. |
3df03cc2 UH |
153 | .sp |
154 | Example for saving data in the sigrok session format: | |
155 | .sp | |
156 | .RB " $ " "sigrok\-cli " "[...] " "\-o example.sr" | |
7949dca0 | 157 | .TP |
3df03cc2 | 158 | .BR "\-O, \-\-output\-format " <format> |
7949dca0 | 159 | Set the output format to use. Use the |
3df03cc2 | 160 | .BR "\-L " ( "\-\-list\-supported" ")" |
10d98b47 UH |
161 | option to see a list of available output formats. |
162 | .sp | |
163 | The format name may optionally be followed by a colon-separated list of | |
164 | options, where each option takes the form | |
7949dca0 UH |
165 | .BR "key=value" . |
166 | .sp | |
3df03cc2 | 167 | For example, the |
7949dca0 UH |
168 | .B bits |
169 | or | |
170 | .B hex | |
171 | 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 | |
3df03cc2 | 172 | .B "\-O hex:width=128" |
7949dca0 UH |
173 | will display 128 bits per line, in hexadecimal: |
174 | .sp | |
10d98b47 UH |
175 | 0:ffff ffff ffff ffff ffff ffff ffff ffff |
176 | 1:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 | |
7949dca0 | 177 | .sp |
029d73fe | 178 | The lines always start with the channel number (or name, if defined), followed by a colon. If no format is specified, it defaults to |
7949dca0 UH |
179 | .BR bits:width=64 , |
180 | like this: | |
181 | .sp | |
10d98b47 UH |
182 | 0:11111111 11111111 11111111 11111111 [...] |
183 | 1:11111111 00000000 11111111 00000000 [...] | |
3df03cc2 UH |
184 | .sp |
185 | Example for saving data in the CSV format with options: | |
186 | .sp | |
187 | .RB " $ " "sigrok\-cli " "[...] " "\-o example.csv \-O csv:dedup:header=false" | |
188 | .sp | |
189 | Notice that boolean options are \fBtrue\fP when no value gets specified. | |
43e5747a | 190 | .TP |
3dfbfbc8 | 191 | .BR "\-C, \-\-channels " <channellist> |
029d73fe | 192 | A comma-separated list of channels to be used in the session. |
43e5747a | 193 | .sp |
029d73fe | 194 | Note that sigrok always names the channels according to how they're shown on |
3df03cc2 | 195 | the enclosure of the hardware. If your logic analyzer numbers the channels 0\-15, |
029d73fe | 196 | that's how you must specify them with this option. An oscilloscope's channels |
10d98b47 | 197 | would generally be referred to as "CH1", "CH2", and so on. |
029d73fe | 198 | Use the \fB\-\-show\fP option to see a list of channel names for your device. |
53155b2f | 199 | .sp |
029d73fe UH |
200 | The default is to use all the channels available on a device. You can name |
201 | a channel like this: | |
43e5747a | 202 | .BR "1=CLK" . |
029d73fe | 203 | A range of channels can also be given, in the form |
43e5747a UH |
204 | .BR "1\-5" . |
205 | .sp | |
206 | Example: | |
207 | .sp | |
10d98b47 UH |
208 | .RB " $ " "sigrok\-cli \-\-driver fx2lafw \-\-samples 100" |
209 | .br | |
3dfbfbc8 | 210 | .B " \-\-channels 1=CLK,2\-4,7" |
43e5747a UH |
211 | .br |
212 | CLK:11111111 11111111 11111111 11111111 [...] | |
213 | 2:11111111 11111111 11111111 11111111 [...] | |
214 | 3:11111111 11111111 11111111 11111111 [...] | |
215 | 4:11111111 11111111 11111111 11111111 [...] | |
216 | 7:11111111 11111111 11111111 11111111 [...] | |
217 | .sp | |
218 | The comma-separated list is processed from left to right, i.e. items farther | |
219 | to the right override previous items. For example | |
bf836932 | 220 | .B "1=CS,CS=MISO" |
029d73fe | 221 | will set the name of channel 1 to |
43e5747a | 222 | .BR "MISO" . |
43e5747a | 223 | .TP |
ca50f4b3 | 224 | .BR "\-g, \-\-channel\-group "<channel\ group> |
3df03cc2 UH |
225 | Specify the channel group to operate on. Some devices organize channels into |
226 | groups, the settings of which can only be changed as a group. The list of | |
227 | channel groups, if any, is displayed with the \fB\-\-show\fP command. | |
228 | .sp | |
229 | Examples: | |
230 | .sp | |
231 | .RB " $ " "sigrok\-cli \-g CH1" " [...]" | |
232 | .sp | |
233 | .RB " $ " "sigrok\-cli \-d demo \-g Logic \-c pattern=graycode" " [...]" | |
3d1dae3c UH |
234 | .sp |
235 | Channel group specifications in | |
236 | .B \-\-get | |
237 | or | |
238 | .B \-\-config | |
239 | options take precedence over channel group names in | |
240 | .B \-\-channel\-group | |
241 | so that a single | |
242 | .B sigrok\-cli | |
243 | invocation can support the query or manipulation of multiple device options | |
244 | which reside in different channel groups. | |
31f9318a | 245 | .TP |
43e5747a UH |
246 | .BR "\-t, \-\-triggers " <triggerlist> |
247 | A comma-separated list of triggers to use, of the form | |
029d73fe UH |
248 | .BR "<channel>=<trigger>" . |
249 | You can use the name or number of the channel, and the trigger itself is a | |
43e5747a UH |
250 | series of characters: |
251 | .sp | |
252 | .BR "0 or 1" : | |
253 | A low or high value on the pin. | |
254 | .br | |
255 | .BR "r or f" : | |
256 | A rising or falling value on the pin. An | |
257 | .B r | |
258 | effectively corresponds to | |
259 | .BR 01 . | |
260 | .br | |
f99038b4 | 261 | .BR "e" : |
85f2ddbb | 262 | Any kind of change on a pin (either a rising or a falling edge). |
43e5747a | 263 | .sp |
10d98b47 UH |
264 | Not every device supports all of these trigger types. Use the \fB\-\-show\fP |
265 | command to see which triggers your device supports. | |
43e5747a | 266 | .TP |
3df03cc2 | 267 | .BR "\-w, \-\-wait\-trigger" |
10d98b47 UH |
268 | Don't output any sample data (even if it's actually received from the |
269 | hardware) before the trigger condition is met. In other words, do not output | |
270 | any pre-trigger data. This option is useful if you don't care about the data | |
271 | that came before the trigger (but the hardware delivers this data to sigrok | |
272 | nonetheless). | |
43e5747a | 273 | .TP |
b5ac81ad | 274 | .BR "\-P, \-\-protocol\-decoders " <list> |
85f2ddbb UH |
275 | This option allows the user to specify a comma-separated list of protocol |
276 | decoders to be used in this session. The decoders are specified by their | |
277 | ID, as shown in the | |
3df03cc2 | 278 | .BR "\-L " ( "\-\-list\-supported" ")" |
85f2ddbb UH |
279 | output. |
280 | .sp | |
281 | Example: | |
282 | .sp | |
283 | $ | |
b5ac81ad | 284 | .B "sigrok\-cli \-i <file.sr> \-P i2c" |
85f2ddbb UH |
285 | .sp |
286 | Each protocol decoder can optionally be followed by a colon-separated list | |
287 | of options, where each option takes the form | |
288 | .BR "key=value" . | |
289 | .sp | |
290 | Example: | |
291 | .sp | |
292 | $ | |
8791df07 UH |
293 | .B "sigrok\-cli \-i <file.sr> " |
294 | .br | |
295 | .B " \-P uart:baudrate=115200:parity_type=odd" | |
85f2ddbb UH |
296 | .sp |
297 | The list of supported options depends entirely on the protocol decoder. Every | |
298 | protocol decoder has different options it supports. | |
299 | .sp | |
300 | Any "options" specified for a protocol decoder which are not actually | |
029d73fe | 301 | supported options, will be interpreted as being channel name/number assignments. |
85f2ddbb UH |
302 | .sp |
303 | Example: | |
304 | .sp | |
305 | $ | |
306 | .B "sigrok\-cli \-i <file.sr>" | |
307 | .br | |
bf836932 | 308 | .B " \-P spi:wordsize=9:miso=1:mosi=5:clk=3:cs=0" |
85f2ddbb UH |
309 | .sp |
310 | In this example, | |
311 | .B wordsize | |
312 | is an option supported by the | |
313 | .B spi | |
314 | protocol decoder. Additionally, the user tells sigrok to decode the SPI | |
029d73fe | 315 | protocol using channel 1 as MISO signal for SPI, channel 5 as MOSI, channel 3 |
bf836932 | 316 | as CLK, and channel 0 as CS# signal. |
3df03cc2 UH |
317 | .sp |
318 | Notice that the | |
319 | .B sigrok\-cli | |
320 | application does not support "name matching". Instead it's assumed that the | |
321 | traces in the input stream match the order of the decoder's input signals, | |
322 | or that users explicitly specify the input channel to decoder signal mapping. | |
323 | .br | |
324 | .sp | |
325 | When multiple decoders are specified in the same | |
326 | .BR -P | |
327 | option, they will be stacked on top of each other in the specified order. | |
328 | .sp | |
329 | Example: | |
330 | .sp | |
331 | $ | |
332 | .B "sigrok\-cli \-i <file.sr> \-P i2c,eeprom24xx" | |
333 | .br | |
334 | $ | |
335 | .B "sigrok\-cli \-i <file.sr> \-P uart:baudrate=31250,midi" | |
336 | .sp | |
337 | When multiple | |
338 | .BR -P | |
339 | options are specified, each of them creates one decoder stack, which | |
340 | executes in parallel to other decoder stacks. | |
341 | .sp | |
342 | Example: | |
343 | .sp | |
344 | $ | |
345 | .B "sigrok\-cli \-i <file.sr> \-P uart:tx=D0:rx=D1 \-P timing:data=D2" | |
346 | .sp | |
85f2ddbb | 347 | .TP |
b6bd032d | 348 | .BR "\-A, \-\-protocol\-decoder\-annotations " <annotations> |
3d1dae3c UH |
349 | By default, all annotation output of all protocol decoders is |
350 | shown. With this option a specific decoder's annotations can be selected for | |
351 | display, by specifying the decoder ID: | |
7fb87027 BV |
352 | .sp |
353 | $ | |
3df03cc2 | 354 | .B "sigrok\-cli \-i <file.sr> \-P i2c,i2cfilter,edid \-A i2c" |
7fb87027 | 355 | .sp |
3d1dae3c | 356 | If a protocol decoder has multiple annotation classes, you can also specify |
790b0261 | 357 | which one of them to show by specifying its short description like this: |
7fb87027 BV |
358 | .sp |
359 | $ | |
b5ac81ad | 360 | .B "sigrok\-cli \-i <file.sr> \-P i2c,i2cfilter,edid" |
7fb87027 | 361 | .br |
3df03cc2 | 362 | .B " \-A i2c=data\-read" |
790b0261 | 363 | .sp |
3d1dae3c | 364 | Select multiple annotation classes by separating them with a colon: |
790b0261 BV |
365 | .sp |
366 | $ | |
367 | .B "sigrok\-cli \-i <file.sr> \-P i2c,i2cfilter,edid" | |
368 | .br | |
3df03cc2 | 369 | .B " \-A i2c=data\-read:data\-write" |
7fb87027 | 370 | .sp |
3d1dae3c UH |
371 | Annotation row names will resolve to their respective list of classes. |
372 | Row and class names can be used in combination. When names are ambiguous | |
373 | then class names take precedence. | |
374 | .sp | |
375 | $ | |
376 | .B "sigrok\-cli \-i <file.sr> \-P i2c" | |
377 | .br | |
378 | .B " \-A i2c=addr\-data:warnings" | |
379 | .sp | |
380 | You can also select multiple protocol decoders, with optionally selected | |
381 | annotation classes each, by separating them with commas: | |
7fb87027 BV |
382 | .sp |
383 | $ | |
b5ac81ad | 384 | .B "sigrok\-cli \-i <file.sr> \-P i2c,i2cfilter,edid" |
7fb87027 | 385 | .br |
3df03cc2 | 386 | .B " \-A i2c=data\-read:data\-write,edid" |
7fb87027 | 387 | .TP |
b0f1c540 BV |
388 | .BR "\-M, \-\-protocol\-decoder\-meta " <pdname> |
389 | When given, show protocol decoder meta output instead of annotations. | |
390 | The argument is the name of the decoder whose meta output to show. | |
391 | .sp | |
392 | $ | |
393 | .B "sigrok\-cli \-i <file.sr> \-M i2c" | |
394 | .sp | |
395 | Not every decoder generates meta output. | |
396 | .TP | |
397 | .BR "\-B, \-\-protocol\-decoder\-binary " <binaryspec> | |
398 | When given, decoder "raw" data of various kinds is written to stdout instead | |
399 | of annotations (this could be raw binary UART/SPI bytes, or WAV files, PCAP | |
400 | files, PNG files, or anything else; this is entirely dependent on the | |
401 | decoder and what kinds of binary output make sense for that decoder). | |
402 | .sp | |
403 | No other information is printed to stdout, so this is | |
404 | suitable for piping into other programs or saving to a file. | |
405 | .sp | |
406 | Protocol decoders that support binary output publish a list of binary | |
407 | classes, for example the UART decoder might have "TX" and "RX". To | |
408 | select TX for output, the argument to this option would be: | |
409 | .sp | |
410 | $ | |
411 | .B "sigrok\-cli \-i <file.sr> \-B uart=tx" | |
412 | .br | |
413 | .sp | |
414 | If only the protocol decoder is specified, without binary class, all classes | |
415 | are written to stdout: | |
416 | .sp | |
417 | $ | |
418 | .B "sigrok\-cli \-i <file.sr> \-B uart" | |
419 | .sp | |
420 | (this is only useful in rare cases, generally you would specify a certain | |
421 | binary class you're interested in) | |
422 | .sp | |
423 | Not every decoder generates binary output. | |
424 | .TP | |
3df03cc2 UH |
425 | .BR "\-\-protocol\-decoder\-samplenum |
426 | When given, decoder annotations will include sample numbers, too. | |
427 | This allows consumers to receive machine readable timing information. | |
428 | .TP | |
53155b2f | 429 | .BR "\-l, \-\-loglevel " <level> |
3df03cc2 | 430 | Set the libsigrok and libsigrokdecode loglevel. At the moment \fBsigrok\-cli\fP |
10d98b47 | 431 | doesn't support setting the two loglevels independently. The higher the |
53155b2f BV |
432 | number, the more debug output will be printed. Valid loglevels are: |
433 | .sp | |
434 | \fB0\fP None | |
435 | .br | |
436 | \fB1\fP Error | |
437 | .br | |
438 | \fB2\fP Warnings | |
439 | .br | |
440 | \fB3\fP Informational | |
441 | .br | |
442 | \fB4\fP Debug | |
443 | .br | |
444 | \fB5\fP Spew | |
445 | .TP | |
446 | .B "\-\-show" | |
447 | .br | |
10d98b47 UH |
448 | Show information about the selected option. For example, to see options for a |
449 | connected fx2lafw device: | |
53155b2f BV |
450 | .sp |
451 | $ | |
452 | .B "sigrok\-cli \-\-driver fx2lafw \-\-show | |
453 | .sp | |
10d98b47 UH |
454 | In order to properly get device options for your hardware, some drivers might |
455 | need a serial port specified: | |
53155b2f BV |
456 | .sp |
457 | $ | |
458 | .B "sigrok\-cli \-\-driver ols:conn=/dev/ttyACM0 \-\-show | |
459 | .sp | |
a8b4041a | 460 | This also works for protocol decoders, input modules and output modules: |
53155b2f BV |
461 | .sp |
462 | $ | |
ad6520c4 BV |
463 | .B "sigrok\-cli \-\-protocol\-decoders i2c \-\-show |
464 | $ | |
a8b4041a BV |
465 | .B "sigrok\-cli \-\-input\-format csv \-\-show |
466 | $ | |
ad6520c4 | 467 | .B "sigrok\-cli \-\-output\-format bits \-\-show |
3d1dae3c UH |
468 | .sp |
469 | This also works for input files, including optional input format specifications: | |
470 | .sp | |
471 | $ | |
472 | .B "sigrok\-cli \-\-input\-file <file.sr> \-\-show | |
473 | $ | |
474 | .B "sigrok\-cli \-\-input\-file <file.vcd> \-\-input\-format vcd \-\-show | |
53155b2f | 475 | .TP |
b5ac81ad BV |
476 | .B "\-\-scan" |
477 | Scan for devices that can be detected automatically. | |
10d98b47 UH |
478 | .sp |
479 | Example: | |
480 | .sp | |
481 | $ | |
b5ac81ad | 482 | .B "sigrok\-cli \-\-scan |
10d98b47 UH |
483 | .br |
484 | The following devices were found: | |
485 | .br | |
3df03cc2 | 486 | demo \- Demo device with 12 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3 |
10d98b47 | 487 | .br |
3df03cc2 | 488 | fx2lafw:conn=3.26 \- CWAV USBee SX with 8 channels: 0 1 2 3 4 5 6 7 |
10d98b47 UH |
489 | .sp |
490 | However, not all devices are auto-detectable (e.g. serial port based ones). | |
491 | For those you'll have to provide a \fBconn\fP option, see above. | |
492 | .sp | |
493 | $ | |
3df03cc2 | 494 | .B "sigrok\-cli \-\-driver digitek\-dt4000zc:conn=/dev/ttyUSB0 \-\-scan |
10d98b47 UH |
495 | .br |
496 | The following devices were found: | |
497 | .br | |
029d73fe | 498 | Digitek DT4000ZC with 1 channel: P1 |
53155b2f | 499 | .TP |
43e5747a UH |
500 | .BR "\-\-time " <ms> |
501 | Sample for | |
502 | .B <ms> | |
10d98b47 UH |
503 | milliseconds, then quit. |
504 | .sp | |
bf836932 UH |
505 | You can optionally follow the number by \fBs\fP to specify the time to |
506 | sample in seconds. | |
10d98b47 UH |
507 | .sp |
508 | For example, | |
43e5747a UH |
509 | .B "\-\-time 2s" |
510 | will sample for two seconds. | |
511 | .TP | |
512 | .BR "\-\-samples " <numsamples> | |
513 | Acquire | |
514 | .B <numsamples> | |
515 | samples, then quit. | |
10d98b47 UH |
516 | .sp |
517 | You can optionally follow the number by \fBk\fP, \fBm\fP, or \fBg\fP to | |
518 | specify the number of samples in kilosamples, megasamples, or gigasamples, | |
519 | respectively. | |
520 | .sp | |
521 | For example, | |
522 | .B "\-\-samples 3m" | |
523 | will acquire 3000000 samples. | |
43e5747a | 524 | .TP |
66d5560b UH |
525 | .BR "\-\-frames " <numframes> |
526 | Acquire | |
527 | .B <numframes> | |
528 | frames, then quit. | |
529 | .TP | |
43e5747a UH |
530 | .BR "\-\-continuous" |
531 | Sample continuously until stopped. Not all devices support this. | |
2d73284e | 532 | .TP |
62a64762 BV |
533 | .BR "\-\-get " <variable> |
534 | Get the value of | |
535 | .B <variable> | |
536 | from the specified device and print it. | |
3d1dae3c UH |
537 | Multiple variable names can be specified and get separated by colon. |
538 | The list of variable names optionally can be preceeded by | |
539 | .B "channel_group=<name>" | |
540 | which would override the | |
541 | .B \-\-channel\-group | |
542 | specification. | |
543 | Multiple | |
544 | .B \-\-get | |
545 | occurances are supported in a single | |
546 | .B sigrok\-cli | |
547 | invocation. | |
548 | .sp | |
549 | $ | |
550 | .B sigrok\-cli \-d demo \-\-get samplerate:averaging \-\-get channel_group=Logic:pattern | |
62a64762 | 551 | .TP |
2d73284e | 552 | .BR "\-\-set" |
b8656921 UH |
553 | Set one or more variables specified with the \fB\-\-config\fP option, without |
554 | doing any acquisition. | |
53155b2f | 555 | .SH EXAMPLES |
b8656921 UH |
556 | In order to get exactly 100 samples from the connected fx2lafw-supported logic |
557 | analyzer hardware, run the following command: | |
43e5747a | 558 | .TP |
53155b2f | 559 | .B " sigrok\-cli \-\-driver fx2lafw \-\-samples 100" |
43e5747a | 560 | .TP |
2d73284e | 561 | If you want to sample data for 3 seconds (3000 ms), use: |
43e5747a | 562 | .TP |
53155b2f | 563 | .B " sigrok\-cli \-\-driver fx2lafw \-\-time 3000" |
43e5747a UH |
564 | .TP |
565 | Alternatively, you can also use: | |
566 | .TP | |
53155b2f | 567 | .B " sigrok\-cli \-\-driver fx2lafw \-\-time 3s" |
43e5747a | 568 | .TP |
029d73fe | 569 | To capture data from the first 4 channels using the Openbench Logic Sniffer lasting 100ms at 10 MHz starting at the trigger condition |
53155b2f | 570 | 0:high, 1:rising, 2:low, 3:high, use: |
43e5747a | 571 | .TP |
53155b2f | 572 | .nf |
b5ac81ad | 573 | \fBsigrok\-cli \-\-driver ols:conn=/dev/ttyACM0 \-\-config samplerate=10m \\\fP |
3dfbfbc8 | 574 | \fB\-\-output\-format bits \-\-channels 0\-3 \-\-wait\-trigger \\\fP |
b5ac81ad | 575 | \fB\-\-triggers 0=1,1=r,2=0,3=1 \-\-time 100\fP |
2d73284e BV |
576 | .TP |
577 | To turn on internal logging on a Lascar EL-USB series device: | |
578 | .TP | |
579 | \fBsigrok\-cli \-\-driver lascar\-el\-usb:conn=10c4.0002 \\\fP | |
b8656921 | 580 | \fB\-\-config datalog=on \-\-set\fP |
43e5747a UH |
581 | .SH "EXIT STATUS" |
582 | .B sigrok\-cli | |
583 | exits with 0 on success, 1 on most failures. | |
584 | .SH "SEE ALSO" | |
b5ac81ad | 585 | \fBpulseview\fP(1) |
43e5747a | 586 | .SH "BUGS" |
10d98b47 UH |
587 | Please report any bugs via Bugzilla |
588 | .RB "(" http://sigrok.org/bugzilla ")" | |
589 | or on the sigrok\-devel mailing list | |
43e5747a UH |
590 | .RB "(" sigrok\-devel@lists.souceforge.net ")." |
591 | .SH "LICENSE" | |
592 | .B sigrok\-cli | |
593 | is covered by the GNU General Public License (GPL). Some portions are | |
594 | licensed under the "GPL v2 or later", some under "GPL v3 or later". | |
595 | .SH "AUTHORS" | |
596 | Please see the individual source code files. | |
597 | .PP | |
598 | This manual page was written by Uwe Hermann <uwe@hermann\-uwe.de>. | |
599 | It is licensed under the terms of the GNU GPL (version 2 or later). |