blob: 7a5c3f5fd870513a369b620a0d20e8e1c848c637 [file] [log] [blame]
Uwe Hermann43e57472011-12-30 11:23:22 +01001/*
Uwe Hermann630293b2013-04-23 22:10:41 +02002 * This file is part of the sigrok-cli project.
Uwe Hermann43e57472011-12-30 11:23:22 +01003 *
4 * Copyright (C) 2011 Bert Vermeulen <bert@biot.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
Uwe Hermann60e19732012-02-04 10:41:30 +010020#ifndef SIGROK_CLI_SIGROK_CLI_H
21#define SIGROK_CLI_SIGROK_CLI_H
Uwe Hermann43e57472011-12-30 11:23:22 +010022
Bert Vermeulen2be182e2013-11-17 13:15:38 +010023#include "config.h"
Bert Vermeulen2be182e2013-11-17 13:15:38 +010024#ifdef HAVE_SRD
Uwe Hermann20fb52e2013-11-19 11:48:06 +010025/* First, so we avoid a _POSIX_C_SOURCE warning. */
Bert Vermeulen2be182e2013-11-17 13:15:38 +010026#include <libsigrokdecode/libsigrokdecode.h>
27#endif
Uwe Hermann20fb52e2013-11-19 11:48:06 +010028#include <libsigrok/libsigrok.h>
Bert Vermeulen2be182e2013-11-17 13:15:38 +010029
30#define DEFAULT_OUTPUT_FORMAT "bits:width=64"
Bert Vermeulen6ea663a2014-03-12 19:12:20 +010031#define SAVE_CHUNK_SIZE 524288
Bert Vermeulen2be182e2013-11-17 13:15:38 +010032
33/* main.c */
34int select_probes(struct sr_dev_inst *sdi);
35
36/* show.c */
37void show_version(void);
38void show_dev_list(void);
39void show_dev_detail(void);
40void show_pd_detail(void);
41
42/* device.c */
43GSList *device_scan(void);
Uwe Hermannca50f4b2014-03-14 21:46:10 +010044struct sr_channel_group *select_channel_group(struct sr_dev_inst *sdi);
Bert Vermeulen2be182e2013-11-17 13:15:38 +010045
46/* session.c */
47int setup_output_format(void);
48void datafeed_in(const struct sr_dev_inst *sdi,
49 const struct sr_datafeed_packet *packet, void *cb_data);
Bert Vermeulenad54a1a2013-12-26 12:08:34 +010050int opt_to_gvar(char *key, char *value, struct sr_config *src);
Bert Vermeulen2be182e2013-11-17 13:15:38 +010051int set_dev_options(struct sr_dev_inst *sdi, GHashTable *args);
52void run_session(void);
Bert Vermeulen6ea663a2014-03-12 19:12:20 +010053void save_chunk_logic(uint8_t *data, uint64_t data_len, int unitsize);
Bert Vermeulen2be182e2013-11-17 13:15:38 +010054
55/* input.c */
56void load_input_file(void);
57
58/* decode.c */
Dan Horák8d52f782014-01-25 14:15:24 +010059#ifdef HAVE_SRD
Bert Vermeulen26c63752013-11-17 18:51:15 +010060int register_pds(const char *opt_pds, char *opt_pd_annotations);
61int setup_pd_stack(char *opt_pds, char *opt_pd_stack, char *opt_pd_annotations);
62int setup_pd_annotations(char *opt_pd_annotations);
63int setup_pd_meta(char *opt_pd_meta);
64int setup_pd_binary(char *opt_pd_binary);
Bert Vermeulen2be182e2013-11-17 13:15:38 +010065void show_pd_annotations(struct srd_proto_data *pdata, void *cb_data);
66void show_pd_meta(struct srd_proto_data *pdata, void *cb_data);
67void show_pd_binary(struct srd_proto_data *pdata, void *cb_data);
Daniel Elstner39aedc32014-02-21 20:10:09 +010068void map_pd_probes(struct sr_dev_inst *sdi);
Dan Horák8d52f782014-01-25 14:15:24 +010069#endif
Uwe Hermann43e57472011-12-30 11:23:22 +010070
71/* parsers.c */
Daniel Elstner39aedc32014-02-21 20:10:09 +010072struct sr_probe *find_probe(GSList *probelist, const char *probename);
Bert Vermeulen497f5362012-10-14 14:53:30 +020073GSList *parse_probestring(struct sr_dev_inst *sdi, const char *probestring);
Bert Vermeulen63bb4542012-07-16 01:03:30 +020074GHashTable *parse_generic_arg(const char *arg, gboolean sep_first);
Uwe Hermannd2ee5ee2012-05-30 22:15:29 +020075int canon_cmp(const char *str1, const char *str2);
Uwe Hermann43e57472011-12-30 11:23:22 +010076
77/* anykey.c */
78void add_anykey(void);
79void clear_anykey(void);
80
81#endif