]>
Commit | Line | Data |
---|---|---|
b5089195 JH |
1 | /* |
2 | * This file is part of the libsigrok project. | |
3 | * | |
4 | * Copyright (C) 2014 Janne Huttunen <jahuttun@gmail.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 | ||
6ec6c43b | 20 | #include <config.h> |
b5089195 JH |
21 | #include <stdint.h> |
22 | #include <string.h> | |
23 | #include <math.h> | |
24 | #include <glib.h> | |
c1aae900 | 25 | #include <libsigrok/libsigrok.h> |
b5089195 JH |
26 | #include "libsigrok-internal.h" |
27 | ||
b5089195 JH |
28 | #define LOG_PREFIX "deree-de5000" |
29 | ||
696b79d2 | 30 | static int dev_clear(const struct sr_dev_driver *di) |
b5089195 | 31 | { |
4f840ce9 | 32 | return std_dev_clear(di, es51919_serial_clean); |
b5089195 JH |
33 | } |
34 | ||
4f840ce9 | 35 | static GSList *scan(struct sr_dev_driver *di, GSList *options) |
b5089195 JH |
36 | { |
37 | struct sr_dev_inst *sdi; | |
38 | ||
39 | if (!(sdi = es51919_serial_scan(options, "DER EE", "DE-5000"))) | |
40 | return NULL; | |
41 | ||
15a5bfe4 | 42 | return std_scan_complete(di, g_slist_append(NULL, sdi)); |
b5089195 JH |
43 | } |
44 | ||
dd5c48a6 | 45 | static struct sr_dev_driver deree_de5000_driver_info = { |
b5089195 JH |
46 | .name = "deree-de5000", |
47 | .longname = "DER EE DE-5000", | |
48 | .api_version = 1, | |
c2fdcc25 | 49 | .init = std_init, |
700d6b64 | 50 | .cleanup = std_cleanup, |
b5089195 | 51 | .scan = scan, |
c01bf34c | 52 | .dev_list = std_dev_list, |
696b79d2 | 53 | .dev_clear = dev_clear, |
b5089195 JH |
54 | .config_get = es51919_serial_config_get, |
55 | .config_set = es51919_serial_config_set, | |
56 | .config_list = es51919_serial_config_list, | |
57 | .dev_open = std_serial_dev_open, | |
58 | .dev_close = std_serial_dev_close, | |
59 | .dev_acquisition_start = es51919_serial_acquisition_start, | |
60 | .dev_acquisition_stop = es51919_serial_acquisition_stop, | |
41812aca | 61 | .context = NULL, |
b5089195 | 62 | }; |
dd5c48a6 | 63 | SR_REGISTER_DEV_DRIVER(deree_de5000_driver_info); |