From: Matthias Heidbrink Date: Wed, 25 Jun 2014 21:22:50 +0000 (+0200) Subject: manson-hcs-3xxx: Added missing models of series, fixed current resolution. X-Git-Tag: libsigrok-0.4.0~1277 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=25abc8dd135f9948e7ef52da9443b53f260dd83d;hp=adeae78f90a54fd7ca773f5e1cf433ccb1858e23;p=libsigrok.git manson-hcs-3xxx: Added missing models of series, fixed current resolution. --- diff --git a/hardware/manson-hcs-3xxx/api.c b/hardware/manson-hcs-3xxx/api.c index 2c8d1d7b..14877310 100644 --- a/hardware/manson-hcs-3xxx/api.c +++ b/hardware/manson-hcs-3xxx/api.c @@ -2,6 +2,7 @@ * This file is part of the libsigrok project. * * Copyright (C) 2014 Uwe Hermann + * Copyright (C) 2014 Matthias Heidbrink * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,10 +37,23 @@ static const int32_t devopts[] = { /* Note: All models have one power supply output only. */ static struct hcs_model models[] = { - { MANSON_HCS_3200, "HCS-3200", { 1, 18, 0.1 }, { 0, 20, 0.01 } }, - { MANSON_HCS_3202, "HCS-3202", { 1, 36, 0.1 }, { 0, 10, 0.01 } }, - { MANSON_HCS_3204, "HCS-3204", { 1, 60, 0.1 }, { 0, 5, 0.01 } }, - { 0, NULL, { 0, 0, 0 }, { 0, 0, 0 }, }, + { MANSON_HCS_3100, "HCS-3100", "3100", { 1, 18, 0.1 }, { 0, 10, 0.10 } }, + { MANSON_HCS_3102, "HCS-3102", "3102", { 1, 36, 0.1 }, { 0, 5, 0.01 } }, + { MANSON_HCS_3104, "HCS-3104", "3104", { 1, 60, 0.1 }, { 0, 2.5, 0.01 } }, + { MANSON_HCS_3150, "HCS-3150", "3150", { 1, 18, 0.1 }, { 0, 15, 0.10 } }, + { MANSON_HCS_3200, "HCS-3200", "3200", { 1, 18, 0.1 }, { 0, 20, 0.10 } }, + { MANSON_HCS_3202, "HCS-3202", "3202", { 1, 36, 0.1 }, { 0, 10, 0.10 } }, + { MANSON_HCS_3204, "HCS-3204", "3204", { 1, 60, 0.1 }, { 0, 5, 0.01 } }, + { MANSON_HCS_3300, "HCS-3300-USB", "3300", { 1, 16, 0.1 }, { 0, 30, 0.10 } }, + { MANSON_HCS_3302, "HCS-3302-USB", "3302", { 1, 32, 0.1 }, { 0, 15, 0.10 } }, + { MANSON_HCS_3304, "HCS-3304-USB", "3304", { 1, 60, 0.1 }, { 0, 8, 0.10 } }, + { MANSON_HCS_3400, "HCS-3400-USB", "3400", { 1, 16, 0.1 }, { 0, 40, 0.10 } }, + { MANSON_HCS_3402, "HCS-3402-USB", "3402", { 1, 32, 0.1 }, { 0, 20, 0.10 } }, + { MANSON_HCS_3404, "HCS-3404-USB", "3404", { 1, 60, 0.1 }, { 0, 10, 0.10 } }, + { MANSON_HCS_3600, "HCS-3600-USB", "3600", { 1, 16, 0.1 }, { 0, 60, 0.10 } }, + { MANSON_HCS_3602, "HCS-3602-USB", "3602", { 1, 32, 0.1 }, { 0, 30, 0.10 } }, + { MANSON_HCS_3604, "HCS-3604-USB", "3604", { 1, 60, 0.1 }, { 0, 15, 0.10 } }, + { 0, NULL, NULL, { 0, 0, 0 }, { 0, 0, 0 }, }, }; SR_PRIV struct sr_dev_driver manson_hcs_3xxx_driver_info; @@ -111,12 +125,12 @@ static GSList *scan(GSList *options) tokens = g_strsplit((const gchar *)&reply, "\r", 2); model_id = -1; - for (i = 0; models[i].name != NULL; i++) { - if (!strcmp(models[i].name + 4, tokens[0])) + for (i = 0; models[i].id != NULL; i++) { + if (!strcmp(models[i].id, tokens[0])) model_id = i; } if (model_id < 0) { - sr_err("Unknown model '%s' detected, aborting.", tokens[0]); + sr_err("Unknown model id '%s' detected, aborting.", tokens[0]); return NULL; } diff --git a/hardware/manson-hcs-3xxx/protocol.h b/hardware/manson-hcs-3xxx/protocol.h index 572d9274..5019071f 100644 --- a/hardware/manson-hcs-3xxx/protocol.h +++ b/hardware/manson-hcs-3xxx/protocol.h @@ -2,6 +2,7 @@ * This file is part of the libsigrok project. * * Copyright (C) 2014 Uwe Hermann + * Copyright (C) 2014 Matthias Heidbrink * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,16 +32,30 @@ #define LOG_PREFIX "manson-hcs-3xxx" enum { + MANSON_HCS_3100, + MANSON_HCS_3102, + MANSON_HCS_3104, + MANSON_HCS_3150, MANSON_HCS_3200, MANSON_HCS_3202, MANSON_HCS_3204, + MANSON_HCS_3300, + MANSON_HCS_3302, + MANSON_HCS_3304, + MANSON_HCS_3400, + MANSON_HCS_3402, + MANSON_HCS_3404, + MANSON_HCS_3600, + MANSON_HCS_3602, + MANSON_HCS_3604, }; struct hcs_model { - int model_id; - char *name; - double voltage[3]; /* Min, max, step */ - double current[3]; /* Min, max, step */ + int model_id; /**< Model info */ + char *name; /**< Model name */ + char *id; /**< Model ID, like delivered by interface */ + double voltage[3]; /**< Min, max, step */ + double current[3]; /**< Min, max, step */ }; /** Private, per-device-instance driver context. */