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