]> sigrok.org Git - libsigrok.git/blame - src/hardware/scpi-pps/api.c
scpi-pps: Properly clean up acquisition session.
[libsigrok.git] / src / hardware / scpi-pps / api.c
CommitLineData
ca1a7cb5
BV
1/*
2 * This file is part of the libsigrok project.
3 *
4 * Copyright (C) 2014 Bert Vermeulen <bert@biot.com>
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 3 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, see <http://www.gnu.org/licenses/>.
18 */
19
9e45cd41 20#include <string.h>
ca1a7cb5
BV
21#include "protocol.h"
22
23SR_PRIV struct sr_dev_driver scpi_pps_driver_info;
24static struct sr_dev_driver *di = &scpi_pps_driver_info;
d4eabea8
BV
25extern unsigned int num_pps_profiles;
26extern const struct scpi_pps pps_profiles[];
9e45cd41 27
584560f1 28static const uint32_t scanopts[] = {
9e45cd41
BV
29 SR_CONF_CONN,
30 SR_CONF_SERIALCOMM,
31};
ca1a7cb5 32
01b0257a
BV
33static struct pps_channel_instance pci[] = {
34 { SR_MQ_VOLTAGE, SCPI_CMD_GET_MEAS_VOLTAGE, "V" },
35 { SR_MQ_CURRENT, SCPI_CMD_GET_MEAS_CURRENT, "I" },
36 { SR_MQ_POWER, SCPI_CMD_GET_MEAS_POWER, "P" },
37};
38
ca1a7cb5
BV
39static int init(struct sr_context *sr_ctx)
40{
41 return std_init(sr_ctx, di, LOG_PREFIX);
42}
43
9e45cd41 44static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
ca1a7cb5 45{
9e45cd41
BV
46 struct dev_context *devc;
47 struct sr_dev_inst *sdi;
48 struct sr_scpi_hw_info *hw_info;
49 struct sr_channel_group *cg;
50 struct sr_channel *ch;
51 const struct scpi_pps *device;
01b0257a 52 struct pps_channel *pch;
9e45cd41
BV
53 const struct channel_group_spec *cgs;
54 struct pps_channel_group *pcg;
58b77c41
BV
55 GRegex *model_re;
56 GMatchInfo *model_mi;
01b0257a 57 GSList *l;
9e45cd41 58 uint64_t mask;
331f5654 59 unsigned int ch_num, ch_idx, i, j;
22c18b03 60 const char *vendor;
01b0257a 61 char ch_name[16];
9e45cd41
BV
62
63 if (sr_scpi_get_hw_id(scpi, &hw_info) != SR_OK) {
64 sr_info("Couldn't get IDN response.");
65 return NULL;
66 }
67
68 device = NULL;
69 for (i = 0; i < num_pps_profiles; i++) {
22c18b03 70 vendor = get_vendor(hw_info->manufacturer);
58b77c41 71 if (strcasecmp(vendor, pps_profiles[i].vendor))
22c18b03 72 continue;
58b77c41
BV
73 model_re = g_regex_new(pps_profiles[i].model, 0, 0, NULL);
74 if (g_regex_match(model_re, hw_info->model, 0, &model_mi))
9e45cd41 75 device = &pps_profiles[i];
58b77c41
BV
76 g_match_info_unref(model_mi);
77 g_regex_unref(model_re);
78 if (device)
9e45cd41 79 break;
9e45cd41
BV
80 }
81 if (!device) {
82 sr_scpi_hw_info_free(hw_info);
83 return NULL;
84 }
85
aed4ad0b 86 sdi = sr_dev_inst_new(SR_ST_ACTIVE, vendor, hw_info->model,
58b77c41 87 hw_info->firmware_version);
9e45cd41
BV
88 sdi->conn = scpi;
89 sdi->driver = di;
90 sdi->inst_type = SR_INST_SCPI;
91 devc = g_malloc0(sizeof(struct dev_context));
92 devc->device = device;
93 sdi->priv = devc;
94
01b0257a
BV
95 ch_idx = 0;
96 for (ch_num = 0; ch_num < device->num_channels; ch_num++) {
97 /* Create one channel per measurable output unit. */
01b0257a
BV
98 for (i = 0; i < ARRAY_SIZE(pci); i++) {
99 if (!scpi_cmd_get(sdi, pci[i].command))
100 continue;
101 g_snprintf(ch_name, 16, "%s%s", pci[i].prefix,
102 device->channels[ch_num].name);
103 ch = sr_channel_new(ch_idx++, SR_CHANNEL_ANALOG, TRUE, ch_name);
104 pch = g_malloc0(sizeof(struct pps_channel));
105 pch->hw_output_idx = ch_num;
106 pch->hwname = device->channels[ch_num].name;
107 pch->mq = pci[i].mq;
108 ch->priv = pch;
109 sdi->channels = g_slist_append(sdi->channels, ch);
110 }
9e45cd41 111 }
ca1a7cb5 112
9e45cd41
BV
113 for (i = 0; i < device->num_channel_groups; i++) {
114 cgs = &device->channel_groups[i];
115 cg = g_malloc0(sizeof(struct sr_channel_group));
116 cg->name = g_strdup(cgs->name);
117 for (j = 0, mask = 1; j < 64; j++, mask <<= 1) {
118 if (cgs->channel_index_mask & mask) {
01b0257a
BV
119 for (l = sdi->channels; l; l = l->next) {
120 ch = l->data;
121 pch = ch->priv;
122 if (pch->hw_output_idx == j)
123 cg->channels = g_slist_append(cg->channels, ch);
124 }
9e45cd41
BV
125 }
126 }
127 pcg = g_malloc0(sizeof(struct pps_channel_group));
128 pcg->features = cgs->features;
129 cg->priv = pcg;
130 sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
131 }
ca1a7cb5 132
60475cd7 133 scpi_cmd(sdi, SCPI_CMD_LOCAL);
9e45cd41 134 sr_scpi_close(scpi);
ca1a7cb5 135
9e45cd41
BV
136 return sdi;
137}
ca1a7cb5 138
9e45cd41
BV
139static GSList *scan(GSList *options)
140{
141 return sr_scpi_scan(di->priv, options, probe_device);
ca1a7cb5
BV
142}
143
144static GSList *dev_list(void)
145{
146 return ((struct drv_context *)(di->priv))->instances;
147}
148
149static int dev_clear(void)
150{
151 return std_dev_clear(di, NULL);
152}
153
154static int dev_open(struct sr_dev_inst *sdi)
155{
9e45cd41
BV
156 struct sr_scpi_dev_inst *scpi;
157
158 if (sdi->status != SR_ST_ACTIVE)
159 return SR_ERR;
ca1a7cb5 160
9e45cd41
BV
161 scpi = sdi->conn;
162 if (sr_scpi_open(scpi) < 0)
163 return SR_ERR;
ca1a7cb5
BV
164
165 sdi->status = SR_ST_ACTIVE;
166
60475cd7
BV
167 scpi_cmd(sdi, SCPI_CMD_REMOTE);
168
ca1a7cb5
BV
169 return SR_OK;
170}
171
172static int dev_close(struct sr_dev_inst *sdi)
173{
9e45cd41 174 struct sr_scpi_dev_inst *scpi;
ca1a7cb5 175
9e45cd41
BV
176 if (sdi->status != SR_ST_ACTIVE)
177 return SR_ERR_DEV_CLOSED;
ca1a7cb5 178
9e45cd41
BV
179 scpi = sdi->conn;
180 if (scpi) {
60475cd7 181 scpi_cmd(sdi, SCPI_CMD_LOCAL);
9e45cd41
BV
182 sr_scpi_close(scpi);
183 sdi->status = SR_ST_INACTIVE;
184 }
ca1a7cb5
BV
185
186 return SR_OK;
187}
188
189static int cleanup(void)
190{
bf48cceb 191 return std_dev_clear(di, NULL);
ca1a7cb5
BV
192}
193
584560f1 194static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
ca1a7cb5
BV
195 const struct sr_channel_group *cg)
196{
9e45cd41 197 struct dev_context *devc;
478c8d92
BV
198 const GVariantType *gvtype;
199 unsigned int i;
200 int cmd, ret;
60475cd7 201 const char *s;
ca1a7cb5 202
9e45cd41
BV
203 if (!sdi)
204 return SR_ERR_ARG;
205
206 devc = sdi->priv;
ca1a7cb5 207
478c8d92 208 if (cg) {
9e45cd41
BV
209 /*
210 * These options only apply to channel groups with a single
211 * channel -- they're per-channel settings for the device.
212 */
478c8d92
BV
213
214 /*
215 * Config keys are handled below depending on whether a channel
216 * group was provided by the frontend. However some of these
217 * take a CG on one PPS but not on others. Check the device's
218 * profile for that here, and NULL out the channel group as needed.
219 */
220 for (i = 0; i < devc->device->num_devopts; i++) {
221 if (devc->device->devopts[i] == key) {
222 cg = NULL;
223 break;
224 }
225 }
478c8d92 226 }
9e45cd41 227
478c8d92
BV
228 gvtype = NULL;
229 cmd = -1;
230 switch (key) {
231 case SR_CONF_OUTPUT_ENABLED:
232 gvtype = G_VARIANT_TYPE_BOOLEAN;
233 cmd = SCPI_CMD_GET_OUTPUT_ENABLED;
234 break;
235 case SR_CONF_OUTPUT_VOLTAGE:
236 gvtype = G_VARIANT_TYPE_DOUBLE;
237 cmd = SCPI_CMD_GET_MEAS_VOLTAGE;
238 break;
ca95e90f 239 case SR_CONF_OUTPUT_VOLTAGE_TARGET:
478c8d92 240 gvtype = G_VARIANT_TYPE_DOUBLE;
ca95e90f 241 cmd = SCPI_CMD_GET_VOLTAGE_TARGET;
478c8d92
BV
242 break;
243 case SR_CONF_OUTPUT_CURRENT:
244 gvtype = G_VARIANT_TYPE_DOUBLE;
245 cmd = SCPI_CMD_GET_MEAS_CURRENT;
246 break;
ca95e90f 247 case SR_CONF_OUTPUT_CURRENT_LIMIT:
478c8d92 248 gvtype = G_VARIANT_TYPE_DOUBLE;
ca95e90f 249 cmd = SCPI_CMD_GET_CURRENT_LIMIT;
478c8d92
BV
250 break;
251 case SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED:
252 gvtype = G_VARIANT_TYPE_BOOLEAN;
253 cmd = SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ENABLED;
254 break;
255 case SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE:
256 gvtype = G_VARIANT_TYPE_BOOLEAN;
257 cmd = SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_ACTIVE;
258 break;
259 case SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD:
260 gvtype = G_VARIANT_TYPE_DOUBLE;
261 cmd = SCPI_CMD_GET_OVER_VOLTAGE_PROTECTION_THRESHOLD;
262 break;
263 case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED:
264 gvtype = G_VARIANT_TYPE_BOOLEAN;
265 cmd = SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ENABLED;
266 break;
267 case SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE:
268 gvtype = G_VARIANT_TYPE_BOOLEAN;
269 cmd = SCPI_CMD_GET_OVER_CURRENT_PROTECTION_ACTIVE;
270 break;
271 case SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD:
272 gvtype = G_VARIANT_TYPE_DOUBLE;
273 cmd = SCPI_CMD_GET_OVER_CURRENT_PROTECTION_THRESHOLD;
274 break;
275 case SR_CONF_OVER_TEMPERATURE_PROTECTION:
276 gvtype = G_VARIANT_TYPE_BOOLEAN;
277 cmd = SCPI_CMD_GET_OVER_TEMPERATURE_PROTECTION;
278 break;
60475cd7
BV
279 case SR_CONF_OUTPUT_REGULATION:
280 gvtype = G_VARIANT_TYPE_STRING;
281 cmd = SCPI_CMD_GET_OUTPUT_REGULATION;
478c8d92
BV
282 }
283 if (gvtype) {
284 if (cg)
60475cd7
BV
285 select_channel(sdi, cg->channels->data);
286 ret = scpi_cmd_resp(sdi, data, gvtype, cmd);
287
288 if (gvtype == G_VARIANT_TYPE_STRING && ret == SR_OK) {
289 /* Non-standard data type responses. */
290 switch (key) {
291 case SCPI_CMD_GET_OUTPUT_REGULATION:
292 /*
293 * This is specific to the Rigol DP800 series.
294 * We return the same string for now until more
295 * models with this key are supported. Do a check
296 * just for the hell of it.
297 */
298 s = g_variant_get_string(*data, NULL);
299 if (strcmp(s, "CC") && strcmp(s, "CV") && strcmp(s, "UR")) {
300 sr_dbg("Unknown response to SCPI_CMD_GET_OUTPUT_REGULATION: %s", s);
301 ret = SR_ERR_DATA;
9e45cd41 302 }
60475cd7 303 break;
9e45cd41 304 }
9e45cd41 305 }
478c8d92
BV
306 } else
307 ret = SR_ERR_NA;
ca1a7cb5
BV
308
309 return ret;
310}
311
584560f1 312static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
ca1a7cb5
BV
313 const struct sr_channel_group *cg)
314{
9e45cd41 315 double d;
ca1a7cb5 316 int ret;
ca1a7cb5 317
fdedbfcd
BV
318 if (!sdi)
319 return SR_ERR_ARG;
320
ca1a7cb5
BV
321 if (sdi->status != SR_ST_ACTIVE)
322 return SR_ERR_DEV_CLOSED;
323
60475cd7 324 if (cg)
9e45cd41 325 /* Channel group specified. */
60475cd7
BV
326 select_channel(sdi, cg->channels->data);
327
328 ret = SR_OK;
329 switch (key) {
330 case SR_CONF_OUTPUT_ENABLED:
331 if (g_variant_get_boolean(data))
332 ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_ENABLE);
333 else
334 ret = scpi_cmd(sdi, SCPI_CMD_SET_OUTPUT_DISABLE);
335 break;
336 case SR_CONF_OUTPUT_VOLTAGE_TARGET:
337 d = g_variant_get_double(data);
338 ret = scpi_cmd(sdi, SCPI_CMD_SET_VOLTAGE_TARGET, d);
339 break;
340 case SR_CONF_OUTPUT_CURRENT_LIMIT:
341 d = g_variant_get_double(data);
342 ret = scpi_cmd(sdi, SCPI_CMD_SET_CURRENT_LIMIT, d);
343 break;
344 case SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED:
345 if (g_variant_get_boolean(data))
346 ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_ENABLE);
347 else
348 ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_DISABLE);
349 break;
350 case SR_CONF_OVER_VOLTAGE_PROTECTION_THRESHOLD:
351 d = g_variant_get_double(data);
352 ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_VOLTAGE_PROTECTION_THRESHOLD, d);
353 break;
354 case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED:
355 if (g_variant_get_boolean(data))
356 ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_CURRENT_PROTECTION_ENABLE);
357 else
358 ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_CURRENT_PROTECTION_DISABLE);
359 break;
360 case SR_CONF_OVER_CURRENT_PROTECTION_THRESHOLD:
361 d = g_variant_get_double(data);
362 ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_CURRENT_PROTECTION_THRESHOLD, d);
363 break;
364 case SR_CONF_OVER_TEMPERATURE_PROTECTION:
365 if (g_variant_get_boolean(data))
366 ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_ENABLE);
367 else
368 ret = scpi_cmd(sdi, SCPI_CMD_SET_OVER_TEMPERATURE_PROTECTION_DISABLE);
369 break;
370 default:
371 ret = SR_ERR_NA;
ca1a7cb5
BV
372 }
373
374 return ret;
375}
376
584560f1 377static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
ca1a7cb5
BV
378 const struct sr_channel_group *cg)
379{
9e45cd41
BV
380 struct dev_context *devc;
381 struct sr_channel *ch;
382 struct channel_spec *ch_spec;
383 GVariant *gvar;
384 GVariantBuilder gvb;
385 int ret, i;
386 const char *s[16];
387
388 /* Always available, even without sdi. */
389 if (key == SR_CONF_SCAN_OPTIONS) {
584560f1
BV
390 *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
391 scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
9e45cd41
BV
392 return SR_OK;
393 }
ca1a7cb5 394
9e45cd41
BV
395 if (!sdi)
396 return SR_ERR_ARG;
397 devc = sdi->priv;
ca1a7cb5
BV
398
399 ret = SR_OK;
9e45cd41
BV
400 if (!cg) {
401 /* No channel group: global options. */
402 switch (key) {
403 case SR_CONF_DEVICE_OPTIONS:
584560f1 404 *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
9e45cd41 405 devc->device->devopts, devc->device->num_devopts,
584560f1 406 sizeof(uint32_t));
9e45cd41
BV
407 break;
408 case SR_CONF_OUTPUT_CHANNEL_CONFIG:
478c8d92 409 /* Not used. */
9e45cd41
BV
410 i = 0;
411 if (devc->device->features & PPS_INDEPENDENT)
412 s[i++] = "Independent";
413 if (devc->device->features & PPS_SERIES)
414 s[i++] = "Series";
415 if (devc->device->features & PPS_PARALLEL)
416 s[i++] = "Parallel";
417 if (i == 0) {
418 /*
419 * Shouldn't happen: independent-only devices
420 * shouldn't advertise this option at all.
421 */
422 return SR_ERR_NA;
423 }
424 *data = g_variant_new_strv(s, i);
425 break;
426 default:
427 return SR_ERR_NA;
428 }
429 } else {
430 /* Channel group specified. */
9e45cd41
BV
431 /*
432 * Per-channel-group options depending on a channel are actually
433 * done with the first channel. Channel groups in PPS can have
434 * more than one channel, but they will typically be of equal
01b0257a 435 * specification for use in series or parallel mode.
9e45cd41 436 */
9e45cd41
BV
437 ch = cg->channels->data;
438
439 switch (key) {
440 case SR_CONF_DEVICE_OPTIONS:
584560f1 441 *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
9e45cd41 442 devc->device->devopts_cg, devc->device->num_devopts_cg,
584560f1 443 sizeof(uint32_t));
9e45cd41 444 break;
ca95e90f 445 case SR_CONF_OUTPUT_VOLTAGE_TARGET:
9e45cd41
BV
446 ch_spec = &(devc->device->channels[ch->index]);
447 g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
448 /* Min, max, write resolution. */
449 for (i = 0; i < 3; i++) {
450 gvar = g_variant_new_double(ch_spec->voltage[i]);
451 g_variant_builder_add_value(&gvb, gvar);
452 }
453 *data = g_variant_builder_end(&gvb);
454 break;
ca95e90f 455 case SR_CONF_OUTPUT_CURRENT_LIMIT:
9e45cd41
BV
456 g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
457 /* Min, max, step. */
458 for (i = 0; i < 3; i++) {
459 ch_spec = &(devc->device->channels[ch->index]);
460 gvar = g_variant_new_double(ch_spec->current[i]);
461 g_variant_builder_add_value(&gvb, gvar);
462 }
463 *data = g_variant_builder_end(&gvb);
464 break;
465 default:
466 return SR_ERR_NA;
467 }
ca1a7cb5
BV
468 }
469
470 return ret;
471}
472
473static int dev_acquisition_start(const struct sr_dev_inst *sdi,
9e45cd41 474 void *cb_data)
ca1a7cb5 475{
9e45cd41
BV
476 struct dev_context *devc;
477 struct sr_scpi_dev_inst *scpi;
478 struct sr_channel *ch;
01b0257a
BV
479 struct pps_channel *pch;
480 int cmd, ret;
ca1a7cb5
BV
481
482 if (sdi->status != SR_ST_ACTIVE)
483 return SR_ERR_DEV_CLOSED;
484
9e45cd41
BV
485 devc = sdi->priv;
486 scpi = sdi->conn;
487 devc->cb_data = cb_data;
488
01b0257a 489 if ((ret = sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 10,
9e45cd41
BV
490 scpi_pps_receive_data, (void *)sdi)) != SR_OK)
491 return ret;
492 std_session_send_df_header(sdi, LOG_PREFIX);
493
01b0257a 494 /* Prime the pipe with the first channel's fetch. */
9e45cd41 495 ch = sdi->channels->data;
01b0257a 496 pch = ch->priv;
60475cd7 497 select_channel(sdi, ch);
01b0257a
BV
498 if (pch->mq == SR_MQ_VOLTAGE)
499 cmd = SCPI_CMD_GET_MEAS_VOLTAGE;
500 else if (pch->mq == SR_MQ_CURRENT)
501 cmd = SCPI_CMD_GET_MEAS_CURRENT;
502 else if (pch->mq == SR_MQ_POWER)
503 cmd = SCPI_CMD_GET_MEAS_POWER;
504 else
505 return SR_ERR;
506 scpi_cmd(sdi, cmd, pch->hwname);
ca1a7cb5
BV
507
508 return SR_OK;
509}
510
511static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
512{
bf48cceb 513 struct sr_datafeed_packet packet;
9e45cd41
BV
514 struct sr_scpi_dev_inst *scpi;
515 float f;
516
ca1a7cb5
BV
517 (void)cb_data;
518
519 if (sdi->status != SR_ST_ACTIVE)
520 return SR_ERR_DEV_CLOSED;
521
9e45cd41
BV
522 scpi = sdi->conn;
523
524 /*
525 * A requested value is certainly on the way. Retrieve it now,
526 * to avoid leaving the device in a state where it's not expecting
527 * commands.
528 */
529 sr_scpi_get_float(scpi, NULL, &f);
530 sr_scpi_source_remove(sdi->session, scpi);
531
bf48cceb
BV
532 packet.type = SR_DF_END;
533 sr_session_send(sdi, &packet);
534
ca1a7cb5
BV
535 return SR_OK;
536}
537
538SR_PRIV struct sr_dev_driver scpi_pps_driver_info = {
539 .name = "scpi-pps",
540 .longname = "SCPI PPS",
541 .api_version = 1,
542 .init = init,
543 .cleanup = cleanup,
544 .scan = scan,
545 .dev_list = dev_list,
546 .dev_clear = dev_clear,
547 .config_get = config_get,
548 .config_set = config_set,
549 .config_list = config_list,
550 .dev_open = dev_open,
551 .dev_close = dev_close,
552 .dev_acquisition_start = dev_acquisition_start,
553 .dev_acquisition_stop = dev_acquisition_stop,
554 .priv = NULL,
555};