]>
Commit | Line | Data |
---|---|---|
7dc55d93 AG |
1 | /* |
2 | * This file is part of the sigrok project. | |
3 | * | |
4 | * Copyright (C) 2012 Bert Vermeulen <bert@biot.com> | |
5 | * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com> | |
729b01f9 | 6 | * Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de> |
7dc55d93 AG |
7 | * |
8 | * This program is free software: you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation, either version 3 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | */ | |
21 | ||
7dc55d93 AG |
22 | #include <sys/types.h> |
23 | #include <sys/stat.h> | |
24 | #include <fcntl.h> | |
25 | #include <string.h> | |
26 | #include <errno.h> | |
22f54192 | 27 | #include <glib.h> |
bbabddbd UH |
28 | #include "libsigrok.h" |
29 | #include "libsigrok-internal.h" | |
30 | #include "protocol.h" | |
7dc55d93 AG |
31 | |
32 | static const int hwopts[] = { | |
33 | SR_HWOPT_CONN, | |
34 | SR_HWOPT_SERIALCOMM, | |
35 | 0, | |
36 | }; | |
37 | ||
38 | static const int hwcaps[] = { | |
39 | SR_HWCAP_MULTIMETER, | |
40 | SR_HWCAP_LIMIT_SAMPLES, | |
41 | SR_HWCAP_CONTINUOUS, | |
42 | 0, | |
43 | }; | |
44 | ||
45 | static const char *probe_names[] = { | |
46 | "Probe", | |
47 | NULL, | |
48 | }; | |
49 | ||
f086b830 | 50 | SR_PRIV struct sr_dev_driver digitek_dt4000zc_driver_info; |
729b01f9 | 51 | SR_PRIV struct sr_dev_driver tekpower_tp4000zc_driver_info; |
ce3777ad | 52 | SR_PRIV struct sr_dev_driver metex_me31_driver_info; |
f0ac4929 | 53 | SR_PRIV struct sr_dev_driver peaktech_3410_driver_info; |
5887c9cc | 54 | SR_PRIV struct sr_dev_driver mastech_mas345_driver_info; |
6dca2f16 | 55 | SR_PRIV struct sr_dev_driver va_va18b_driver_info; |
a53da082 | 56 | SR_PRIV struct sr_dev_driver metex_m3640d_driver_info; |
a376ffea | 57 | SR_PRIV struct sr_dev_driver peaktech_4370_driver_info; |
d4bd66a0 | 58 | SR_PRIV struct sr_dev_driver pce_pce_dm32_driver_info; |
d5ce233f | 59 | SR_PRIV struct sr_dev_driver radioshack_22_168_driver_info; |
21829e67 | 60 | SR_PRIV struct sr_dev_driver radioshack_22_812_driver_info; |
f086b830 | 61 | |
729b01f9 | 62 | SR_PRIV struct dmm_info dmms[] = { |
f086b830 | 63 | { |
ce3777ad UH |
64 | "Digitek", "DT4000ZC", "2400/8n1", 2400, |
65 | FS9721_PACKET_SIZE, NULL, | |
66 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
f086b830 | 67 | dmm_details_dt4000zc, |
dccfe015 | 68 | &digitek_dt4000zc_driver_info, receive_data_DIGITEK_DT4000ZC, |
f086b830 | 69 | }, |
729b01f9 | 70 | { |
ce3777ad UH |
71 | "TekPower", "TP4000ZC", "2400/8n1", 2400, |
72 | FS9721_PACKET_SIZE, NULL, | |
73 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
729b01f9 | 74 | dmm_details_tp4000zc, |
dccfe015 | 75 | &tekpower_tp4000zc_driver_info, receive_data_TEKPOWER_TP4000ZC, |
729b01f9 | 76 | }, |
ce3777ad UH |
77 | { |
78 | "Metex", "ME-31", "600/7n2/rts=0/dtr=1", 600, | |
79 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
80 | sr_metex14_packet_valid, sr_metex14_parse, | |
81 | NULL, | |
dccfe015 | 82 | &metex_me31_driver_info, receive_data_METEX_ME31, |
ce3777ad | 83 | }, |
f0ac4929 UH |
84 | { |
85 | "Peaktech", "3410", "600/7n2/rts=0/dtr=1", 600, | |
86 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
87 | sr_metex14_packet_valid, sr_metex14_parse, | |
88 | NULL, | |
dccfe015 | 89 | &peaktech_3410_driver_info, receive_data_PEAKTECH_3410, |
f0ac4929 | 90 | }, |
5887c9cc UH |
91 | { |
92 | "MASTECH", "MAS345", "600/7n2/rts=0/dtr=1", 600, | |
93 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
94 | sr_metex14_packet_valid, sr_metex14_parse, | |
95 | NULL, | |
dccfe015 | 96 | &mastech_mas345_driver_info, receive_data_MASTECH_MAS345, |
5887c9cc | 97 | }, |
6dca2f16 UH |
98 | { |
99 | "V&A", "VA18B", "2400/8n1", 2400, | |
100 | FS9721_PACKET_SIZE, NULL, | |
101 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
102 | dmm_details_va18b, | |
dccfe015 | 103 | &va_va18b_driver_info, receive_data_VA_VA18B, |
6dca2f16 | 104 | }, |
a53da082 UH |
105 | { |
106 | "Metex", "M-3640D", "1200/7n2/rts=0/dtr=1", 1200, | |
107 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
108 | sr_metex14_packet_valid, sr_metex14_parse, | |
109 | NULL, | |
dccfe015 | 110 | &metex_m3640d_driver_info, receive_data_METEX_M3640D, |
a53da082 | 111 | }, |
a376ffea UH |
112 | { |
113 | "PeakTech", "4370", "1200/7n2/rts=0/dtr=1", 1200, | |
114 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
115 | sr_metex14_packet_valid, sr_metex14_parse, | |
116 | NULL, | |
dccfe015 | 117 | &peaktech_4370_driver_info, receive_data_PEAKTECH_4370, |
a376ffea | 118 | }, |
d4bd66a0 UH |
119 | { |
120 | "PCE", "PCE-DM32", "2400/8n1", 2400, | |
121 | FS9721_PACKET_SIZE, NULL, | |
122 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
123 | dmm_details_pce_dm32, | |
dccfe015 | 124 | &pce_pce_dm32_driver_info, receive_data_PCE_PCE_DM32, |
d4bd66a0 | 125 | }, |
d5ce233f AG |
126 | { |
127 | "RadioShack", "22-168", "1200/7n2/rts=0/dtr=1", 1200, | |
128 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
129 | sr_metex14_packet_valid, sr_metex14_parse, | |
130 | NULL, | |
dccfe015 | 131 | &radioshack_22_168_driver_info, receive_data_RADIOSHACK_22_168, |
d5ce233f | 132 | }, |
21829e67 AG |
133 | { |
134 | "RadioShack", "22-812", "4800/8n1/rts=0/dtr=1", 4800, | |
135 | RS9LCD_PACKET_SIZE, NULL, | |
136 | sr_rs9lcd_packet_valid, sr_rs9lcd_parse, | |
137 | NULL, | |
dccfe015 | 138 | &radioshack_22_812_driver_info, receive_data_RADIOSHACK_22_812, |
21829e67 | 139 | }, |
729b01f9 | 140 | }; |
7dc55d93 AG |
141 | |
142 | /* Properly close and free all devices. */ | |
fd9b2b86 | 143 | static int clear_instances(int dmm) |
7dc55d93 AG |
144 | { |
145 | struct sr_dev_inst *sdi; | |
146 | struct drv_context *drvc; | |
147 | struct dev_context *devc; | |
148 | GSList *l; | |
fd9b2b86 | 149 | struct sr_dev_driver *di; |
7dc55d93 | 150 | |
fd9b2b86 | 151 | di = dmms[dmm].di; |
26be4ebe | 152 | |
7dc55d93 AG |
153 | if (!(drvc = di->priv)) |
154 | return SR_OK; | |
155 | ||
156 | drvc = di->priv; | |
157 | for (l = drvc->instances; l; l = l->next) { | |
158 | if (!(sdi = l->data)) | |
159 | continue; | |
160 | if (!(devc = sdi->priv)) | |
161 | continue; | |
162 | sr_serial_dev_inst_free(devc->serial); | |
163 | sr_dev_inst_free(sdi); | |
164 | } | |
165 | g_slist_free(drvc->instances); | |
166 | drvc->instances = NULL; | |
167 | ||
168 | return SR_OK; | |
169 | } | |
170 | ||
34f06b90 | 171 | static int hw_init(struct sr_context *sr_ctx, int dmm) |
7dc55d93 AG |
172 | { |
173 | struct drv_context *drvc; | |
174 | ||
175 | if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) { | |
bbabddbd UH |
176 | sr_err("Driver context malloc failed."); |
177 | return SR_ERR_MALLOC; | |
7dc55d93 AG |
178 | } |
179 | ||
06b7a8af | 180 | sr_dbg("Selected '%s' subdriver.", dmms[dmm].di->name); |
729b01f9 | 181 | |
1ebe4b4e | 182 | drvc->sr_ctx = sr_ctx; |
06b7a8af | 183 | dmms[dmm].di->priv = drvc; |
7dc55d93 AG |
184 | |
185 | return SR_OK; | |
186 | } | |
187 | ||
729b01f9 | 188 | static GSList *scan(const char *conn, const char *serialcomm, int dmm) |
7dc55d93 AG |
189 | { |
190 | struct sr_dev_inst *sdi; | |
191 | struct drv_context *drvc; | |
192 | struct dev_context *devc; | |
193 | struct sr_probe *probe; | |
d35afa87 | 194 | struct sr_serial_dev_inst *serial; |
7dc55d93 | 195 | GSList *devices; |
2546b05c AG |
196 | int dropped, ret; |
197 | size_t len; | |
198 | uint8_t buf[128]; | |
7dc55d93 | 199 | |
d35afa87 | 200 | if (!(serial = sr_serial_dev_inst_new(conn, serialcomm))) |
7dc55d93 | 201 | return NULL; |
d35afa87 | 202 | |
ce3777ad | 203 | if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) |
7dc55d93 | 204 | return NULL; |
7dc55d93 | 205 | |
22f54192 | 206 | sr_info("Probing serial port %s.", conn); |
7dc55d93 | 207 | |
06b7a8af | 208 | drvc = dmms[dmm].di->priv; |
7dc55d93 | 209 | devices = NULL; |
d35afa87 | 210 | serial_flush(serial); |
bbabddbd | 211 | |
ce3777ad UH |
212 | /* Request a packet if the DMM requires this. */ |
213 | if (dmms[dmm].packet_request) { | |
214 | if ((ret = dmms[dmm].packet_request(serial)) < 0) { | |
215 | sr_err("Failed to request packet: %d.", ret); | |
216 | return FALSE; | |
217 | } | |
218 | } | |
219 | ||
22f54192 UH |
220 | /* |
221 | * There's no way to get an ID from the multimeter. It just sends data | |
222 | * periodically (or upon request), so the best we can do is check if | |
223 | * the packets match the expected format. | |
224 | */ | |
225 | ||
226 | /* Let's get a bit of data and see if we can find a packet. */ | |
227 | len = sizeof(buf); | |
729b01f9 UH |
228 | ret = serial_stream_detect(serial, buf, &len, dmms[dmm].packet_size, |
229 | dmms[dmm].packet_valid, 1000, | |
230 | dmms[dmm].baudrate); | |
2546b05c AG |
231 | if (ret != SR_OK) |
232 | goto scan_cleanup; | |
7dc55d93 | 233 | |
2546b05c AG |
234 | /* |
235 | * If we dropped more than two packets worth of data, something is | |
236 | * wrong. We shouldn't quit however, since the dropped bytes might be | |
237 | * just zeroes at the beginning of the stream. Those can occur as a | |
22f54192 UH |
238 | * combination of the nonstandard cable that ships with some devices |
239 | * and the serial port or USB to serial adapter. | |
2546b05c | 240 | */ |
729b01f9 UH |
241 | dropped = len - dmms[dmm].packet_size; |
242 | if (dropped > 2 * dmms[dmm].packet_size) | |
6bef68a7 | 243 | sr_warn("Had to drop too much data."); |
7dc55d93 | 244 | |
2546b05c | 245 | sr_info("Found device on port %s.", conn); |
7dc55d93 | 246 | |
729b01f9 UH |
247 | if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, dmms[dmm].vendor, |
248 | dmms[dmm].device, ""))) | |
2546b05c | 249 | goto scan_cleanup; |
6bef68a7 | 250 | |
2546b05c AG |
251 | if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { |
252 | sr_err("Device context malloc failed."); | |
253 | goto scan_cleanup; | |
7dc55d93 AG |
254 | } |
255 | ||
2546b05c | 256 | devc->serial = serial; |
c6904909 | 257 | devc->subdriver = dmm; |
2546b05c AG |
258 | |
259 | sdi->priv = devc; | |
06b7a8af | 260 | sdi->driver = dmms[dmm].di; |
2546b05c AG |
261 | if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) |
262 | goto scan_cleanup; | |
263 | sdi->probes = g_slist_append(sdi->probes, probe); | |
264 | drvc->instances = g_slist_append(drvc->instances, sdi); | |
265 | devices = g_slist_append(devices, sdi); | |
266 | ||
267 | scan_cleanup: | |
d35afa87 | 268 | serial_close(serial); |
2546b05c | 269 | |
7dc55d93 AG |
270 | return devices; |
271 | } | |
272 | ||
ea4c6c23 | 273 | static GSList *hw_scan(GSList *options, int dmm) |
7dc55d93 AG |
274 | { |
275 | struct sr_hwopt *opt; | |
276 | GSList *l, *devices; | |
277 | const char *conn, *serialcomm; | |
278 | ||
279 | conn = serialcomm = NULL; | |
280 | for (l = options; l; l = l->next) { | |
281 | opt = l->data; | |
282 | switch (opt->hwopt) { | |
283 | case SR_HWOPT_CONN: | |
284 | conn = opt->value; | |
285 | break; | |
286 | case SR_HWOPT_SERIALCOMM: | |
287 | serialcomm = opt->value; | |
288 | break; | |
289 | } | |
290 | } | |
291 | if (!conn) | |
292 | return NULL; | |
293 | ||
294 | if (serialcomm) { | |
295 | /* Use the provided comm specs. */ | |
729b01f9 | 296 | devices = scan(conn, serialcomm, dmm); |
7dc55d93 | 297 | } else { |
d35afa87 | 298 | /* Try the default. */ |
729b01f9 | 299 | devices = scan(conn, dmms[dmm].conn, dmm); |
7dc55d93 AG |
300 | } |
301 | ||
302 | return devices; | |
303 | } | |
304 | ||
ca4b1309 | 305 | static GSList *hw_dev_list(int dmm) |
7dc55d93 AG |
306 | { |
307 | struct drv_context *drvc; | |
308 | ||
ca4b1309 | 309 | drvc = dmms[dmm].di->priv; |
7dc55d93 AG |
310 | |
311 | return drvc->instances; | |
312 | } | |
313 | ||
314 | static int hw_dev_open(struct sr_dev_inst *sdi) | |
315 | { | |
316 | struct dev_context *devc; | |
317 | ||
318 | if (!(devc = sdi->priv)) { | |
319 | sr_err("sdi->priv was NULL."); | |
320 | return SR_ERR_BUG; | |
321 | } | |
322 | ||
ce3777ad | 323 | if (serial_open(devc->serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) |
7dc55d93 | 324 | return SR_ERR; |
bbabddbd | 325 | |
7dc55d93 AG |
326 | sdi->status = SR_ST_ACTIVE; |
327 | ||
328 | return SR_OK; | |
329 | } | |
330 | ||
331 | static int hw_dev_close(struct sr_dev_inst *sdi) | |
332 | { | |
333 | struct dev_context *devc; | |
334 | ||
335 | if (!(devc = sdi->priv)) { | |
336 | sr_err("sdi->priv was NULL."); | |
337 | return SR_ERR_BUG; | |
338 | } | |
339 | ||
340 | if (devc->serial && devc->serial->fd != -1) { | |
d35afa87 | 341 | serial_close(devc->serial); |
7dc55d93 AG |
342 | sdi->status = SR_ST_INACTIVE; |
343 | } | |
344 | ||
345 | return SR_OK; | |
346 | } | |
347 | ||
0c23677d | 348 | static int hw_cleanup(int dmm) |
7dc55d93 | 349 | { |
fd9b2b86 | 350 | clear_instances(dmm); |
7dc55d93 AG |
351 | |
352 | return SR_OK; | |
353 | } | |
354 | ||
355 | static int hw_info_get(int info_id, const void **data, | |
bbabddbd | 356 | const struct sr_dev_inst *sdi) |
7dc55d93 | 357 | { |
bbabddbd | 358 | (void)sdi; |
7dc55d93 AG |
359 | |
360 | switch (info_id) { | |
361 | case SR_DI_HWOPTS: | |
362 | *data = hwopts; | |
363 | break; | |
364 | case SR_DI_HWCAPS: | |
365 | *data = hwcaps; | |
366 | break; | |
367 | case SR_DI_NUM_PROBES: | |
368 | *data = GINT_TO_POINTER(1); | |
369 | break; | |
370 | case SR_DI_PROBE_NAMES: | |
371 | *data = probe_names; | |
372 | break; | |
373 | default: | |
374 | return SR_ERR_ARG; | |
375 | } | |
376 | ||
377 | return SR_OK; | |
378 | } | |
379 | ||
380 | static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap, | |
bbabddbd | 381 | const void *value) |
7dc55d93 AG |
382 | { |
383 | struct dev_context *devc; | |
384 | ||
385 | if (sdi->status != SR_ST_ACTIVE) | |
386 | return SR_ERR; | |
387 | ||
388 | if (!(devc = sdi->priv)) { | |
389 | sr_err("sdi->priv was NULL."); | |
390 | return SR_ERR_BUG; | |
391 | } | |
392 | ||
393 | switch (hwcap) { | |
394 | case SR_HWCAP_LIMIT_SAMPLES: | |
395 | devc->limit_samples = *(const uint64_t *)value; | |
396 | sr_dbg("Setting sample limit to %" PRIu64 ".", | |
397 | devc->limit_samples); | |
398 | break; | |
399 | default: | |
400 | sr_err("Unknown capability: %d.", hwcap); | |
401 | return SR_ERR; | |
402 | break; | |
403 | } | |
404 | ||
405 | return SR_OK; | |
406 | } | |
407 | ||
408 | static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, | |
bbabddbd | 409 | void *cb_data) |
7dc55d93 AG |
410 | { |
411 | struct sr_datafeed_packet packet; | |
412 | struct sr_datafeed_header header; | |
413 | struct sr_datafeed_meta_analog meta; | |
414 | struct dev_context *devc; | |
415 | ||
416 | if (!(devc = sdi->priv)) { | |
417 | sr_err("sdi->priv was NULL."); | |
418 | return SR_ERR_BUG; | |
419 | } | |
420 | ||
421 | sr_dbg("Starting acquisition."); | |
422 | ||
423 | devc->cb_data = cb_data; | |
424 | ||
bbabddbd UH |
425 | /* |
426 | * Reset the number of samples to take. If we've already collected our | |
7dc55d93 | 427 | * quota, but we start a new session, and don't reset this, we'll just |
bbabddbd UH |
428 | * quit without acquiring any new samples. |
429 | */ | |
7dc55d93 AG |
430 | devc->num_samples = 0; |
431 | ||
432 | /* Send header packet to the session bus. */ | |
433 | sr_dbg("Sending SR_DF_HEADER."); | |
434 | packet.type = SR_DF_HEADER; | |
435 | packet.payload = (uint8_t *)&header; | |
436 | header.feed_version = 1; | |
437 | gettimeofday(&header.starttime, NULL); | |
438 | sr_session_send(devc->cb_data, &packet); | |
439 | ||
440 | /* Send metadata about the SR_DF_ANALOG packets to come. */ | |
441 | sr_dbg("Sending SR_DF_META_ANALOG."); | |
442 | packet.type = SR_DF_META_ANALOG; | |
443 | packet.payload = &meta; | |
444 | meta.num_probes = 1; | |
445 | sr_session_send(devc->cb_data, &packet); | |
446 | ||
bbabddbd | 447 | /* Poll every 50ms, or whenever some data comes in. */ |
7dc55d93 | 448 | sr_source_add(devc->serial->fd, G_IO_IN, 50, |
c6904909 | 449 | dmms[devc->subdriver].receive_data, (void *)sdi); |
7dc55d93 AG |
450 | |
451 | return SR_OK; | |
452 | } | |
453 | ||
69b07d14 | 454 | static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) |
7dc55d93 AG |
455 | { |
456 | struct sr_datafeed_packet packet; | |
457 | struct dev_context *devc; | |
458 | ||
459 | if (sdi->status != SR_ST_ACTIVE) | |
460 | return SR_ERR; | |
461 | ||
462 | if (!(devc = sdi->priv)) { | |
463 | sr_err("sdi->priv was NULL."); | |
464 | return SR_ERR_BUG; | |
465 | } | |
466 | ||
467 | sr_dbg("Stopping acquisition."); | |
468 | ||
469 | sr_source_remove(devc->serial->fd); | |
470 | hw_dev_close((struct sr_dev_inst *)sdi); | |
471 | ||
472 | /* Send end packet to the session bus. */ | |
473 | sr_dbg("Sending SR_DF_END."); | |
474 | packet.type = SR_DF_END; | |
475 | sr_session_send(cb_data, &packet); | |
476 | ||
477 | return SR_OK; | |
478 | } | |
479 | ||
3098b390 AG |
480 | /* Driver-specific API function wrappers */ |
481 | #define HW_INIT(X) \ | |
482 | static int hw_init_##X(struct sr_context *sr_ctx) { return hw_init(sr_ctx, X); } | |
483 | #define HW_CLEANUP(X) \ | |
484 | static int hw_cleanup_##X(void) { return hw_cleanup(X); } | |
485 | #define HW_SCAN(X) \ | |
486 | static GSList *hw_scan_##X(GSList *options) { return hw_scan(options, X); } | |
487 | #define HW_DEV_LIST(X) \ | |
488 | static GSList *hw_dev_list_##X(void) { return hw_dev_list(X); } | |
489 | #define CLEAR_INSTANCES(X) \ | |
490 | static int clear_instances_##X(void) { return clear_instances(X); } | |
491 | ||
492 | /* Driver structs and API function wrappers */ | |
f1437c68 | 493 | #define DRV(ID, ID_UPPER, NAME, LONGNAME) \ |
3098b390 AG |
494 | HW_INIT(ID_UPPER) \ |
495 | HW_CLEANUP(ID_UPPER) \ | |
496 | HW_SCAN(ID_UPPER) \ | |
497 | HW_DEV_LIST(ID_UPPER) \ | |
498 | CLEAR_INSTANCES(ID_UPPER) \ | |
f1437c68 UH |
499 | SR_PRIV struct sr_dev_driver ID##_driver_info = { \ |
500 | .name = NAME, \ | |
501 | .longname = LONGNAME, \ | |
502 | .api_version = 1, \ | |
503 | .init = hw_init_##ID_UPPER, \ | |
0c23677d | 504 | .cleanup = hw_cleanup_##ID_UPPER, \ |
ea4c6c23 | 505 | .scan = hw_scan_##ID_UPPER, \ |
ca4b1309 | 506 | .dev_list = hw_dev_list_##ID_UPPER, \ |
fd9b2b86 | 507 | .dev_clear = clear_instances_##ID_UPPER, \ |
f1437c68 UH |
508 | .dev_open = hw_dev_open, \ |
509 | .dev_close = hw_dev_close, \ | |
510 | .info_get = hw_info_get, \ | |
511 | .dev_config_set = hw_dev_config_set, \ | |
512 | .dev_acquisition_start = hw_dev_acquisition_start, \ | |
513 | .dev_acquisition_stop = hw_dev_acquisition_stop, \ | |
514 | .priv = NULL, \ | |
21829e67 | 515 | }; |
3098b390 | 516 | |
f1437c68 UH |
517 | DRV(digitek_dt4000zc, DIGITEK_DT4000ZC, "digitek-dt4000zc", "Digitek DT4000ZC") |
518 | DRV(tekpower_tp4000zc, TEKPOWER_TP4000ZC, "tekpower-tp4000zc", "TekPower TP4000ZC") | |
519 | DRV(metex_me31, METEX_ME31, "metex-me31", "Metex ME-31") | |
520 | DRV(peaktech_3410, PEAKTECH_3410, "peaktech-3410", "PeakTech 3410") | |
521 | DRV(mastech_mas345, MASTECH_MAS345, "mastech-mas345", "MASTECH MAS345") | |
522 | DRV(va_va18b, VA_VA18B, "va-va18b", "V&A VA18B") | |
523 | DRV(metex_m3640d, METEX_M3640D, "metex-m3640d", "Metex M-3640D") | |
524 | DRV(peaktech_4370, PEAKTECH_4370, "peaktech-4370", "PeakTech 4370") | |
525 | DRV(pce_pce_dm32, PCE_PCE_DM32, "pce-pce-dm32", "PCE PCE-DM32") | |
526 | DRV(radioshack_22_168, RADIOSHACK_22_168, "radioshack-22-168", "RadioShack 22-168") | |
527 | DRV(radioshack_22_812, RADIOSHACK_22_812, "radioshack-22-812", "RadioShack 22-812") |