]> sigrok.org Git - libsigrok.git/blob - src/hardware/rohde-schwarz-sme-0x/protocol.h
rohde-schwarz-sme-0x: Initial device support
[libsigrok.git] / src / hardware / rohde-schwarz-sme-0x / protocol.h
1 /*
2  * This file is part of the libsigrok project.
3  *
4  * Copyright (C) 2016 Vlad Ivanov <vlad.ivanov@lab-systems.ru>
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
20 #ifndef LIBSIGROK_HARDWARE_ROHDE_SCHWARZ_SME_0X_PROTOCOL_H
21 #define LIBSIGROK_HARDWARE_ROHDE_SCHWARZ_SME_0X_PROTOCOL_H
22
23 #include <stdint.h>
24 #include <glib.h>
25 #include <libsigrok/libsigrok.h>
26 #include "libsigrok-internal.h"
27
28 #define LOG_PREFIX "rohde-schwarz-sme-0x"
29
30 struct rs_sme0x_info {
31         struct sr_dev_driver di;
32         char *vendor;
33         char *device;
34 };
35
36 struct rs_device_model {
37         const char * model_str;
38         double freq_max;
39         double freq_min;
40         double power_max;
41         double power_min;
42 };
43
44 /** Private, per-device-instance driver context. */
45 struct dev_context {
46         /* Model-specific information */
47         const struct rs_device_model * model_config;
48 };
49
50 SR_PRIV int rs_sme0x_receive_data(int fd, int revents, void *cb_data);
51 SR_PRIV int rs_sme0x_mode_remote(struct sr_scpi_dev_inst *scpi);
52 SR_PRIV int rs_sme0x_close(struct sr_dev_inst *sdi);
53 SR_PRIV int rs_sme0x_get_freq(const struct sr_dev_inst *sdi, double * freq);
54 SR_PRIV int rs_sme0x_get_power(const struct sr_dev_inst *sdi, double * power);
55 SR_PRIV int rs_sme0x_set_freq(const struct sr_dev_inst *sdi, double freq);
56 SR_PRIV int rs_sme0x_set_power(const struct sr_dev_inst *sdi, double power);
57
58 #endif