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