]> sigrok.org Git - libsigrok.git/blame - sigrok-proto.h
sr: adjust copyright year
[libsigrok.git] / sigrok-proto.h
CommitLineData
10509bc2
BV
1/*
2 * This file is part of the sigrok project.
3 *
c73d2ea4 4 * Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
10509bc2
BV
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
0f8522bf
UH
20#ifndef LIBSIGROK_SIGROK_PROTO_H
21#define LIBSIGROK_SIGROK_PROTO_H
10509bc2 22
10509bc2
BV
23/*--- backend.c -------------------------------------------------------------*/
24
1a081ca6
UH
25SR_API int sr_init(void);
26SR_API int sr_exit(void);
10509bc2 27
1352eedd
UH
28/*--- log.c -----------------------------------------------------------------*/
29
0ae67ff7
UH
30typedef int (*sr_log_handler_t)(void *data, int loglevel, const char *format,
31 va_list args);
32
33SR_API int sr_log_loglevel_set(int loglevel);
34SR_API int sr_log_loglevel_get(void);
35SR_API int sr_log_handler_set(sr_log_handler_t handler, void *data);
36SR_API int sr_log_handler_set_default(void);
37SR_API int sr_log_logdomain_set(const char *logdomain);
38SR_API char *sr_log_logdomain_get(void);
1352eedd 39
aa0b6b20
UH
40/*--- datastore.c -----------------------------------------------------------*/
41
1a081ca6
UH
42SR_API int sr_datastore_new(int unitsize, struct sr_datastore **ds);
43SR_API int sr_datastore_destroy(struct sr_datastore *ds);
44SR_API int sr_datastore_put(struct sr_datastore *ds, void *data,
45 unsigned int length, int in_unitsize,
46 int *probelist);
aa0b6b20 47
aa0b6b20 48/*--- device.c --------------------------------------------------------------*/
10509bc2 49
03168500
BV
50SR_API int sr_dev_scan(void);
51SR_API GSList *sr_dev_list(void);
52SR_API struct sr_device *sr_dev_new(const struct sr_device_plugin *plugin,
1a081ca6 53 int plugin_index);
03168500
BV
54SR_API int sr_dev_probe_add(struct sr_device *device, const char *name);
55SR_API struct sr_probe *sr_dev_probe_find(const struct sr_device *device,
1a081ca6 56 int probenum);
03168500 57SR_API int sr_dev_probe_name(struct sr_device *device, int probenum,
1a081ca6 58 const char *name);
03168500
BV
59SR_API int sr_dev_trigger_clear(struct sr_device *device);
60SR_API int sr_dev_trigger_set(struct sr_device *device, int probenum,
1a081ca6 61 const char *trigger);
03168500
BV
62SR_API gboolean sr_dev_has_hwcap(const struct sr_device *device, int hwcap);
63SR_API int sr_dev_get_info(const struct sr_device *device, int id,
1a081ca6 64 const void **data);
10509bc2 65
aa0b6b20
UH
66/*--- filter.c --------------------------------------------------------------*/
67
1a081ca6
UH
68SR_API int sr_filter_probes(int in_unitsize, int out_unitsize,
69 const int *probelist, const unsigned char *data_in,
70 uint64_t length_in, char **data_out,
71 uint64_t *length_out);
aa0b6b20
UH
72
73/*--- hwplugin.c ------------------------------------------------------------*/
74
1a081ca6 75SR_API GSList *sr_list_hwplugins(void);
a1645fcd
BV
76SR_API int sr_init_hwplugin(struct sr_device_plugin *plugin);
77SR_API gboolean sr_has_hwcap(int *capabilities, int hwcap);
1a081ca6 78SR_API struct sr_hwcap_option *sr_find_hwcap_option(int hwcap);
10509bc2
BV
79
80/*--- session.c -------------------------------------------------------------*/
81
13b05733
UH
82typedef void (*sr_datafeed_callback) (struct sr_device *device,
83 struct sr_datafeed_packet *packet);
10509bc2
BV
84
85/* Session setup */
1a081ca6
UH
86SR_API int sr_session_load(const char *filename);
87SR_API struct sr_session *sr_session_new(void);
88SR_API int sr_session_destroy(void);
89SR_API int sr_session_device_clear(void);
90SR_API int sr_session_device_add(struct sr_device *device);
10509bc2 91
10509bc2 92/* Datafeed setup */
1a081ca6
UH
93SR_API int sr_session_datafeed_callback_clear(void);
94SR_API int sr_session_datafeed_callback_add(sr_datafeed_callback callback);
10509bc2
BV
95
96/* Session control */
1a081ca6
UH
97SR_API int sr_session_start(void);
98SR_API int sr_session_run(void);
99SR_API int sr_session_halt(void);
100SR_API int sr_session_stop(void);
1a081ca6
UH
101SR_API int sr_session_save(const char *filename);
102SR_API int sr_session_source_add(int fd, int events, int timeout,
103 sr_receive_data_callback callback, void *user_data);
104SR_API int sr_session_source_remove(int fd);
10509bc2 105
aa0b6b20 106/*--- input/input.c ---------------------------------------------------------*/
10509bc2 107
1a081ca6 108SR_API struct sr_input_format **sr_input_list(void);
aa0b6b20
UH
109
110/*--- output/output.c -------------------------------------------------------*/
111
1a081ca6 112SR_API struct sr_output_format **sr_output_list(void);
aa0b6b20 113
996b0c72 114/*--- strutil.c -------------------------------------------------------*/
aa0b6b20 115
1a081ca6
UH
116SR_API char *sr_samplerate_string(uint64_t samplerate);
117SR_API char *sr_period_string(uint64_t frequency);
118SR_API char **sr_parse_triggerstring(struct sr_device *device,
119 const char *triggerstring);
120SR_API int sr_parse_sizestring(const char *sizestring, uint64_t *size);
121SR_API uint64_t sr_parse_timestring(const char *timestring);
122SR_API gboolean sr_parse_boolstring(const char *boolstring);
10509bc2 123
c2bd92ec 124#endif