2 * This file is part of the libsigrok project.
4 * Copyright (C) 2013 poljar (Damir Jelić) <poljarinho@gmail.com>
5 * Copyright (C) 2018 Guido Trentalancia <guido@trentalancia.com>
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.
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.
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/>.
26 static struct sr_dev_driver hameg_hmo_driver_info;
28 static const char *manufacturers[] = {
33 static const uint32_t scanopts[] = {
38 static const uint32_t drvopts[] = {
40 SR_CONF_LOGIC_ANALYZER,
50 static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
52 struct sr_dev_inst *sdi;
53 struct dev_context *devc;
54 struct sr_scpi_hw_info *hw_info;
60 if (sr_scpi_get_hw_id(scpi, &hw_info) != SR_OK) {
61 sr_info("Couldn't get IDN response.");
65 if (std_str_idx_s(hw_info->manufacturer, ARRAY_AND_SIZE(manufacturers)) < 0)
68 sdi = g_malloc0(sizeof(struct sr_dev_inst));
69 sdi->vendor = g_strdup(hw_info->manufacturer);
70 sdi->model = g_strdup(hw_info->model);
71 sdi->version = g_strdup(hw_info->firmware_version);
72 sdi->serial_num = g_strdup(hw_info->serial_number);
73 sdi->driver = &hameg_hmo_driver_info;
74 sdi->inst_type = SR_INST_SCPI;
77 sr_scpi_hw_info_free(hw_info);
80 devc = g_malloc0(sizeof(struct dev_context));
84 if (hmo_init_device(sdi) != SR_OK)
90 sr_scpi_hw_info_free(hw_info);
91 sr_dev_inst_free(sdi);
97 static GSList *scan(struct sr_dev_driver *di, GSList *options)
99 return sr_scpi_scan(di->context, options, probe_device);
102 static void clear_helper(struct dev_context *devc)
104 hmo_scope_state_free(devc->model_state);
105 g_free(devc->analog_groups);
106 g_free(devc->digital_groups);
109 static int dev_clear(const struct sr_dev_driver *di)
111 return std_dev_clear_with_callback(di, (std_dev_clear_callback)clear_helper);
114 static int dev_open(struct sr_dev_inst *sdi)
116 if (sr_scpi_open(sdi->conn) != SR_OK)
119 if (hmo_scope_state_get(sdi) != SR_OK)
125 static int dev_close(struct sr_dev_inst *sdi)
127 return sr_scpi_close(sdi->conn);
130 static int check_channel_group(struct dev_context *devc,
131 const struct sr_channel_group *cg)
133 const struct scope_config *model;
135 model = devc->model_config;
140 if (std_cg_idx(cg, devc->analog_groups, model->analog_channels) >= 0)
143 if (std_cg_idx(cg, devc->digital_groups, model->digital_pods) >= 0)
146 sr_err("Invalid channel group specified.");
151 static int config_get(uint32_t key, GVariant **data,
152 const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
155 struct dev_context *devc;
156 const struct scope_config *model;
157 struct scope_state *state;
164 if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID)
167 model = devc->model_config;
168 state = devc->model_state;
171 case SR_CONF_NUM_HDIV:
172 *data = g_variant_new_int32(model->num_xdivs);
174 case SR_CONF_TIMEBASE:
175 *data = g_variant_new("(tt)", (*model->timebases)[state->timebase][0],
176 (*model->timebases)[state->timebase][1]);
178 case SR_CONF_NUM_VDIV:
180 return SR_ERR_CHANNEL_GROUP;
181 if (cg_type != CG_ANALOG)
183 if (std_cg_idx(cg, devc->analog_groups, model->analog_channels) < 0)
185 *data = g_variant_new_int32(model->num_ydivs);
189 return SR_ERR_CHANNEL_GROUP;
190 if (cg_type != CG_ANALOG)
192 if ((idx = std_cg_idx(cg, devc->analog_groups, model->analog_channels)) < 0)
194 *data = g_variant_new("(tt)",
195 (*model->vdivs)[state->analog_channels[idx].vdiv][0],
196 (*model->vdivs)[state->analog_channels[idx].vdiv][1]);
198 case SR_CONF_TRIGGER_SOURCE:
199 *data = g_variant_new_string((*model->trigger_sources)[state->trigger_source]);
201 case SR_CONF_TRIGGER_SLOPE:
202 *data = g_variant_new_string((*model->trigger_slopes)[state->trigger_slope]);
204 case SR_CONF_TRIGGER_PATTERN:
205 *data = g_variant_new_string(state->trigger_pattern);
207 case SR_CONF_HORIZ_TRIGGERPOS:
208 *data = g_variant_new_double(state->horiz_triggerpos);
210 case SR_CONF_COUPLING:
212 return SR_ERR_CHANNEL_GROUP;
213 if (cg_type != CG_ANALOG)
215 if ((idx = std_cg_idx(cg, devc->analog_groups, model->analog_channels)) < 0)
217 *data = g_variant_new_string((*model->coupling_options)[state->analog_channels[idx].coupling]);
219 case SR_CONF_SAMPLERATE:
220 *data = g_variant_new_uint64(state->sample_rate);
222 case SR_CONF_LOGIC_THRESHOLD:
224 return SR_ERR_CHANNEL_GROUP;
225 if (cg_type != CG_DIGITAL)
229 if ((idx = std_cg_idx(cg, devc->digital_groups, model->digital_pods)) < 0)
231 *data = g_variant_new_string((*model->logic_threshold)[state->digital_pods[idx].threshold]);
233 case SR_CONF_LOGIC_THRESHOLD_CUSTOM:
235 return SR_ERR_CHANNEL_GROUP;
236 if (cg_type != CG_DIGITAL)
240 if ((idx = std_cg_idx(cg, devc->digital_groups, model->digital_pods)) < 0)
242 /* Check if the oscilloscope is currently in custom threshold mode. */
243 for (i = 0; i < model->num_logic_threshold; i++) {
244 if (!strcmp("USER2", (*model->logic_threshold)[i]))
245 if (strcmp("USER2", (*model->logic_threshold)[state->digital_pods[idx].threshold]))
247 if (!strcmp("USER", (*model->logic_threshold)[i]))
248 if (strcmp("USER", (*model->logic_threshold)[state->digital_pods[idx].threshold]))
250 if (!strcmp("MAN", (*model->logic_threshold)[i]))
251 if (strcmp("MAN", (*model->logic_threshold)[state->digital_pods[idx].threshold]))
254 *data = g_variant_new_double(state->digital_pods[idx].user_threshold);
263 static int config_set(uint32_t key, GVariant *data,
264 const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
266 int ret, cg_type, idx, i, j;
267 char command[MAX_COMMAND_SIZE], command2[MAX_COMMAND_SIZE];
268 char float_str[30], *tmp_str;
269 struct dev_context *devc;
270 const struct scope_config *model;
271 struct scope_state *state;
272 double tmp_d, tmp_d2;
273 gboolean update_sample_rate;
280 if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID)
283 model = devc->model_config;
284 state = devc->model_state;
285 update_sample_rate = FALSE;
288 case SR_CONF_LIMIT_SAMPLES:
289 devc->samples_limit = g_variant_get_uint64(data);
292 case SR_CONF_LIMIT_FRAMES:
293 devc->frame_limit = g_variant_get_uint64(data);
296 case SR_CONF_TRIGGER_SOURCE:
297 if ((idx = std_str_idx(data, *model->trigger_sources, model->num_trigger_sources)) < 0)
299 g_snprintf(command, sizeof(command),
300 (*model->scpi_dialect)[SCPI_CMD_SET_TRIGGER_SOURCE],
301 (*model->trigger_sources)[idx]);
302 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
303 sr_scpi_get_opc(sdi->conn) != SR_OK)
305 state->trigger_source = idx;
310 return SR_ERR_CHANNEL_GROUP;
311 if ((idx = std_u64_tuple_idx(data, *model->vdivs, model->num_vdivs)) < 0)
313 if ((j = std_cg_idx(cg, devc->analog_groups, model->analog_channels)) < 0)
315 g_ascii_formatd(float_str, sizeof(float_str), "%E",
316 (float) (*model->vdivs)[idx][0] / (*model->vdivs)[idx][1]);
317 g_snprintf(command, sizeof(command),
318 (*model->scpi_dialect)[SCPI_CMD_SET_VERTICAL_SCALE],
320 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
321 sr_scpi_get_opc(sdi->conn) != SR_OK)
323 state->analog_channels[j].vdiv = idx;
326 case SR_CONF_TIMEBASE:
327 if ((idx = std_u64_tuple_idx(data, *model->timebases, model->num_timebases)) < 0)
329 g_ascii_formatd(float_str, sizeof(float_str), "%E",
330 (float) (*model->timebases)[idx][0] / (*model->timebases)[idx][1]);
331 g_snprintf(command, sizeof(command),
332 (*model->scpi_dialect)[SCPI_CMD_SET_TIMEBASE],
334 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
335 sr_scpi_get_opc(sdi->conn) != SR_OK)
337 state->timebase = idx;
339 update_sample_rate = TRUE;
341 case SR_CONF_HORIZ_TRIGGERPOS:
342 tmp_d = g_variant_get_double(data);
343 if (tmp_d < 0.0 || tmp_d > 1.0)
345 tmp_d2 = -(tmp_d - 0.5) *
346 ((double) (*model->timebases)[state->timebase][0] /
347 (*model->timebases)[state->timebase][1])
349 g_ascii_formatd(float_str, sizeof(float_str), "%E", tmp_d2);
350 g_snprintf(command, sizeof(command),
351 (*model->scpi_dialect)[SCPI_CMD_SET_HORIZ_TRIGGERPOS],
353 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
354 sr_scpi_get_opc(sdi->conn) != SR_OK)
356 state->horiz_triggerpos = tmp_d;
359 case SR_CONF_TRIGGER_SLOPE:
360 if ((idx = std_str_idx(data, *model->trigger_slopes, model->num_trigger_slopes)) < 0)
362 g_snprintf(command, sizeof(command),
363 (*model->scpi_dialect)[SCPI_CMD_SET_TRIGGER_SLOPE],
364 (*model->trigger_slopes)[idx]);
365 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
366 sr_scpi_get_opc(sdi->conn) != SR_OK)
368 state->trigger_slope = idx;
371 case SR_CONF_TRIGGER_PATTERN:
372 tmp_str = (char *)g_variant_get_string(data, 0);
373 idx = strlen(tmp_str);
374 if (idx == 0 || idx > model->analog_channels + model->digital_channels)
376 g_snprintf(command, sizeof(command),
377 (*model->scpi_dialect)[SCPI_CMD_SET_TRIGGER_PATTERN],
379 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
380 sr_scpi_get_opc(sdi->conn) != SR_OK)
382 strncpy(state->trigger_pattern,
384 MAX_ANALOG_CHANNEL_COUNT + MAX_DIGITAL_CHANNEL_COUNT);
387 case SR_CONF_COUPLING:
389 return SR_ERR_CHANNEL_GROUP;
390 if ((idx = std_str_idx(data, *model->coupling_options, model->num_coupling_options)) < 0)
392 if ((j = std_cg_idx(cg, devc->analog_groups, model->analog_channels)) < 0)
394 g_snprintf(command, sizeof(command),
395 (*model->scpi_dialect)[SCPI_CMD_SET_COUPLING],
396 j + 1, (*model->coupling_options)[idx]);
397 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
398 sr_scpi_get_opc(sdi->conn) != SR_OK)
400 state->analog_channels[j].coupling = idx;
403 case SR_CONF_LOGIC_THRESHOLD:
405 return SR_ERR_CHANNEL_GROUP;
406 if (cg_type != CG_DIGITAL)
410 if ((idx = std_str_idx(data, *model->logic_threshold, model->num_logic_threshold)) < 0)
412 if ((j = std_cg_idx(cg, devc->digital_groups, model->digital_pods)) < 0)
414 /* Check if the threshold command is based on the POD or digital channel index. */
415 if (model->logic_threshold_for_pod)
419 g_snprintf(command, sizeof(command),
420 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_POD_THRESHOLD],
421 i, (*model->logic_threshold)[idx]);
422 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
423 sr_scpi_get_opc(sdi->conn) != SR_OK)
425 state->digital_pods[j].threshold = idx;
428 case SR_CONF_LOGIC_THRESHOLD_CUSTOM:
430 return SR_ERR_CHANNEL_GROUP;
431 if (cg_type != CG_DIGITAL)
435 if ((j = std_cg_idx(cg, devc->digital_groups, model->digital_pods)) < 0)
437 tmp_d = g_variant_get_double(data);
438 if (tmp_d < -2.0 || tmp_d > 8.0)
440 g_ascii_formatd(float_str, sizeof(float_str), "%E", tmp_d);
441 /* Check if the threshold command is based on the POD or digital channel index. */
442 if (model->logic_threshold_for_pod)
446 /* Try to support different dialects exhaustively. */
447 for (i = 0; i < model->num_logic_threshold; i++) {
448 if (!strcmp("USER2", (*model->logic_threshold)[i])) {
449 g_snprintf(command, sizeof(command),
450 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_POD_USER_THRESHOLD],
451 idx, 2, float_str); /* USER2 */
452 g_snprintf(command2, sizeof(command2),
453 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_POD_THRESHOLD],
457 if (!strcmp("USER", (*model->logic_threshold)[i])) {
458 g_snprintf(command, sizeof(command),
459 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_POD_USER_THRESHOLD],
461 g_snprintf(command2, sizeof(command2),
462 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_POD_THRESHOLD],
466 if (!strcmp("MAN", (*model->logic_threshold)[i])) {
467 g_snprintf(command, sizeof(command),
468 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_POD_USER_THRESHOLD],
470 g_snprintf(command2, sizeof(command2),
471 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_POD_THRESHOLD],
476 if (sr_scpi_send(sdi->conn, command) != SR_OK ||
477 sr_scpi_get_opc(sdi->conn) != SR_OK)
479 if (sr_scpi_send(sdi->conn, command2) != SR_OK ||
480 sr_scpi_get_opc(sdi->conn) != SR_OK)
482 state->digital_pods[j].user_threshold = tmp_d;
490 if (ret == SR_OK && update_sample_rate)
491 ret = hmo_update_sample_rate(sdi);
496 static int config_list(uint32_t key, GVariant **data,
497 const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
499 int cg_type = CG_NONE;
500 struct dev_context *devc = NULL;
501 const struct scope_config *model = NULL;
505 if ((cg_type = check_channel_group(devc, cg)) == CG_INVALID)
508 model = devc->model_config;
512 case SR_CONF_SCAN_OPTIONS:
513 *data = std_gvar_array_u32(ARRAY_AND_SIZE(scanopts));
515 case SR_CONF_DEVICE_OPTIONS:
518 *data = std_gvar_array_u32(*model->devopts, model->num_devopts);
520 *data = std_gvar_array_u32(ARRAY_AND_SIZE(drvopts));
521 } else if (cg_type == CG_ANALOG) {
522 *data = std_gvar_array_u32(*model->devopts_cg_analog, model->num_devopts_cg_analog);
523 } else if (cg_type == CG_DIGITAL) {
524 *data = std_gvar_array_u32(*model->devopts_cg_digital, model->num_devopts_cg_digital);
526 *data = std_gvar_array_u32(NULL, 0);
529 case SR_CONF_COUPLING:
531 return SR_ERR_CHANNEL_GROUP;
534 *data = g_variant_new_strv(*model->coupling_options, model->num_coupling_options);
536 case SR_CONF_TRIGGER_SOURCE:
539 *data = g_variant_new_strv(*model->trigger_sources, model->num_trigger_sources);
541 case SR_CONF_TRIGGER_SLOPE:
544 *data = g_variant_new_strv(*model->trigger_slopes, model->num_trigger_slopes);
546 case SR_CONF_TIMEBASE:
549 *data = std_gvar_tuple_array(*model->timebases, model->num_timebases);
553 return SR_ERR_CHANNEL_GROUP;
556 *data = std_gvar_tuple_array(*model->vdivs, model->num_vdivs);
558 case SR_CONF_LOGIC_THRESHOLD:
560 return SR_ERR_CHANNEL_GROUP;
563 *data = g_variant_new_strv(*model->logic_threshold, model->num_logic_threshold);
572 SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi)
574 char command[MAX_COMMAND_SIZE];
575 struct sr_channel *ch;
576 struct dev_context *devc;
577 const struct scope_config *model;
580 model = devc->model_config;
582 ch = devc->current_channel->data;
585 case SR_CHANNEL_ANALOG:
586 g_snprintf(command, sizeof(command),
587 (*model->scpi_dialect)[SCPI_CMD_GET_ANALOG_DATA],
588 #ifdef WORDS_BIGENDIAN
595 case SR_CHANNEL_LOGIC:
596 g_snprintf(command, sizeof(command),
597 (*model->scpi_dialect)[SCPI_CMD_GET_DIG_DATA],
598 ch->index < 8 ? 1 : 2);
601 sr_err("Invalid channel type.");
605 return sr_scpi_send(sdi->conn, command);
608 static int hmo_check_channels(GSList *channels)
611 struct sr_channel *ch;
612 gboolean enabled_chan[MAX_ANALOG_CHANNEL_COUNT];
613 gboolean enabled_pod[MAX_DIGITAL_GROUP_COUNT];
616 /* Preset "not enabled" for all channels / pods. */
617 for (idx = 0; idx < ARRAY_SIZE(enabled_chan); idx++)
618 enabled_chan[idx] = FALSE;
619 for (idx = 0; idx < ARRAY_SIZE(enabled_pod); idx++)
620 enabled_pod[idx] = FALSE;
623 * Determine which channels / pods are required for the caller's
624 * specified configuration.
626 for (l = channels; l; l = l->next) {
629 case SR_CHANNEL_ANALOG:
631 if (idx < ARRAY_SIZE(enabled_chan))
632 enabled_chan[idx] = TRUE;
634 case SR_CHANNEL_LOGIC:
636 if (idx < ARRAY_SIZE(enabled_pod))
637 enabled_pod[idx] = TRUE;
645 * Check for resource conflicts. Some channels can be either
646 * analog or digital, but never both at the same time.
648 * Note that the constraints might depend on the specific model.
649 * These tests might need some adjustment when support for more
650 * models gets added to the driver.
652 if (enabled_pod[0] && enabled_chan[2])
654 if (enabled_pod[1] && enabled_chan[3])
659 static int hmo_setup_channels(const struct sr_dev_inst *sdi)
663 gboolean *pod_enabled, setup_changed;
664 char command[MAX_COMMAND_SIZE];
665 struct scope_state *state;
666 const struct scope_config *model;
667 struct sr_channel *ch;
668 struct dev_context *devc;
669 struct sr_scpi_dev_inst *scpi;
674 state = devc->model_state;
675 model = devc->model_config;
676 setup_changed = FALSE;
678 pod_enabled = g_try_malloc0(sizeof(gboolean) * model->digital_pods);
680 for (l = sdi->channels; l; l = l->next) {
683 case SR_CHANNEL_ANALOG:
684 if (ch->enabled == state->analog_channels[ch->index].state)
686 g_snprintf(command, sizeof(command),
687 (*model->scpi_dialect)[SCPI_CMD_SET_ANALOG_CHAN_STATE],
688 ch->index + 1, ch->enabled);
690 if (sr_scpi_send(scpi, command) != SR_OK) {
694 state->analog_channels[ch->index].state = ch->enabled;
695 setup_changed = TRUE;
697 case SR_CHANNEL_LOGIC:
699 * A digital POD needs to be enabled for every group of
703 pod_enabled[ch->index < 8 ? 0 : 1] = TRUE;
705 if (ch->enabled == state->digital_channels[ch->index])
707 g_snprintf(command, sizeof(command),
708 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_CHAN_STATE],
709 ch->index, ch->enabled);
711 if (sr_scpi_send(scpi, command) != SR_OK) {
716 state->digital_channels[ch->index] = ch->enabled;
717 setup_changed = TRUE;
726 for (i = 0; i < model->digital_pods; i++) {
727 if (state->digital_pods[i].state == pod_enabled[i])
729 g_snprintf(command, sizeof(command),
730 (*model->scpi_dialect)[SCPI_CMD_SET_DIG_POD_STATE],
731 i + 1, pod_enabled[i]);
732 if (sr_scpi_send(scpi, command) != SR_OK) {
736 state->digital_pods[i].state = pod_enabled[i];
737 setup_changed = TRUE;
743 if (setup_changed && hmo_update_sample_rate(sdi) != SR_OK)
749 static int dev_acquisition_start(const struct sr_dev_inst *sdi)
752 gboolean digital_added[MAX_DIGITAL_GROUP_COUNT];
753 size_t group, pod_count;
754 struct sr_channel *ch;
755 struct dev_context *devc;
756 struct sr_scpi_dev_inst *scpi;
762 devc->num_samples = 0;
763 devc->num_frames = 0;
765 /* Preset empty results. */
766 for (group = 0; group < ARRAY_SIZE(digital_added); group++)
767 digital_added[group] = FALSE;
768 g_slist_free(devc->enabled_channels);
769 devc->enabled_channels = NULL;
772 * Contruct the list of enabled channels. Determine the highest
773 * number of digital pods involved in the acquisition.
776 for (l = sdi->channels; l; l = l->next) {
780 /* Only add a single digital channel per group (pod). */
781 group = ch->index / 8;
782 if (ch->type != SR_CHANNEL_LOGIC || !digital_added[group]) {
783 devc->enabled_channels = g_slist_append(
784 devc->enabled_channels, ch);
785 if (ch->type == SR_CHANNEL_LOGIC) {
786 digital_added[group] = TRUE;
787 if (pod_count < group + 1)
788 pod_count = group + 1;
792 if (!devc->enabled_channels)
794 devc->pod_count = pod_count;
795 devc->logic_data = NULL;
798 * Check constraints. Some channels can be either analog or
799 * digital, but not both at the same time.
801 if (hmo_check_channels(devc->enabled_channels) != SR_OK) {
802 sr_err("Invalid channel configuration specified!");
808 * Configure the analog and digital channels and the
809 * corresponding digital pods.
811 if (hmo_setup_channels(sdi) != SR_OK) {
812 sr_err("Failed to setup channel configuration!");
818 * Start acquisition on the first enabled channel. The
819 * receive routine will continue driving the acquisition.
821 sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 50,
822 hmo_receive_data, (void *)sdi);
824 std_session_send_df_header(sdi);
826 devc->current_channel = devc->enabled_channels;
828 return hmo_request_data(sdi);
831 g_slist_free(devc->enabled_channels);
832 devc->enabled_channels = NULL;
836 static int dev_acquisition_stop(struct sr_dev_inst *sdi)
838 struct dev_context *devc;
839 struct sr_scpi_dev_inst *scpi;
841 std_session_send_df_end(sdi);
845 devc->num_samples = 0;
846 devc->num_frames = 0;
847 g_slist_free(devc->enabled_channels);
848 devc->enabled_channels = NULL;
850 sr_scpi_source_remove(sdi->session, scpi);
855 static struct sr_dev_driver hameg_hmo_driver_info = {
857 .longname = "Hameg HMO",
860 .cleanup = std_cleanup,
862 .dev_list = std_dev_list,
863 .dev_clear = dev_clear,
864 .config_get = config_get,
865 .config_set = config_set,
866 .config_list = config_list,
867 .dev_open = dev_open,
868 .dev_close = dev_close,
869 .dev_acquisition_start = dev_acquisition_start,
870 .dev_acquisition_stop = dev_acquisition_stop,
873 SR_REGISTER_DEV_DRIVER(hameg_hmo_driver_info);