]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * This file is part of the libsigrok project. | |
3 | * | |
4 | * Copyright (C) 2012 Bert Vermeulen <bert@biot.com> | |
5 | * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com> | |
6 | * Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de> | |
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 | ||
22 | #include <sys/types.h> | |
23 | #include <sys/stat.h> | |
24 | #include <fcntl.h> | |
25 | #include <string.h> | |
26 | #include <errno.h> | |
27 | #include <glib.h> | |
28 | #include "libsigrok.h" | |
29 | #include "libsigrok-internal.h" | |
30 | #include "protocol.h" | |
31 | ||
32 | static const int32_t hwopts[] = { | |
33 | SR_CONF_CONN, | |
34 | SR_CONF_SERIALCOMM, | |
35 | }; | |
36 | ||
37 | static const int32_t hwcaps[] = { | |
38 | SR_CONF_MULTIMETER, | |
39 | SR_CONF_LIMIT_SAMPLES, | |
40 | SR_CONF_LIMIT_MSEC, | |
41 | SR_CONF_CONTINUOUS, | |
42 | }; | |
43 | ||
44 | SR_PRIV struct sr_dev_driver digitek_dt4000zc_driver_info; | |
45 | SR_PRIV struct sr_dev_driver tekpower_tp4000zc_driver_info; | |
46 | SR_PRIV struct sr_dev_driver metex_me31_driver_info; | |
47 | SR_PRIV struct sr_dev_driver peaktech_3410_driver_info; | |
48 | SR_PRIV struct sr_dev_driver mastech_mas345_driver_info; | |
49 | SR_PRIV struct sr_dev_driver va_va18b_driver_info; | |
50 | SR_PRIV struct sr_dev_driver metex_m3640d_driver_info; | |
51 | SR_PRIV struct sr_dev_driver peaktech_4370_driver_info; | |
52 | SR_PRIV struct sr_dev_driver pce_pce_dm32_driver_info; | |
53 | SR_PRIV struct sr_dev_driver radioshack_22_168_driver_info; | |
54 | SR_PRIV struct sr_dev_driver radioshack_22_805_driver_info; | |
55 | SR_PRIV struct sr_dev_driver radioshack_22_812_driver_info; | |
56 | SR_PRIV struct sr_dev_driver tecpel_dmm_8061_ser_driver_info; | |
57 | SR_PRIV struct sr_dev_driver voltcraft_m3650d_driver_info; | |
58 | SR_PRIV struct sr_dev_driver voltcraft_vc820_ser_driver_info; | |
59 | SR_PRIV struct sr_dev_driver voltcraft_vc830_ser_driver_info; | |
60 | SR_PRIV struct sr_dev_driver voltcraft_vc840_ser_driver_info; | |
61 | SR_PRIV struct sr_dev_driver uni_t_ut60a_ser_driver_info; | |
62 | SR_PRIV struct sr_dev_driver uni_t_ut60e_ser_driver_info; | |
63 | SR_PRIV struct sr_dev_driver uni_t_ut61d_ser_driver_info; | |
64 | SR_PRIV struct sr_dev_driver uni_t_ut61e_ser_driver_info; | |
65 | ||
66 | SR_PRIV struct dmm_info dmms[] = { | |
67 | { | |
68 | "Digitek", "DT4000ZC", "2400/8n1", 2400, | |
69 | FS9721_PACKET_SIZE, NULL, | |
70 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
71 | sr_fs9721_10_temp_c, | |
72 | &digitek_dt4000zc_driver_info, receive_data_DIGITEK_DT4000ZC, | |
73 | }, | |
74 | { | |
75 | "TekPower", "TP4000ZC", "2400/8n1", 2400, | |
76 | FS9721_PACKET_SIZE, NULL, | |
77 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
78 | sr_fs9721_10_temp_c, | |
79 | &tekpower_tp4000zc_driver_info, receive_data_TEKPOWER_TP4000ZC, | |
80 | }, | |
81 | { | |
82 | "Metex", "ME-31", "600/7n2/rts=0/dtr=1", 600, | |
83 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
84 | sr_metex14_packet_valid, sr_metex14_parse, | |
85 | NULL, | |
86 | &metex_me31_driver_info, receive_data_METEX_ME31, | |
87 | }, | |
88 | { | |
89 | "Peaktech", "3410", "600/7n2/rts=0/dtr=1", 600, | |
90 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
91 | sr_metex14_packet_valid, sr_metex14_parse, | |
92 | NULL, | |
93 | &peaktech_3410_driver_info, receive_data_PEAKTECH_3410, | |
94 | }, | |
95 | { | |
96 | "MASTECH", "MAS345", "600/7n2/rts=0/dtr=1", 600, | |
97 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
98 | sr_metex14_packet_valid, sr_metex14_parse, | |
99 | NULL, | |
100 | &mastech_mas345_driver_info, receive_data_MASTECH_MAS345, | |
101 | }, | |
102 | { | |
103 | "V&A", "VA18B", "2400/8n1", 2400, | |
104 | FS9721_PACKET_SIZE, NULL, | |
105 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
106 | sr_fs9721_01_temp_c, | |
107 | &va_va18b_driver_info, receive_data_VA_VA18B, | |
108 | }, | |
109 | { | |
110 | "Metex", "M-3640D", "1200/7n2/rts=0/dtr=1", 1200, | |
111 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
112 | sr_metex14_packet_valid, sr_metex14_parse, | |
113 | NULL, | |
114 | &metex_m3640d_driver_info, receive_data_METEX_M3640D, | |
115 | }, | |
116 | { | |
117 | "PeakTech", "4370", "1200/7n2/rts=0/dtr=1", 1200, | |
118 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
119 | sr_metex14_packet_valid, sr_metex14_parse, | |
120 | NULL, | |
121 | &peaktech_4370_driver_info, receive_data_PEAKTECH_4370, | |
122 | }, | |
123 | { | |
124 | "PCE", "PCE-DM32", "2400/8n1", 2400, | |
125 | FS9721_PACKET_SIZE, NULL, | |
126 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
127 | sr_fs9721_01_10_temp_f_c, | |
128 | &pce_pce_dm32_driver_info, receive_data_PCE_PCE_DM32, | |
129 | }, | |
130 | { | |
131 | "RadioShack", "22-168", "1200/7n2/rts=0/dtr=1", 1200, | |
132 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
133 | sr_metex14_packet_valid, sr_metex14_parse, | |
134 | NULL, | |
135 | &radioshack_22_168_driver_info, receive_data_RADIOSHACK_22_168, | |
136 | }, | |
137 | { | |
138 | "RadioShack", "22-805", "600/7n2/rts=0/dtr=1", 600, | |
139 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
140 | sr_metex14_packet_valid, sr_metex14_parse, | |
141 | NULL, | |
142 | &radioshack_22_805_driver_info, receive_data_RADIOSHACK_22_805, | |
143 | }, | |
144 | { | |
145 | "RadioShack", "22-812", "4800/8n1/rts=0/dtr=1", 4800, | |
146 | RS9LCD_PACKET_SIZE, NULL, | |
147 | sr_rs9lcd_packet_valid, sr_rs9lcd_parse, | |
148 | NULL, | |
149 | &radioshack_22_812_driver_info, receive_data_RADIOSHACK_22_812, | |
150 | }, | |
151 | { | |
152 | "Tecpel", "DMM-8061 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
153 | 2400, FS9721_PACKET_SIZE, NULL, | |
154 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
155 | sr_fs9721_00_temp_c, | |
156 | &tecpel_dmm_8061_ser_driver_info, | |
157 | receive_data_TECPEL_DMM_8061_SER, | |
158 | }, | |
159 | { | |
160 | "Voltcraft", "M-3650D", "1200/7n2/rts=0/dtr=1", 1200, | |
161 | METEX14_PACKET_SIZE, sr_metex14_packet_request, | |
162 | sr_metex14_packet_valid, sr_metex14_parse, | |
163 | NULL, | |
164 | &voltcraft_m3650d_driver_info, receive_data_VOLTCRAFT_M3650D, | |
165 | }, | |
166 | { | |
167 | "Voltcraft", "VC-820 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
168 | 2400, FS9721_PACKET_SIZE, NULL, | |
169 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
170 | NULL, | |
171 | &voltcraft_vc820_ser_driver_info, | |
172 | receive_data_VOLTCRAFT_VC820_SER, | |
173 | }, | |
174 | { | |
175 | /* | |
176 | * Note: The VC830 doesn't set the 'volt' and 'diode' bits of | |
177 | * the FS9922 protocol. Instead, it only sets the user-defined | |
178 | * bit "z1" to indicate "diode mode" and "voltage". | |
179 | */ | |
180 | "Voltcraft", "VC-830 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
181 | 2400, FS9922_PACKET_SIZE, NULL, | |
182 | sr_fs9922_packet_valid, sr_fs9922_parse, | |
183 | &sr_fs9922_z1_diode, | |
184 | &voltcraft_vc830_ser_driver_info, | |
185 | receive_data_VOLTCRAFT_VC830_SER, | |
186 | }, | |
187 | { | |
188 | "Voltcraft", "VC-840 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
189 | 2400, FS9721_PACKET_SIZE, NULL, | |
190 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
191 | sr_fs9721_00_temp_c, | |
192 | &voltcraft_vc840_ser_driver_info, | |
193 | receive_data_VOLTCRAFT_VC840_SER, | |
194 | }, | |
195 | { | |
196 | "UNI-T", "UT60A (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
197 | 2400, FS9721_PACKET_SIZE, NULL, | |
198 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
199 | NULL, | |
200 | &uni_t_ut60a_ser_driver_info, | |
201 | receive_data_UNI_T_UT60A_SER, | |
202 | }, | |
203 | { | |
204 | "UNI-T", "UT60E (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
205 | 2400, FS9721_PACKET_SIZE, NULL, | |
206 | sr_fs9721_packet_valid, sr_fs9721_parse, | |
207 | sr_fs9721_00_temp_c, | |
208 | &uni_t_ut60e_ser_driver_info, | |
209 | receive_data_UNI_T_UT60E_SER, | |
210 | }, | |
211 | { | |
212 | "UNI-T", "UT61D (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", | |
213 | 2400, FS9922_PACKET_SIZE, NULL, | |
214 | sr_fs9922_packet_valid, sr_fs9922_parse, NULL, | |
215 | &uni_t_ut61d_ser_driver_info, receive_data_UNI_T_UT61D_SER, | |
216 | }, | |
217 | { | |
218 | /* Note: ES51922 baudrate is actually 19230! */ | |
219 | "UNI-T", "UT61E (UT-D02 cable)", "19200/7o1/rts=0/dtr=1", | |
220 | 19200, ES51922_PACKET_SIZE, NULL, | |
221 | sr_es51922_packet_valid, sr_es51922_parse, NULL, | |
222 | &uni_t_ut61e_ser_driver_info, receive_data_UNI_T_UT61E_SER, | |
223 | }, | |
224 | }; | |
225 | ||
226 | static int dev_clear(int dmm) | |
227 | { | |
228 | return std_dev_clear(dmms[dmm].di, NULL); | |
229 | } | |
230 | ||
231 | static int init(struct sr_context *sr_ctx, int dmm) | |
232 | { | |
233 | sr_dbg("Selected '%s' subdriver.", dmms[dmm].di->name); | |
234 | ||
235 | return std_init(sr_ctx, dmms[dmm].di, LOG_PREFIX); | |
236 | } | |
237 | ||
238 | static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm) | |
239 | { | |
240 | struct sr_dev_inst *sdi; | |
241 | struct drv_context *drvc; | |
242 | struct dev_context *devc; | |
243 | struct sr_probe *probe; | |
244 | struct sr_serial_dev_inst *serial; | |
245 | GSList *devices; | |
246 | int dropped, ret; | |
247 | size_t len; | |
248 | uint8_t buf[128]; | |
249 | ||
250 | if (!(serial = sr_serial_dev_inst_new(conn, serialcomm))) | |
251 | return NULL; | |
252 | ||
253 | if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) | |
254 | return NULL; | |
255 | ||
256 | sr_info("Probing serial port %s.", conn); | |
257 | ||
258 | drvc = dmms[dmm].di->priv; | |
259 | devices = NULL; | |
260 | serial_flush(serial); | |
261 | ||
262 | /* Request a packet if the DMM requires this. */ | |
263 | if (dmms[dmm].packet_request) { | |
264 | if ((ret = dmms[dmm].packet_request(serial)) < 0) { | |
265 | sr_err("Failed to request packet: %d.", ret); | |
266 | return FALSE; | |
267 | } | |
268 | } | |
269 | ||
270 | /* | |
271 | * There's no way to get an ID from the multimeter. It just sends data | |
272 | * periodically (or upon request), so the best we can do is check if | |
273 | * the packets match the expected format. | |
274 | */ | |
275 | ||
276 | /* Let's get a bit of data and see if we can find a packet. */ | |
277 | len = sizeof(buf); | |
278 | ret = serial_stream_detect(serial, buf, &len, dmms[dmm].packet_size, | |
279 | dmms[dmm].packet_valid, 1000, | |
280 | dmms[dmm].baudrate); | |
281 | if (ret != SR_OK) | |
282 | goto scan_cleanup; | |
283 | ||
284 | /* | |
285 | * If we dropped more than two packets worth of data, something is | |
286 | * wrong. We shouldn't quit however, since the dropped bytes might be | |
287 | * just zeroes at the beginning of the stream. Those can occur as a | |
288 | * combination of the nonstandard cable that ships with some devices | |
289 | * and the serial port or USB to serial adapter. | |
290 | */ | |
291 | dropped = len - dmms[dmm].packet_size; | |
292 | if (dropped > 2 * dmms[dmm].packet_size) | |
293 | sr_warn("Had to drop too much data."); | |
294 | ||
295 | sr_info("Found device on port %s.", conn); | |
296 | ||
297 | if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, dmms[dmm].vendor, | |
298 | dmms[dmm].device, ""))) | |
299 | goto scan_cleanup; | |
300 | ||
301 | if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { | |
302 | sr_err("Device context malloc failed."); | |
303 | goto scan_cleanup; | |
304 | } | |
305 | ||
306 | sdi->inst_type = SR_INST_SERIAL; | |
307 | sdi->conn = serial; | |
308 | ||
309 | sdi->priv = devc; | |
310 | sdi->driver = dmms[dmm].di; | |
311 | if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) | |
312 | goto scan_cleanup; | |
313 | sdi->probes = g_slist_append(sdi->probes, probe); | |
314 | drvc->instances = g_slist_append(drvc->instances, sdi); | |
315 | devices = g_slist_append(devices, sdi); | |
316 | ||
317 | scan_cleanup: | |
318 | serial_close(serial); | |
319 | ||
320 | return devices; | |
321 | } | |
322 | ||
323 | static GSList *scan(GSList *options, int dmm) | |
324 | { | |
325 | struct sr_config *src; | |
326 | GSList *l, *devices; | |
327 | const char *conn, *serialcomm; | |
328 | ||
329 | conn = serialcomm = NULL; | |
330 | for (l = options; l; l = l->next) { | |
331 | src = l->data; | |
332 | switch (src->key) { | |
333 | case SR_CONF_CONN: | |
334 | conn = g_variant_get_string(src->data, NULL); | |
335 | break; | |
336 | case SR_CONF_SERIALCOMM: | |
337 | serialcomm = g_variant_get_string(src->data, NULL); | |
338 | break; | |
339 | } | |
340 | } | |
341 | if (!conn) | |
342 | return NULL; | |
343 | ||
344 | if (serialcomm) { | |
345 | /* Use the provided comm specs. */ | |
346 | devices = sdmm_scan(conn, serialcomm, dmm); | |
347 | } else { | |
348 | /* Try the default. */ | |
349 | devices = sdmm_scan(conn, dmms[dmm].conn, dmm); | |
350 | } | |
351 | ||
352 | return devices; | |
353 | } | |
354 | ||
355 | static GSList *dev_list(int dmm) | |
356 | { | |
357 | return ((struct drv_context *)(dmms[dmm].di->priv))->instances; | |
358 | } | |
359 | ||
360 | static int dev_open(struct sr_dev_inst *sdi) | |
361 | { | |
362 | struct sr_serial_dev_inst *serial; | |
363 | ||
364 | serial = sdi->conn; | |
365 | if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) | |
366 | return SR_ERR; | |
367 | ||
368 | sdi->status = SR_ST_ACTIVE; | |
369 | ||
370 | return SR_OK; | |
371 | } | |
372 | ||
373 | static int dev_close(struct sr_dev_inst *sdi) | |
374 | { | |
375 | struct sr_serial_dev_inst *serial; | |
376 | ||
377 | serial = sdi->conn; | |
378 | if (serial && serial->fd != -1) { | |
379 | serial_close(serial); | |
380 | sdi->status = SR_ST_INACTIVE; | |
381 | } | |
382 | ||
383 | return SR_OK; | |
384 | } | |
385 | ||
386 | static int cleanup(int dmm) | |
387 | { | |
388 | return dev_clear(dmm); | |
389 | } | |
390 | ||
391 | static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) | |
392 | { | |
393 | struct dev_context *devc; | |
394 | ||
395 | if (sdi->status != SR_ST_ACTIVE) | |
396 | return SR_ERR_DEV_CLOSED; | |
397 | ||
398 | if (!(devc = sdi->priv)) { | |
399 | sr_err("sdi->priv was NULL."); | |
400 | return SR_ERR_BUG; | |
401 | } | |
402 | ||
403 | switch (id) { | |
404 | case SR_CONF_LIMIT_SAMPLES: | |
405 | devc->limit_samples = g_variant_get_uint64(data); | |
406 | sr_dbg("Setting sample limit to %" PRIu64 ".", | |
407 | devc->limit_samples); | |
408 | break; | |
409 | case SR_CONF_LIMIT_MSEC: | |
410 | devc->limit_msec = g_variant_get_uint64(data); | |
411 | sr_dbg("Setting time limit to %" PRIu64 "ms.", | |
412 | devc->limit_msec); | |
413 | break; | |
414 | default: | |
415 | return SR_ERR_NA; | |
416 | } | |
417 | ||
418 | return SR_OK; | |
419 | } | |
420 | ||
421 | static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi) | |
422 | { | |
423 | ||
424 | (void)sdi; | |
425 | ||
426 | switch (key) { | |
427 | case SR_CONF_SCAN_OPTIONS: | |
428 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, | |
429 | hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); | |
430 | break; | |
431 | case SR_CONF_DEVICE_OPTIONS: | |
432 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, | |
433 | hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); | |
434 | break; | |
435 | default: | |
436 | return SR_ERR_NA; | |
437 | } | |
438 | ||
439 | return SR_OK; | |
440 | } | |
441 | ||
442 | static int dev_acquisition_start(const struct sr_dev_inst *sdi, | |
443 | void *cb_data, int dmm) | |
444 | { | |
445 | struct dev_context *devc; | |
446 | struct sr_serial_dev_inst *serial; | |
447 | ||
448 | if (sdi->status != SR_ST_ACTIVE) | |
449 | return SR_ERR_DEV_CLOSED; | |
450 | ||
451 | if (!(devc = sdi->priv)) { | |
452 | sr_err("sdi->priv was NULL."); | |
453 | return SR_ERR_BUG; | |
454 | } | |
455 | ||
456 | devc->cb_data = cb_data; | |
457 | ||
458 | /* | |
459 | * Reset the number of samples to take. If we've already collected our | |
460 | * quota, but we start a new session, and don't reset this, we'll just | |
461 | * quit without acquiring any new samples. | |
462 | */ | |
463 | devc->num_samples = 0; | |
464 | devc->starttime = g_get_monotonic_time(); | |
465 | ||
466 | /* Send header packet to the session bus. */ | |
467 | std_session_send_df_header(cb_data, LOG_PREFIX); | |
468 | ||
469 | /* Poll every 50ms, or whenever some data comes in. */ | |
470 | serial = sdi->conn; | |
471 | sr_source_add(serial->fd, G_IO_IN, 50, | |
472 | dmms[dmm].receive_data, (void *)sdi); | |
473 | ||
474 | return SR_OK; | |
475 | } | |
476 | ||
477 | static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) | |
478 | { | |
479 | return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close, | |
480 | sdi->conn, LOG_PREFIX); | |
481 | } | |
482 | ||
483 | /* Driver-specific API function wrappers */ | |
484 | #define HW_INIT(X) \ | |
485 | static int init_##X(struct sr_context *sr_ctx) { return init(sr_ctx, X); } | |
486 | #define HW_CLEANUP(X) \ | |
487 | static int cleanup_##X(void) { return cleanup(X); } | |
488 | #define HW_SCAN(X) \ | |
489 | static GSList *scan_##X(GSList *options) { return scan(options, X); } | |
490 | #define HW_DEV_LIST(X) \ | |
491 | static GSList *dev_list_##X(void) { return dev_list(X); } | |
492 | #define HW_DEV_CLEAR(X) \ | |
493 | static int dev_clear_##X(void) { return dev_clear(X); } | |
494 | #define HW_DEV_ACQUISITION_START(X) \ | |
495 | static int dev_acquisition_start_##X(const struct sr_dev_inst *sdi, \ | |
496 | void *cb_data) { return dev_acquisition_start(sdi, cb_data, X); } | |
497 | ||
498 | /* Driver structs and API function wrappers */ | |
499 | #define DRV(ID, ID_UPPER, NAME, LONGNAME) \ | |
500 | HW_INIT(ID_UPPER) \ | |
501 | HW_CLEANUP(ID_UPPER) \ | |
502 | HW_SCAN(ID_UPPER) \ | |
503 | HW_DEV_LIST(ID_UPPER) \ | |
504 | HW_DEV_CLEAR(ID_UPPER) \ | |
505 | HW_DEV_ACQUISITION_START(ID_UPPER) \ | |
506 | SR_PRIV struct sr_dev_driver ID##_driver_info = { \ | |
507 | .name = NAME, \ | |
508 | .longname = LONGNAME, \ | |
509 | .api_version = 1, \ | |
510 | .init = init_##ID_UPPER, \ | |
511 | .cleanup = cleanup_##ID_UPPER, \ | |
512 | .scan = scan_##ID_UPPER, \ | |
513 | .dev_list = dev_list_##ID_UPPER, \ | |
514 | .dev_clear = dev_clear_##ID_UPPER, \ | |
515 | .config_get = NULL, \ | |
516 | .config_set = config_set, \ | |
517 | .config_list = config_list, \ | |
518 | .dev_open = dev_open, \ | |
519 | .dev_close = dev_close, \ | |
520 | .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \ | |
521 | .dev_acquisition_stop = dev_acquisition_stop, \ | |
522 | .priv = NULL, \ | |
523 | }; | |
524 | ||
525 | DRV(digitek_dt4000zc, DIGITEK_DT4000ZC, "digitek-dt4000zc", "Digitek DT4000ZC") | |
526 | DRV(tekpower_tp4000zc, TEKPOWER_TP4000ZC, "tekpower-tp4000zc", "TekPower TP4000ZC") | |
527 | DRV(metex_me31, METEX_ME31, "metex-me31", "Metex ME-31") | |
528 | DRV(peaktech_3410, PEAKTECH_3410, "peaktech-3410", "PeakTech 3410") | |
529 | DRV(mastech_mas345, MASTECH_MAS345, "mastech-mas345", "MASTECH MAS345") | |
530 | DRV(va_va18b, VA_VA18B, "va-va18b", "V&A VA18B") | |
531 | DRV(metex_m3640d, METEX_M3640D, "metex-m3640d", "Metex M-3640D") | |
532 | DRV(peaktech_4370, PEAKTECH_4370, "peaktech-4370", "PeakTech 4370") | |
533 | DRV(pce_pce_dm32, PCE_PCE_DM32, "pce-pce-dm32", "PCE PCE-DM32") | |
534 | DRV(radioshack_22_168, RADIOSHACK_22_168, "radioshack-22-168", "RadioShack 22-168") | |
535 | DRV(radioshack_22_805, RADIOSHACK_22_805, "radioshack-22-805", "RadioShack 22-805") | |
536 | DRV(radioshack_22_812, RADIOSHACK_22_812, "radioshack-22-812", "RadioShack 22-812") | |
537 | DRV(tecpel_dmm_8061_ser, TECPEL_DMM_8061_SER, "tecpel-dmm-8061-ser", "Tecpel DMM-8061 (UT-D02 cable)") | |
538 | DRV(voltcraft_m3650d, VOLTCRAFT_M3650D, "voltcraft-m3650d", "Voltcraft M-3650D") | |
539 | DRV(voltcraft_vc820_ser, VOLTCRAFT_VC820_SER, "voltcraft-vc820-ser", "Voltcraft VC-820 (UT-D02 cable)") | |
540 | DRV(voltcraft_vc830_ser, VOLTCRAFT_VC830_SER, "voltcraft-vc830-ser", "Voltcraft VC-830 (UT-D02 cable)") | |
541 | DRV(voltcraft_vc840_ser, VOLTCRAFT_VC840_SER, "voltcraft-vc840-ser", "Voltcraft VC-840 (UT-D02 cable)") | |
542 | DRV(uni_t_ut60a_ser, UNI_T_UT60A_SER, "uni-t-ut60a-ser", "UNI-T UT60A (UT-D02 cable)") | |
543 | DRV(uni_t_ut60e_ser, UNI_T_UT60E_SER, "uni-t-ut60e-ser", "UNI-T UT60E (UT-D02 cable)") | |
544 | DRV(uni_t_ut61d_ser, UNI_T_UT61D_SER, "uni-t-ut61d-ser", "UNI-T UT61D (UT-D02 cable)") | |
545 | DRV(uni_t_ut61e_ser, UNI_T_UT61E_SER, "uni-t-ut61e-ser", "UNI-T UT61E (UT-D02 cable)") |