blob: 03e3136738f4e0059e8020b78cea3d5d8fc04889 [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 */
Uwe Hermann029d73f2014-03-24 22:32:47 +010034int select_channels(struct sr_dev_inst *sdi);
Bert Vermeulen2be182e2013-11-17 13:15:38 +010035
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 */
Bert Vermeulen2be182e2013-11-17 13:15:38 +010047void datafeed_in(const struct sr_dev_inst *sdi,
48 const struct sr_datafeed_packet *packet, void *cb_data);
Bert Vermeulenad54a1a2013-12-26 12:08:34 +010049int opt_to_gvar(char *key, char *value, struct sr_config *src);
Bert Vermeulen2be182e2013-11-17 13:15:38 +010050int set_dev_options(struct sr_dev_inst *sdi, GHashTable *args);
51void run_session(void);
Bert Vermeulen6ea663a2014-03-12 19:12:20 +010052void save_chunk_logic(uint8_t *data, uint64_t data_len, int unitsize);
Bert Vermeulen2be182e2013-11-17 13:15:38 +010053
54/* input.c */
55void load_input_file(void);
56
57/* decode.c */
Dan Horák8d52f782014-01-25 14:15:24 +010058#ifdef HAVE_SRD
Bert Vermeulen26c63752013-11-17 18:51:15 +010059int register_pds(const char *opt_pds, char *opt_pd_annotations);
60int setup_pd_stack(char *opt_pds, char *opt_pd_stack, char *opt_pd_annotations);
61int setup_pd_annotations(char *opt_pd_annotations);
62int setup_pd_meta(char *opt_pd_meta);
63int setup_pd_binary(char *opt_pd_binary);
Bert Vermeulen2be182e2013-11-17 13:15:38 +010064void show_pd_annotations(struct srd_proto_data *pdata, void *cb_data);
65void show_pd_meta(struct srd_proto_data *pdata, void *cb_data);
66void show_pd_binary(struct srd_proto_data *pdata, void *cb_data);
Uwe Hermann3dfbfbc2014-04-12 13:42:30 +020067void map_pd_channels(struct sr_dev_inst *sdi);
Dan Horák8d52f782014-01-25 14:15:24 +010068#endif
Uwe Hermann43e57472011-12-30 11:23:22 +010069
70/* parsers.c */
Uwe Hermann029d73f2014-03-24 22:32:47 +010071struct sr_channel *find_channel(GSList *channellist, const char *channelname);
72GSList *parse_channelstring(struct sr_dev_inst *sdi, const char *channelstring);
Bert Vermeulen63bb4542012-07-16 01:03:30 +020073GHashTable *parse_generic_arg(const char *arg, gboolean sep_first);
Uwe Hermannd2ee5ee2012-05-30 22:15:29 +020074int canon_cmp(const char *str1, const char *str2);
Uwe Hermann43e57472011-12-30 11:23:22 +010075
76/* anykey.c */
77void add_anykey(void);
78void clear_anykey(void);
79
80#endif