2 * This file is part of the sigrok project.
4 * Copyright (C) 2012 Bert Vermeulen <bert@biot.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/>.
21 #ifndef LIBSIGROK_GENERICDMM_H
22 #define LIBSIGROK_GENERICDMM_H
24 /* SR_HWCAP_CONN takes one of these: */
25 #define DMM_CONN_USB_VIDPID "^([0-9a-z]{1,4})\\.([0-9a-z]{1,4})$"
26 #define DMM_CONN_USB_BUSADDR "^(\\d+)\\.(\\d+)$"
27 #define DMM_CONN_SERIALPORT "^([a-z0-9/\\-_]+)$"
29 /* SR_HWCAP_SERIALCOMM like 2400/8n1 */
30 #define DMM_CONN_SERIALCOMM "^(\\d+)/(\\d)([neo])(\\d)$"
44 struct sr_hwopt *defaults_opts;
48 struct dev_profile *profile;
49 uint64_t limit_samples;
52 /* Opaque pointer passed in by the frontend. */
55 /* Only used for USB-connected devices. */
56 struct sr_usb_dev_inst *usb;
58 /* Only used for serial-connected devices. */
59 struct sr_serial_dev_inst *serial;
68 /* DMM chip-specific data, if needed. */
73 /* Optional, called once before measurement starts. */
76 /* Scan for devices with the given options. */
77 GSList *(*scan) (GSList *options);
79 /* Called whenever a chunk of data arrives. */
80 int (*data) (struct sr_dev_inst *sdi, unsigned char *data);
84 #endif /* LIBSIGROK_GENERICDMM_H */