2 * This file is part of the libsigrok project.
4 * Copyright (C) 2014 Janne Huttunen <jahuttun@gmail.com>
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.
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.
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/>.
25 #include <libsigrok/libsigrok.h>
26 #include "libsigrok-internal.h"
28 static void std_dev_attach(struct sr_dev_driver *di, struct sr_dev_inst *sdi)
30 struct drv_context *drvc;
35 drvc->instances = g_slist_append(drvc->instances, sdi);
38 #define LOG_PREFIX "deree-de5000"
40 SR_PRIV struct sr_dev_driver deree_de5000_driver_info;
42 static int dev_clear(const struct sr_dev_driver *di)
44 return std_dev_clear(di, es51919_serial_clean);
47 static GSList *scan(struct sr_dev_driver *di, GSList *options)
49 struct sr_dev_inst *sdi;
51 if (!(sdi = es51919_serial_scan(options, "DER EE", "DE-5000")))
54 std_dev_attach(di, sdi);
56 return g_slist_append(NULL, sdi);
59 SR_PRIV struct sr_dev_driver deree_de5000_driver_info = {
60 .name = "deree-de5000",
61 .longname = "DER EE DE-5000",
64 .cleanup = std_cleanup,
66 .dev_list = std_dev_list,
67 .dev_clear = dev_clear,
68 .config_get = es51919_serial_config_get,
69 .config_set = es51919_serial_config_set,
70 .config_list = es51919_serial_config_list,
71 .dev_open = std_serial_dev_open,
72 .dev_close = std_serial_dev_close,
73 .dev_acquisition_start = es51919_serial_acquisition_start,
74 .dev_acquisition_stop = es51919_serial_acquisition_stop,