]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * This file is part of the libsigrok project. | |
3 | * | |
4 | * Copyright (C) 2011-2015 Uwe Hermann <uwe@hermann-uwe.de> | |
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 2 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, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
19 | */ | |
20 | ||
21 | #include <config.h> | |
22 | #include "protocol.h" | |
23 | ||
24 | static const uint32_t drvopts[] = { | |
25 | SR_CONF_LOGIC_ANALYZER, | |
26 | }; | |
27 | ||
28 | static const uint32_t scanopts[] = { | |
29 | SR_CONF_CONN, | |
30 | }; | |
31 | ||
32 | static const uint32_t devopts[] = { | |
33 | SR_CONF_LIMIT_MSEC | SR_CONF_SET, | |
34 | SR_CONF_LIMIT_SAMPLES | SR_CONF_SET | SR_CONF_LIST, | |
35 | SR_CONF_CONN | SR_CONF_GET, | |
36 | SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, | |
37 | SR_CONF_TRIGGER_MATCH | SR_CONF_LIST, | |
38 | }; | |
39 | ||
40 | static const int32_t trigger_matches[] = { | |
41 | SR_TRIGGER_ZERO, | |
42 | SR_TRIGGER_ONE, | |
43 | SR_TRIGGER_RISING, | |
44 | SR_TRIGGER_FALLING, | |
45 | }; | |
46 | ||
47 | static int dev_acquisition_stop(struct sr_dev_inst *sdi); | |
48 | ||
49 | static void clear_helper(void *priv) | |
50 | { | |
51 | struct dev_context *devc; | |
52 | ||
53 | devc = priv; | |
54 | ||
55 | ftdi_free(devc->ftdic); | |
56 | g_free(devc->final_buf); | |
57 | } | |
58 | ||
59 | static int dev_clear(const struct sr_dev_driver *di) | |
60 | { | |
61 | return std_dev_clear(di, clear_helper); | |
62 | } | |
63 | ||
64 | static int add_device(int model, struct libusb_device_descriptor *des, | |
65 | const char *serial_num, const char *connection_id, libusb_device *usbdev, | |
66 | GSList **devices) | |
67 | { | |
68 | int ret; | |
69 | unsigned int i; | |
70 | struct sr_dev_inst *sdi; | |
71 | struct dev_context *devc; | |
72 | ||
73 | ret = SR_OK; | |
74 | ||
75 | /* Allocate memory for our private device context. */ | |
76 | devc = g_malloc0(sizeof(struct dev_context)); | |
77 | ||
78 | /* Set some sane defaults. */ | |
79 | devc->prof = &cv_profiles[model]; | |
80 | devc->ftdic = NULL; /* Will be set in the open() API call. */ | |
81 | devc->cur_samplerate = 0; /* Set later (different for LA8/LA16). */ | |
82 | devc->limit_msec = 0; | |
83 | devc->limit_samples = 0; | |
84 | memset(devc->mangled_buf, 0, BS); | |
85 | devc->final_buf = NULL; | |
86 | devc->trigger_pattern = 0x0000; /* Irrelevant, see trigger_mask. */ | |
87 | devc->trigger_mask = 0x0000; /* All channels: "don't care". */ | |
88 | devc->trigger_edgemask = 0x0000; /* All channels: "state triggered". */ | |
89 | devc->trigger_found = 0; | |
90 | devc->done = 0; | |
91 | devc->block_counter = 0; | |
92 | devc->divcount = 0; | |
93 | devc->usb_vid = des->idVendor; | |
94 | devc->usb_pid = des->idProduct; | |
95 | memset(devc->samplerates, 0, sizeof(uint64_t) * 255); | |
96 | ||
97 | /* Allocate memory where we'll store the de-mangled data. */ | |
98 | if (!(devc->final_buf = g_try_malloc(SDRAM_SIZE))) { | |
99 | sr_err("Failed to allocate memory for sample buffer."); | |
100 | ret = SR_ERR_MALLOC; | |
101 | goto err_free_devc; | |
102 | } | |
103 | ||
104 | /* We now know the device, set its max. samplerate as default. */ | |
105 | devc->cur_samplerate = devc->prof->max_samplerate; | |
106 | ||
107 | /* Register the device with libsigrok. */ | |
108 | sdi = g_malloc0(sizeof(struct sr_dev_inst)); | |
109 | sdi->status = SR_ST_INACTIVE; | |
110 | sdi->vendor = g_strdup("ChronoVu"); | |
111 | sdi->model = g_strdup(devc->prof->modelname); | |
112 | sdi->serial_num = g_strdup(serial_num); | |
113 | sdi->connection_id = g_strdup(connection_id); | |
114 | sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(usbdev), | |
115 | libusb_get_device_address(usbdev), NULL); | |
116 | sdi->priv = devc; | |
117 | ||
118 | for (i = 0; i < devc->prof->num_channels; i++) | |
119 | sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, | |
120 | cv_channel_names[i]); | |
121 | ||
122 | *devices = g_slist_append(*devices, sdi); | |
123 | ||
124 | if (ret == SR_OK) | |
125 | return SR_OK; | |
126 | ||
127 | err_free_devc: | |
128 | g_free(devc); | |
129 | ||
130 | return ret; | |
131 | } | |
132 | ||
133 | static GSList *scan(struct sr_dev_driver *di, GSList *options) | |
134 | { | |
135 | int i, ret, model; | |
136 | struct drv_context *drvc; | |
137 | GSList *devices, *conn_devices, *l; | |
138 | struct sr_usb_dev_inst *usb; | |
139 | struct sr_config *src; | |
140 | struct libusb_device_descriptor des; | |
141 | libusb_device **devlist; | |
142 | struct libusb_device_handle *hdl; | |
143 | const char *conn; | |
144 | char product[64], serial_num[64], connection_id[64]; | |
145 | ||
146 | drvc = di->context; | |
147 | ||
148 | conn = NULL; | |
149 | for (l = options; l; l = l->next) { | |
150 | src = l->data; | |
151 | switch (src->key) { | |
152 | case SR_CONF_CONN: | |
153 | conn = g_variant_get_string(src->data, NULL); | |
154 | break; | |
155 | } | |
156 | } | |
157 | if (conn) | |
158 | conn_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, conn); | |
159 | else | |
160 | conn_devices = NULL; | |
161 | ||
162 | devices = NULL; | |
163 | libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist); | |
164 | ||
165 | for (i = 0; devlist[i]; i++) { | |
166 | if (conn) { | |
167 | for (l = conn_devices; l; l = l->next) { | |
168 | usb = l->data; | |
169 | if (usb->bus == libusb_get_bus_number(devlist[i]) | |
170 | && usb->address == libusb_get_device_address(devlist[i])) | |
171 | break; | |
172 | } | |
173 | if (!l) | |
174 | /* This device matched none of the ones that | |
175 | * matched the conn specification. */ | |
176 | continue; | |
177 | } | |
178 | ||
179 | libusb_get_device_descriptor(devlist[i], &des); | |
180 | ||
181 | if ((ret = libusb_open(devlist[i], &hdl)) < 0) | |
182 | continue; | |
183 | ||
184 | if (des.iProduct == 0) { | |
185 | product[0] = '\0'; | |
186 | } else if ((ret = libusb_get_string_descriptor_ascii(hdl, | |
187 | des.iProduct, (unsigned char *)product, | |
188 | sizeof(product))) < 0) { | |
189 | sr_warn("Failed to get product string descriptor: %s.", | |
190 | libusb_error_name(ret)); | |
191 | continue; | |
192 | } | |
193 | ||
194 | if (des.iSerialNumber == 0) { | |
195 | serial_num[0] = '\0'; | |
196 | } else if ((ret = libusb_get_string_descriptor_ascii(hdl, | |
197 | des.iSerialNumber, (unsigned char *)serial_num, | |
198 | sizeof(serial_num))) < 0) { | |
199 | sr_warn("Failed to get serial number string descriptor: %s.", | |
200 | libusb_error_name(ret)); | |
201 | continue; | |
202 | } | |
203 | ||
204 | usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); | |
205 | ||
206 | libusb_close(hdl); | |
207 | ||
208 | if (!strcmp(product, "ChronoVu LA8")) { | |
209 | model = 0; | |
210 | } else if (!strcmp(product, "ChronoVu LA16")) { | |
211 | model = 1; | |
212 | } else { | |
213 | sr_spew("Unknown iProduct string '%s'.", product); | |
214 | continue; | |
215 | } | |
216 | ||
217 | sr_dbg("Found %s (%04x:%04x, %d.%d, %s).", | |
218 | product, des.idVendor, des.idProduct, | |
219 | libusb_get_bus_number(devlist[i]), | |
220 | libusb_get_device_address(devlist[i]), connection_id); | |
221 | ||
222 | if ((ret = add_device(model, &des, serial_num, connection_id, | |
223 | devlist[i], &devices)) < 0) { | |
224 | sr_dbg("Failed to add device: %d.", ret); | |
225 | } | |
226 | } | |
227 | ||
228 | libusb_free_device_list(devlist, 1); | |
229 | g_slist_free_full(conn_devices, (GDestroyNotify)sr_usb_dev_inst_free); | |
230 | ||
231 | return std_scan_complete(di, devices); | |
232 | } | |
233 | ||
234 | static int dev_open(struct sr_dev_inst *sdi) | |
235 | { | |
236 | struct dev_context *devc; | |
237 | int ret; | |
238 | ||
239 | devc = sdi->priv; | |
240 | ||
241 | /* Allocate memory for the FTDI context and initialize it. */ | |
242 | if (!(devc->ftdic = ftdi_new())) { | |
243 | sr_err("Failed to initialize libftdi."); | |
244 | return SR_ERR; | |
245 | } | |
246 | ||
247 | sr_dbg("Opening %s device (%04x:%04x).", devc->prof->modelname, | |
248 | devc->usb_vid, devc->usb_pid); | |
249 | ||
250 | /* Open the device. */ | |
251 | if ((ret = ftdi_usb_open_desc(devc->ftdic, devc->usb_vid, | |
252 | devc->usb_pid, devc->prof->iproduct, NULL)) < 0) { | |
253 | sr_err("Failed to open FTDI device (%d): %s.", | |
254 | ret, ftdi_get_error_string(devc->ftdic)); | |
255 | goto err_ftdi_free; | |
256 | } | |
257 | sr_dbg("Device opened successfully."); | |
258 | ||
259 | /* Purge RX/TX buffers in the FTDI chip. */ | |
260 | if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) { | |
261 | sr_err("Failed to purge FTDI buffers (%d): %s.", | |
262 | ret, ftdi_get_error_string(devc->ftdic)); | |
263 | goto err_ftdi_free; | |
264 | } | |
265 | sr_dbg("FTDI buffers purged successfully."); | |
266 | ||
267 | /* Enable flow control in the FTDI chip. */ | |
268 | if ((ret = ftdi_setflowctrl(devc->ftdic, SIO_RTS_CTS_HS)) < 0) { | |
269 | sr_err("Failed to enable FTDI flow control (%d): %s.", | |
270 | ret, ftdi_get_error_string(devc->ftdic)); | |
271 | goto err_ftdi_free; | |
272 | } | |
273 | sr_dbg("FTDI flow control enabled successfully."); | |
274 | ||
275 | /* Wait 100ms. */ | |
276 | g_usleep(100 * 1000); | |
277 | ||
278 | sdi->status = SR_ST_ACTIVE; | |
279 | ||
280 | if (ret == SR_OK) | |
281 | return SR_OK; | |
282 | ||
283 | err_ftdi_free: | |
284 | ftdi_free(devc->ftdic); /* Close device (if open), free FTDI context. */ | |
285 | devc->ftdic = NULL; | |
286 | return ret; | |
287 | } | |
288 | ||
289 | static int dev_close(struct sr_dev_inst *sdi) | |
290 | { | |
291 | int ret; | |
292 | struct dev_context *devc; | |
293 | ||
294 | if (sdi->status != SR_ST_ACTIVE) | |
295 | return SR_OK; | |
296 | ||
297 | devc = sdi->priv; | |
298 | ||
299 | if (devc->ftdic && (ret = ftdi_usb_close(devc->ftdic)) < 0) | |
300 | sr_err("Failed to close FTDI device (%d): %s.", | |
301 | ret, ftdi_get_error_string(devc->ftdic)); | |
302 | sdi->status = SR_ST_INACTIVE; | |
303 | ||
304 | return SR_OK; | |
305 | } | |
306 | ||
307 | static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, | |
308 | const struct sr_channel_group *cg) | |
309 | { | |
310 | struct dev_context *devc; | |
311 | struct sr_usb_dev_inst *usb; | |
312 | char str[128]; | |
313 | ||
314 | (void)cg; | |
315 | ||
316 | switch (key) { | |
317 | case SR_CONF_CONN: | |
318 | if (!sdi || !(usb = sdi->conn)) | |
319 | return SR_ERR_ARG; | |
320 | snprintf(str, 128, "%d.%d", usb->bus, usb->address); | |
321 | *data = g_variant_new_string(str); | |
322 | break; | |
323 | case SR_CONF_SAMPLERATE: | |
324 | if (!sdi) | |
325 | return SR_ERR_BUG; | |
326 | devc = sdi->priv; | |
327 | *data = g_variant_new_uint64(devc->cur_samplerate); | |
328 | break; | |
329 | default: | |
330 | return SR_ERR_NA; | |
331 | } | |
332 | ||
333 | return SR_OK; | |
334 | } | |
335 | ||
336 | static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi, | |
337 | const struct sr_channel_group *cg) | |
338 | { | |
339 | struct dev_context *devc; | |
340 | ||
341 | (void)cg; | |
342 | ||
343 | if (sdi->status != SR_ST_ACTIVE) | |
344 | return SR_ERR_DEV_CLOSED; | |
345 | ||
346 | devc = sdi->priv; | |
347 | ||
348 | switch (key) { | |
349 | case SR_CONF_SAMPLERATE: | |
350 | if (cv_set_samplerate(sdi, g_variant_get_uint64(data)) < 0) | |
351 | return SR_ERR; | |
352 | break; | |
353 | case SR_CONF_LIMIT_MSEC: | |
354 | if (g_variant_get_uint64(data) == 0) | |
355 | return SR_ERR_ARG; | |
356 | devc->limit_msec = g_variant_get_uint64(data); | |
357 | break; | |
358 | case SR_CONF_LIMIT_SAMPLES: | |
359 | if (g_variant_get_uint64(data) == 0) | |
360 | return SR_ERR_ARG; | |
361 | devc->limit_samples = g_variant_get_uint64(data); | |
362 | break; | |
363 | default: | |
364 | return SR_ERR_NA; | |
365 | } | |
366 | ||
367 | return SR_OK; | |
368 | } | |
369 | ||
370 | static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, | |
371 | const struct sr_channel_group *cg) | |
372 | { | |
373 | GVariant *gvar, *grange[2]; | |
374 | GVariantBuilder gvb; | |
375 | struct dev_context *devc; | |
376 | ||
377 | (void)cg; | |
378 | ||
379 | switch (key) { | |
380 | case SR_CONF_SCAN_OPTIONS: | |
381 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, | |
382 | scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t)); | |
383 | break; | |
384 | case SR_CONF_DEVICE_OPTIONS: | |
385 | if (!sdi) | |
386 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, | |
387 | drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t)); | |
388 | else | |
389 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, | |
390 | devopts, ARRAY_SIZE(devopts), sizeof(uint32_t)); | |
391 | break; | |
392 | case SR_CONF_SAMPLERATE: | |
393 | if (!sdi) | |
394 | return SR_ERR_BUG; | |
395 | devc = sdi->priv; | |
396 | cv_fill_samplerates_if_needed(sdi); | |
397 | g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); | |
398 | gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"), | |
399 | devc->samplerates, | |
400 | ARRAY_SIZE(devc->samplerates), | |
401 | sizeof(uint64_t)); | |
402 | g_variant_builder_add(&gvb, "{sv}", "samplerates", gvar); | |
403 | *data = g_variant_builder_end(&gvb); | |
404 | break; | |
405 | case SR_CONF_LIMIT_SAMPLES: | |
406 | if (!sdi || !sdi->priv || !(devc = sdi->priv) || !devc->prof) | |
407 | return SR_ERR_BUG; | |
408 | grange[0] = g_variant_new_uint64(0); | |
409 | if (devc->prof->model == CHRONOVU_LA8) | |
410 | grange[1] = g_variant_new_uint64(MAX_NUM_SAMPLES); | |
411 | else | |
412 | grange[1] = g_variant_new_uint64(MAX_NUM_SAMPLES / 2); | |
413 | *data = g_variant_new_tuple(grange, 2); | |
414 | break; | |
415 | case SR_CONF_TRIGGER_MATCH: | |
416 | if (!sdi || !sdi->priv || !(devc = sdi->priv) || !devc->prof) | |
417 | return SR_ERR_BUG; | |
418 | *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, | |
419 | trigger_matches, devc->prof->num_trigger_matches, | |
420 | sizeof(int32_t)); | |
421 | break; | |
422 | default: | |
423 | return SR_ERR_NA; | |
424 | } | |
425 | ||
426 | return SR_OK; | |
427 | } | |
428 | ||
429 | static int receive_data(int fd, int revents, void *cb_data) | |
430 | { | |
431 | int i, ret; | |
432 | struct sr_dev_inst *sdi; | |
433 | struct dev_context *devc; | |
434 | ||
435 | (void)fd; | |
436 | (void)revents; | |
437 | ||
438 | if (!(sdi = cb_data)) { | |
439 | sr_err("cb_data was NULL."); | |
440 | return FALSE; | |
441 | } | |
442 | ||
443 | if (!(devc = sdi->priv)) { | |
444 | sr_err("sdi->priv was NULL."); | |
445 | return FALSE; | |
446 | } | |
447 | ||
448 | if (!devc->ftdic) { | |
449 | sr_err("devc->ftdic was NULL."); | |
450 | return FALSE; | |
451 | } | |
452 | ||
453 | /* Get one block of data. */ | |
454 | if ((ret = cv_read_block(devc)) < 0) { | |
455 | sr_err("Failed to read data block: %d.", ret); | |
456 | dev_acquisition_stop(sdi); | |
457 | return FALSE; | |
458 | } | |
459 | ||
460 | /* We need to get exactly NUM_BLOCKS blocks (i.e. 8MB) of data. */ | |
461 | if (devc->block_counter != (NUM_BLOCKS - 1)) { | |
462 | devc->block_counter++; | |
463 | return TRUE; | |
464 | } | |
465 | ||
466 | sr_dbg("Sampling finished, sending data to session bus now."); | |
467 | ||
468 | /* | |
469 | * All data was received and demangled, send it to the session bus. | |
470 | * | |
471 | * Note: Due to the method how data is spread across the 8MByte of | |
472 | * SDRAM, we can _not_ send it to the session bus in a streaming | |
473 | * manner while we receive it. We have to receive and de-mangle the | |
474 | * full 8MByte first, only then the whole buffer contains valid data. | |
475 | */ | |
476 | for (i = 0; i < NUM_BLOCKS; i++) | |
477 | cv_send_block_to_session_bus(sdi, i); | |
478 | ||
479 | dev_acquisition_stop(sdi); | |
480 | ||
481 | return TRUE; | |
482 | } | |
483 | ||
484 | static int dev_acquisition_start(const struct sr_dev_inst *sdi) | |
485 | { | |
486 | struct dev_context *devc; | |
487 | uint8_t buf[8]; | |
488 | int bytes_to_write, bytes_written; | |
489 | ||
490 | if (sdi->status != SR_ST_ACTIVE) | |
491 | return SR_ERR_DEV_CLOSED; | |
492 | ||
493 | devc = sdi->priv; | |
494 | ||
495 | if (!devc->ftdic) { | |
496 | sr_err("devc->ftdic was NULL."); | |
497 | return SR_ERR_BUG; | |
498 | } | |
499 | ||
500 | devc->divcount = cv_samplerate_to_divcount(sdi, devc->cur_samplerate); | |
501 | if (devc->divcount == 0xff) { | |
502 | sr_err("Invalid divcount/samplerate."); | |
503 | return SR_ERR; | |
504 | } | |
505 | ||
506 | if (cv_convert_trigger(sdi) != SR_OK) { | |
507 | sr_err("Failed to configure trigger."); | |
508 | return SR_ERR; | |
509 | } | |
510 | ||
511 | /* Fill acquisition parameters into buf[]. */ | |
512 | if (devc->prof->model == CHRONOVU_LA8) { | |
513 | buf[0] = devc->divcount; | |
514 | buf[1] = 0xff; /* This byte must always be 0xff. */ | |
515 | buf[2] = devc->trigger_pattern & 0xff; | |
516 | buf[3] = devc->trigger_mask & 0xff; | |
517 | bytes_to_write = 4; | |
518 | } else { | |
519 | buf[0] = devc->divcount; | |
520 | buf[1] = 0xff; /* This byte must always be 0xff. */ | |
521 | buf[2] = (devc->trigger_pattern & 0xff00) >> 8; /* LSB */ | |
522 | buf[3] = (devc->trigger_pattern & 0x00ff) >> 0; /* MSB */ | |
523 | buf[4] = (devc->trigger_mask & 0xff00) >> 8; /* LSB */ | |
524 | buf[5] = (devc->trigger_mask & 0x00ff) >> 0; /* MSB */ | |
525 | buf[6] = (devc->trigger_edgemask & 0xff00) >> 8; /* LSB */ | |
526 | buf[7] = (devc->trigger_edgemask & 0x00ff) >> 0; /* MSB */ | |
527 | bytes_to_write = 8; | |
528 | } | |
529 | ||
530 | /* Start acquisition. */ | |
531 | bytes_written = cv_write(devc, buf, bytes_to_write); | |
532 | ||
533 | if (bytes_written < 0 || bytes_written != bytes_to_write) { | |
534 | sr_err("Acquisition failed to start."); | |
535 | return SR_ERR; | |
536 | } | |
537 | ||
538 | sr_dbg("Hardware acquisition started successfully."); | |
539 | ||
540 | std_session_send_df_header(sdi, LOG_PREFIX); | |
541 | ||
542 | /* Time when we should be done (for detecting trigger timeouts). */ | |
543 | devc->done = (devc->divcount + 1) * devc->prof->trigger_constant + | |
544 | g_get_monotonic_time() + (10 * G_TIME_SPAN_SECOND); | |
545 | devc->block_counter = 0; | |
546 | devc->trigger_found = 0; | |
547 | ||
548 | /* Hook up a dummy handler to receive data from the device. */ | |
549 | sr_session_source_add(sdi->session, -1, 0, 0, receive_data, (void *)sdi); | |
550 | ||
551 | return SR_OK; | |
552 | } | |
553 | ||
554 | static int dev_acquisition_stop(struct sr_dev_inst *sdi) | |
555 | { | |
556 | sr_dbg("Stopping acquisition."); | |
557 | sr_session_source_remove(sdi->session, -1); | |
558 | std_session_send_df_end(sdi, LOG_PREFIX); | |
559 | ||
560 | return SR_OK; | |
561 | } | |
562 | ||
563 | static struct sr_dev_driver chronovu_la_driver_info = { | |
564 | .name = "chronovu-la", | |
565 | .longname = "ChronoVu LA8/LA16", | |
566 | .api_version = 1, | |
567 | .init = std_init, | |
568 | .cleanup = std_cleanup, | |
569 | .scan = scan, | |
570 | .dev_list = std_dev_list, | |
571 | .dev_clear = dev_clear, | |
572 | .config_get = config_get, | |
573 | .config_set = config_set, | |
574 | .config_list = config_list, | |
575 | .dev_open = dev_open, | |
576 | .dev_close = dev_close, | |
577 | .dev_acquisition_start = dev_acquisition_start, | |
578 | .dev_acquisition_stop = dev_acquisition_stop, | |
579 | .context = NULL, | |
580 | }; | |
581 | SR_REGISTER_DEV_DRIVER(chronovu_la_driver_info); |