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