]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * This file is part of the libsigrok project. | |
3 | * | |
4 | * Copyright (C) 2015 Hannu Vuolasaho <vuokkosetae@gmail.com> | |
5 | * Copyright (C) 2018-2019 Frank Stettner <frank-stettner@gmx.net> | |
6 | * | |
7 | * This program is free software: you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation, either version 3 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | */ | |
20 | ||
21 | #include <config.h> | |
22 | ||
23 | #include <ctype.h> | |
24 | ||
25 | #include "protocol.h" | |
26 | ||
27 | static const uint32_t scanopts[] = { | |
28 | SR_CONF_CONN, | |
29 | SR_CONF_SERIALCOMM, | |
30 | SR_CONF_FORCE_DETECT, | |
31 | }; | |
32 | ||
33 | static const uint32_t drvopts[] = { | |
34 | SR_CONF_POWER_SUPPLY, | |
35 | }; | |
36 | ||
37 | static const uint32_t devopts[] = { | |
38 | SR_CONF_CONN | SR_CONF_GET, | |
39 | SR_CONF_CONTINUOUS, | |
40 | SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET, | |
41 | SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET, | |
42 | SR_CONF_VOLTAGE | SR_CONF_GET, | |
43 | SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, | |
44 | SR_CONF_CURRENT | SR_CONF_GET, | |
45 | SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, | |
46 | SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, | |
47 | SR_CONF_REGULATION | SR_CONF_GET, | |
48 | SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET, | |
49 | SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED | SR_CONF_GET | SR_CONF_SET, | |
50 | }; | |
51 | ||
52 | /* Voltage and current ranges. Values are: Min, max, step. */ | |
53 | static const double volts_30[] = { 0, 31, 0.01, }; | |
54 | static const double volts_60[] = { 0, 61, 0.01, }; | |
55 | static const double amps_3[] = { 0, 3.1, 0.001, }; | |
56 | static const double amps_5[] = { 0, 5.1, 0.001, }; | |
57 | ||
58 | static const struct korad_kaxxxxp_model models[] = { | |
59 | /* Vendor, model name, ID reply, channels, voltage, current, quirks. */ | |
60 | {"Korad", "KA3005P", "", 1, volts_30, amps_5, | |
61 | KORAD_QUIRK_ID_TRAILING}, | |
62 | {"Korad", "KD3005P", "", 1, volts_30, amps_5, 0}, | |
63 | {"Korad", "KD6005P", "", 1, volts_60, amps_5, 0}, | |
64 | {"RND", "KA3005P", "RND 320-KA3005P", 1, volts_30, amps_5, | |
65 | KORAD_QUIRK_ID_OPT_VERSION}, | |
66 | {"RND", "KD3005P", "RND 320-KD3005P", 1, volts_30, amps_5, | |
67 | KORAD_QUIRK_ID_OPT_VERSION}, | |
68 | {"Stamos Soldering", "S-LS-31", "", 1, volts_30, amps_5, | |
69 | KORAD_QUIRK_ID_NO_VENDOR}, | |
70 | {"Tenma", "72-2535", "", 1, volts_30, amps_3, 0}, | |
71 | {"Tenma", "72-2540", "", 1, volts_30, amps_5, 0}, | |
72 | {"Tenma", "72-2550", "", 1, volts_60, amps_3, 0}, | |
73 | {"Tenma", "72-2710", "", 1, volts_30, amps_5, 0}, | |
74 | {"Velleman", "LABPS3005D", "", 1, volts_30, amps_5, | |
75 | KORAD_QUIRK_LABPS_OVP_EN}, | |
76 | {"Velleman", "PS3005D", "", 1, volts_30, amps_5, 0}, | |
77 | ALL_ZERO | |
78 | }; | |
79 | ||
80 | /* | |
81 | * Bump this when adding new models[] above. Make sure the text buffer | |
82 | * for the ID response can hold the longest sequence that we expect in | |
83 | * the field which consists of: vendor + model [ + version ][ + serno ]. | |
84 | * Don't be too generous here, the maximum receive buffer size affects | |
85 | * the timeout within which the first response character is expected. | |
86 | */ | |
87 | static const size_t id_text_buffer_size = 48; | |
88 | ||
89 | /* | |
90 | * Check whether the device's "*IDN?" response matches a supported model. | |
91 | * The caller already stripped off the optional serial number. | |
92 | */ | |
93 | static gboolean model_matches(const struct korad_kaxxxxp_model *model, | |
94 | const char *id_text) | |
95 | { | |
96 | gboolean matches; | |
97 | gboolean opt_version, skip_vendor, accept_trail; | |
98 | const char *want; | |
99 | ||
100 | if (!model) | |
101 | return FALSE; | |
102 | ||
103 | /* | |
104 | * When the models[] entry contains a specific response text, | |
105 | * then expect to see this very text in literal form. This | |
106 | * lets the driver map weird and untypical responses to a | |
107 | * specific set of display texts for vendor and model names. | |
108 | * Accept an optionally trailing version if models[] says so. | |
109 | */ | |
110 | if (model->id && model->id[0]) { | |
111 | opt_version = model->quirks & KORAD_QUIRK_ID_OPT_VERSION; | |
112 | if (!opt_version) { | |
113 | matches = g_strcmp0(id_text, model->id) == 0; | |
114 | if (!matches) | |
115 | return FALSE; | |
116 | sr_dbg("Matches expected ID text: '%s'.", model->id); | |
117 | return TRUE; | |
118 | } | |
119 | matches = g_str_has_prefix(id_text, model->id); | |
120 | if (!matches) | |
121 | return FALSE; | |
122 | id_text += strlen(model->id); | |
123 | while (isspace((int)*id_text)) | |
124 | id_text++; | |
125 | if (*id_text == 'V') { | |
126 | id_text++; | |
127 | while (*id_text == '.' || isdigit((int)*id_text)) | |
128 | id_text++; | |
129 | while (isspace((int)*id_text)) | |
130 | id_text++; | |
131 | } | |
132 | if (*id_text) | |
133 | return FALSE; | |
134 | sr_dbg("Matches expected ID text [vers]: '%s'.", model->id); | |
135 | return TRUE; | |
136 | } | |
137 | ||
138 | /* | |
139 | * A more generic approach which covers most devices: Check | |
140 | * for the very vendor and model names which also are shown | |
141 | * to users (the display texts). Weakened to match responses | |
142 | * more widely: Case insensitive checks, optional whitespace | |
143 | * in responses, optional version details. Optional trailing | |
144 | * garbage. Optional omission of the vendor name. Shall match | |
145 | * all the devices which were individually listed in earlier | |
146 | * implementations of the driver, and shall also match firmware | |
147 | * versions that were not listed before. | |
148 | */ | |
149 | skip_vendor = model->quirks & KORAD_QUIRK_ID_NO_VENDOR; | |
150 | accept_trail = model->quirks & KORAD_QUIRK_ID_TRAILING; | |
151 | if (!skip_vendor) { | |
152 | want = model->vendor; | |
153 | matches = g_ascii_strncasecmp(id_text, want, strlen(want)) == 0; | |
154 | if (!matches) | |
155 | return FALSE; | |
156 | id_text += strlen(want); | |
157 | while (isspace((int)*id_text)) | |
158 | id_text++; | |
159 | } | |
160 | want = model->name; | |
161 | matches = g_ascii_strncasecmp(id_text, want, strlen(want)) == 0; | |
162 | if (!matches) | |
163 | return FALSE; | |
164 | id_text += strlen(want); | |
165 | while (isspace((int)*id_text)) | |
166 | id_text++; | |
167 | if (*id_text == 'V') { | |
168 | /* TODO Isolate and (also) return version details? */ | |
169 | id_text++; | |
170 | while (*id_text == '.' || isdigit((int)*id_text)) | |
171 | id_text++; | |
172 | while (isspace((int)*id_text)) | |
173 | id_text++; | |
174 | } | |
175 | if (accept_trail) { | |
176 | /* | |
177 | * TODO Determine how many non-printables to accept here | |
178 | * and how strict to check for "known" garbage variants. | |
179 | */ | |
180 | switch (*id_text) { | |
181 | case '\x01': | |
182 | case '\xbc': | |
183 | id_text++; | |
184 | break; | |
185 | case '\x00': | |
186 | /* EMPTY */ | |
187 | break; | |
188 | default: | |
189 | return FALSE; | |
190 | } | |
191 | } | |
192 | if (*id_text) | |
193 | return FALSE; | |
194 | sr_dbg("Matches generic '[vendor] model [vers] [trail]' pattern."); | |
195 | return TRUE; | |
196 | } | |
197 | ||
198 | /* Lookup a model from an ID response text. */ | |
199 | static const struct korad_kaxxxxp_model *model_lookup(const char *id_text) | |
200 | { | |
201 | size_t idx; | |
202 | const struct korad_kaxxxxp_model *check; | |
203 | ||
204 | if (!id_text || !*id_text) | |
205 | return NULL; | |
206 | sr_dbg("Looking up: [%s].", id_text); | |
207 | ||
208 | for (idx = 0; idx < ARRAY_SIZE(models); idx++) { | |
209 | check = &models[idx]; | |
210 | if (!check->name || !check->name[0]) | |
211 | continue; | |
212 | if (!model_matches(check, id_text)) | |
213 | continue; | |
214 | sr_dbg("Found: [%s] [%s]", check->vendor, check->name); | |
215 | return check; | |
216 | } | |
217 | sr_dbg("Not found"); | |
218 | ||
219 | return NULL; | |
220 | } | |
221 | ||
222 | static GSList *scan(struct sr_dev_driver *di, GSList *options) | |
223 | { | |
224 | static const char *serno_prefix = " SN:"; | |
225 | ||
226 | struct dev_context *devc; | |
227 | GSList *l; | |
228 | struct sr_dev_inst *sdi; | |
229 | struct sr_config *src; | |
230 | const char *conn, *serialcomm; | |
231 | const char *force_detect; | |
232 | struct sr_serial_dev_inst *serial; | |
233 | char reply[50]; | |
234 | int ret; | |
235 | const struct korad_kaxxxxp_model *model; | |
236 | size_t len; | |
237 | char *serno; | |
238 | ||
239 | conn = NULL; | |
240 | serialcomm = NULL; | |
241 | force_detect = NULL; | |
242 | ||
243 | for (l = options; l; l = l->next) { | |
244 | src = l->data; | |
245 | switch (src->key) { | |
246 | case SR_CONF_CONN: | |
247 | conn = g_variant_get_string(src->data, NULL); | |
248 | break; | |
249 | case SR_CONF_SERIALCOMM: | |
250 | serialcomm = g_variant_get_string(src->data, NULL); | |
251 | break; | |
252 | case SR_CONF_FORCE_DETECT: | |
253 | force_detect = g_variant_get_string(src->data, NULL); | |
254 | break; | |
255 | default: | |
256 | sr_err("Unknown option %d, skipping.", src->key); | |
257 | break; | |
258 | } | |
259 | } | |
260 | ||
261 | if (!conn) | |
262 | return NULL; | |
263 | if (!serialcomm) | |
264 | serialcomm = "9600/8n1"; | |
265 | if (force_detect && !*force_detect) | |
266 | force_detect = NULL; | |
267 | ||
268 | serial = sr_serial_dev_inst_new(conn, serialcomm); | |
269 | if (serial_open(serial, SERIAL_RDWR) != SR_OK) | |
270 | return NULL; | |
271 | ||
272 | /* Communicate the identification request. */ | |
273 | len = id_text_buffer_size; | |
274 | if (len > sizeof(reply) - 1) | |
275 | len = sizeof(reply) - 1; | |
276 | sr_dbg("Want max %zu bytes.", len); | |
277 | ||
278 | ret = korad_kaxxxxp_send_cmd(serial, "*IDN?"); | |
279 | if (ret < 0) | |
280 | return NULL; | |
281 | ||
282 | ret = korad_kaxxxxp_read_chars(serial, len, reply); | |
283 | if (ret < 0) | |
284 | return NULL; | |
285 | sr_dbg("Received: %d, %s", ret, reply); | |
286 | ||
287 | /* | |
288 | * Isolate the optional serial number at the response's end. | |
289 | * Lookup the response's model ID in the list of known models. | |
290 | */ | |
291 | serno = g_strrstr(reply, serno_prefix); | |
292 | if (serno) { | |
293 | *serno = '\0'; | |
294 | serno += strlen(serno_prefix); | |
295 | } | |
296 | ||
297 | model = model_lookup(reply); | |
298 | if (!model && force_detect) { | |
299 | sr_warn("Could not find model ID '%s', trying '%s'.", | |
300 | reply, force_detect); | |
301 | model = model_lookup(force_detect); | |
302 | if (model) | |
303 | sr_info("Found replacement, using it instead."); | |
304 | } | |
305 | if (!model) { | |
306 | sr_err("Unsupported model ID '%s', aborting.", reply); | |
307 | return NULL; | |
308 | } | |
309 | sr_dbg("Found: %s %s (idx %zu).", model->vendor, model->name, | |
310 | model - &models[0]); | |
311 | ||
312 | sdi = g_malloc0(sizeof(struct sr_dev_inst)); | |
313 | sdi->status = SR_ST_INACTIVE; | |
314 | sdi->vendor = g_strdup(model->vendor); | |
315 | sdi->model = g_strdup(model->name); | |
316 | if (serno) | |
317 | sdi->serial_num = g_strdup(serno); | |
318 | sdi->inst_type = SR_INST_SERIAL; | |
319 | sdi->conn = serial; | |
320 | sdi->connection_id = g_strdup(conn); | |
321 | ||
322 | sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "V"); | |
323 | sr_channel_new(sdi, 1, SR_CHANNEL_ANALOG, TRUE, "I"); | |
324 | ||
325 | devc = g_malloc0(sizeof(struct dev_context)); | |
326 | sr_sw_limits_init(&devc->limits); | |
327 | g_mutex_init(&devc->rw_mutex); | |
328 | devc->model = model; | |
329 | devc->req_sent_at = 0; | |
330 | devc->cc_mode_1_changed = FALSE; | |
331 | devc->cc_mode_2_changed = FALSE; | |
332 | devc->output_enabled_changed = FALSE; | |
333 | devc->ocp_enabled_changed = FALSE; | |
334 | devc->ovp_enabled_changed = FALSE; | |
335 | sdi->priv = devc; | |
336 | ||
337 | /* Get current status of device. */ | |
338 | if (korad_kaxxxxp_get_all_values(serial, devc) < 0) | |
339 | goto exit_err; | |
340 | ||
341 | serial_close(serial); | |
342 | ||
343 | return std_scan_complete(di, g_slist_append(NULL, sdi)); | |
344 | ||
345 | exit_err: | |
346 | sr_dev_inst_free(sdi); | |
347 | g_free(devc); | |
348 | sr_dbg("Scan failed."); | |
349 | ||
350 | return NULL; | |
351 | } | |
352 | ||
353 | static int config_get(uint32_t key, GVariant **data, | |
354 | const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) | |
355 | { | |
356 | struct dev_context *devc; | |
357 | ||
358 | (void)cg; | |
359 | ||
360 | if (!sdi || !data) | |
361 | return SR_ERR_ARG; | |
362 | ||
363 | devc = sdi->priv; | |
364 | ||
365 | switch (key) { | |
366 | case SR_CONF_LIMIT_SAMPLES: | |
367 | case SR_CONF_LIMIT_MSEC: | |
368 | return sr_sw_limits_config_get(&devc->limits, key, data); | |
369 | case SR_CONF_CONN: | |
370 | *data = g_variant_new_string(sdi->connection_id); | |
371 | break; | |
372 | case SR_CONF_VOLTAGE: | |
373 | korad_kaxxxxp_get_value(sdi->conn, KAXXXXP_VOLTAGE, devc); | |
374 | *data = g_variant_new_double(devc->voltage); | |
375 | break; | |
376 | case SR_CONF_VOLTAGE_TARGET: | |
377 | korad_kaxxxxp_get_value(sdi->conn, KAXXXXP_VOLTAGE_TARGET, devc); | |
378 | *data = g_variant_new_double(devc->voltage_target); | |
379 | break; | |
380 | case SR_CONF_CURRENT: | |
381 | korad_kaxxxxp_get_value(sdi->conn, KAXXXXP_CURRENT, devc); | |
382 | *data = g_variant_new_double(devc->current); | |
383 | break; | |
384 | case SR_CONF_CURRENT_LIMIT: | |
385 | korad_kaxxxxp_get_value(sdi->conn, KAXXXXP_CURRENT_LIMIT, devc); | |
386 | *data = g_variant_new_double(devc->current_limit); | |
387 | break; | |
388 | case SR_CONF_ENABLED: | |
389 | korad_kaxxxxp_get_value(sdi->conn, KAXXXXP_OUTPUT, devc); | |
390 | *data = g_variant_new_boolean(devc->output_enabled); | |
391 | break; | |
392 | case SR_CONF_REGULATION: | |
393 | /* Dual channel not supported. */ | |
394 | korad_kaxxxxp_get_value(sdi->conn, KAXXXXP_STATUS, devc); | |
395 | *data = g_variant_new_string((devc->cc_mode[0]) ? "CC" : "CV"); | |
396 | break; | |
397 | case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED: | |
398 | korad_kaxxxxp_get_value(sdi->conn, KAXXXXP_OCP, devc); | |
399 | *data = g_variant_new_boolean(devc->ocp_enabled); | |
400 | break; | |
401 | case SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED: | |
402 | korad_kaxxxxp_get_value(sdi->conn, KAXXXXP_OVP, devc); | |
403 | *data = g_variant_new_boolean(devc->ovp_enabled); | |
404 | break; | |
405 | default: | |
406 | return SR_ERR_NA; | |
407 | } | |
408 | ||
409 | return SR_OK; | |
410 | } | |
411 | ||
412 | static int config_set(uint32_t key, GVariant *data, | |
413 | const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) | |
414 | { | |
415 | struct dev_context *devc; | |
416 | double dval; | |
417 | gboolean bval; | |
418 | ||
419 | (void)cg; | |
420 | ||
421 | devc = sdi->priv; | |
422 | ||
423 | switch (key) { | |
424 | case SR_CONF_LIMIT_MSEC: | |
425 | case SR_CONF_LIMIT_SAMPLES: | |
426 | return sr_sw_limits_config_set(&devc->limits, key, data); | |
427 | case SR_CONF_VOLTAGE_TARGET: | |
428 | dval = g_variant_get_double(data); | |
429 | if (dval < devc->model->voltage[0] || dval > devc->model->voltage[1]) | |
430 | return SR_ERR_ARG; | |
431 | devc->set_voltage_target = dval; | |
432 | if (korad_kaxxxxp_set_value(sdi->conn, KAXXXXP_VOLTAGE_TARGET, devc) < 0) | |
433 | return SR_ERR; | |
434 | break; | |
435 | case SR_CONF_CURRENT_LIMIT: | |
436 | dval = g_variant_get_double(data); | |
437 | if (dval < devc->model->current[0] || dval > devc->model->current[1]) | |
438 | return SR_ERR_ARG; | |
439 | devc->set_current_limit = dval; | |
440 | if (korad_kaxxxxp_set_value(sdi->conn, KAXXXXP_CURRENT_LIMIT, devc) < 0) | |
441 | return SR_ERR; | |
442 | break; | |
443 | case SR_CONF_ENABLED: | |
444 | bval = g_variant_get_boolean(data); | |
445 | /* Set always so it is possible turn off with sigrok-cli. */ | |
446 | devc->set_output_enabled = bval; | |
447 | if (korad_kaxxxxp_set_value(sdi->conn, KAXXXXP_OUTPUT, devc) < 0) | |
448 | return SR_ERR; | |
449 | break; | |
450 | case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED: | |
451 | bval = g_variant_get_boolean(data); | |
452 | devc->set_ocp_enabled = bval; | |
453 | if (korad_kaxxxxp_set_value(sdi->conn, KAXXXXP_OCP, devc) < 0) | |
454 | return SR_ERR; | |
455 | break; | |
456 | case SR_CONF_OVER_VOLTAGE_PROTECTION_ENABLED: | |
457 | bval = g_variant_get_boolean(data); | |
458 | devc->set_ovp_enabled = bval; | |
459 | if (korad_kaxxxxp_set_value(sdi->conn, KAXXXXP_OVP, devc) < 0) | |
460 | return SR_ERR; | |
461 | break; | |
462 | default: | |
463 | return SR_ERR_NA; | |
464 | } | |
465 | ||
466 | return SR_OK; | |
467 | } | |
468 | ||
469 | static int config_list(uint32_t key, GVariant **data, | |
470 | const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) | |
471 | { | |
472 | struct dev_context *devc; | |
473 | ||
474 | devc = (sdi) ? sdi->priv : NULL; | |
475 | ||
476 | switch (key) { | |
477 | case SR_CONF_SCAN_OPTIONS: | |
478 | case SR_CONF_DEVICE_OPTIONS: | |
479 | return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts); | |
480 | case SR_CONF_VOLTAGE_TARGET: | |
481 | if (!devc || !devc->model) | |
482 | return SR_ERR_ARG; | |
483 | *data = std_gvar_min_max_step_array(devc->model->voltage); | |
484 | break; | |
485 | case SR_CONF_CURRENT_LIMIT: | |
486 | if (!devc || !devc->model) | |
487 | return SR_ERR_ARG; | |
488 | *data = std_gvar_min_max_step_array(devc->model->current); | |
489 | break; | |
490 | default: | |
491 | return SR_ERR_NA; | |
492 | } | |
493 | ||
494 | return SR_OK; | |
495 | } | |
496 | ||
497 | static int dev_close(struct sr_dev_inst *sdi) | |
498 | { | |
499 | struct dev_context *devc; | |
500 | ||
501 | devc = (sdi) ? sdi->priv : NULL; | |
502 | if (devc) | |
503 | g_mutex_clear(&devc->rw_mutex); | |
504 | ||
505 | return std_serial_dev_close(sdi); | |
506 | } | |
507 | ||
508 | static int dev_acquisition_start(const struct sr_dev_inst *sdi) | |
509 | { | |
510 | struct dev_context *devc; | |
511 | struct sr_serial_dev_inst *serial; | |
512 | ||
513 | devc = sdi->priv; | |
514 | ||
515 | sr_sw_limits_acquisition_start(&devc->limits); | |
516 | std_session_send_df_header(sdi); | |
517 | ||
518 | devc->req_sent_at = 0; | |
519 | serial = sdi->conn; | |
520 | serial_source_add(sdi->session, serial, G_IO_IN, | |
521 | KAXXXXP_POLL_INTERVAL_MS, | |
522 | korad_kaxxxxp_receive_data, (void *)sdi); | |
523 | ||
524 | return SR_OK; | |
525 | } | |
526 | ||
527 | static struct sr_dev_driver korad_kaxxxxp_driver_info = { | |
528 | .name = "korad-kaxxxxp", | |
529 | .longname = "Korad KAxxxxP", | |
530 | .api_version = 1, | |
531 | .init = std_init, | |
532 | .cleanup = std_cleanup, | |
533 | .scan = scan, | |
534 | .dev_list = std_dev_list, | |
535 | .dev_clear = std_dev_clear, | |
536 | .config_get = config_get, | |
537 | .config_set = config_set, | |
538 | .config_list = config_list, | |
539 | .dev_open = std_serial_dev_open, | |
540 | .dev_close = dev_close, | |
541 | .dev_acquisition_start = dev_acquisition_start, | |
542 | .dev_acquisition_stop = std_serial_dev_acquisition_stop, | |
543 | .context = NULL, | |
544 | }; | |
545 | SR_REGISTER_DEV_DRIVER(korad_kaxxxxp_driver_info); |