]> sigrok.org Git - libsigrok.git/commitdiff
deree-de5000: rename to serial-lcr, update configure logic
authorGerhard Sittig <redacted>
Mon, 26 Dec 2016 12:12:35 +0000 (13:12 +0100)
committerGerhard Sittig <redacted>
Mon, 26 Dec 2016 12:12:35 +0000 (13:12 +0100)
The former DER EE DE-5000 driver was a very thin wrapper around the
ES51919 LCR meter chipset. None of its source was specific to the
deree-de5000 device. In fact it contained code for all currently
supported LCR meters, and it's expected that all LCR meters which
will get added in the future will fit in as well.

Follow the serial-dmm model. Rename the src/hardware/deree-de5000/
directory to serial-lcr/. Update the configure logic. Although the
source directory and the configure option are named serial-lcr, the
LCR meter still is used by specifying the "deree-de5000" device driver
(which just happens to reside in the serial-lcr driver sources, among
others).

Makefile.am
configure.ac
src/hardware/deree-de5000/api.c [deleted file]
src/hardware/serial-lcr/api.c [new file with mode: 0644]

index d18a674da3a4e6cffeaca623984361e22dbcf7d0..8114f660dc921b5ac5f6d58916482b1b15017519 100644 (file)
@@ -272,10 +272,6 @@ src_libdrivers_la_SOURCES += \
        src/hardware/demo/protocol.c \
        src/hardware/demo/api.c
 endif
-if HW_DEREE_DE5000
-src_libdrivers_la_SOURCES += \
-       src/hardware/deree-de5000/api.c
-endif
 if HW_FLUKE_DMM
 src_libdrivers_la_SOURCES += \
        src/hardware/fluke-dmm/protocol.h \
@@ -453,6 +449,10 @@ src_libdrivers_la_SOURCES += \
        src/hardware/serial-dmm/protocol.c \
        src/hardware/serial-dmm/api.c
 endif
+if HW_SERIAL_LCR
+src_libdrivers_la_SOURCES += \
+       src/hardware/serial-lcr/api.c
+endif
 if HW_SYSCLK_LWLA
 src_libdrivers_la_SOURCES += \
        src/hardware/sysclk-lwla/lwla.h \
index 71b7b47c9c30a2aa2d1be9a9279d794d7a21a105..008dd4cc748346890cc76bc7457c2014661cd395 100644 (file)
@@ -233,7 +233,6 @@ SR_DRIVER([Center 3xx], [center-3xx], [libserialport])
 SR_DRIVER([ChronoVu LA], [chronovu-la], [libusb libftdi])
 SR_DRIVER([Colead SLM], [colead-slm], [libserialport])
 SR_DRIVER([Conrad DIGI 35 CPU], [conrad-digi-35-cpu], [libserialport])
-SR_DRIVER([DER EE DE-5000], [deree-de5000], [libserialport])
 SR_DRIVER([demo], [demo])
 SR_DRIVER([Fluke DMM], [fluke-dmm], [libserialport])
 SR_DRIVER([FTDI LA], [ftdi-la], [libusb libftdi])
@@ -264,6 +263,7 @@ SR_DRIVER([Rigol DS], [rigol-ds])
 SR_DRIVER([Saleae Logic16], [saleae-logic16], [libusb])
 SR_DRIVER([SCPI PPS], [scpi-pps])
 SR_DRIVER([serial DMM], [serial-dmm], [libserialport])
+SR_DRIVER([serial LCR], [serial-lcr], [libserialport])
 SR_DRIVER([Sysclk LWLA], [sysclk-lwla], [libusb])
 SR_DRIVER([Teleinfo], [teleinfo], [libserialport])
 SR_DRIVER([Testo], [testo], [libusb])
diff --git a/src/hardware/deree-de5000/api.c b/src/hardware/deree-de5000/api.c
deleted file mode 100644 (file)
index 580add4..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * This file is part of the libsigrok project.
- *
- * Copyright (C) 2014 Janne Huttunen <jahuttun@gmail.com>
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-#include <stdint.h>
-#include <string.h>
-#include <math.h>
-#include <glib.h>
-#include <libsigrok/libsigrok.h>
-#include "libsigrok-internal.h"
-
-#define LOG_PREFIX "serial-lcr-es51919"
-
-struct lcr_es51919_info {
-       struct sr_dev_driver di;
-       const char *vendor;
-       const char *model;
-};
-
-static int dev_clear(const struct sr_dev_driver *di)
-{
-       return std_dev_clear(di, es51919_serial_clean);
-}
-
-static GSList *scan(struct sr_dev_driver *di, GSList *options)
-{
-       struct lcr_es51919_info *lcr;
-       struct sr_dev_inst *sdi;
-
-       lcr = (struct lcr_es51919_info *)di;
-
-       if (!(sdi = es51919_serial_scan(options, lcr->vendor, lcr->model)))
-               return NULL;
-
-       return std_scan_complete(di, g_slist_append(NULL, sdi));
-}
-
-#define LCR_ES51919(id, vendor, model) \
-       &((struct lcr_es51919_info) { \
-               { \
-                       .name = id, \
-                       .longname = vendor " " model, \
-                       .api_version = 1, \
-                       .init = std_init, \
-                       .cleanup = std_cleanup, \
-                       .scan = scan, \
-                       .dev_list = std_dev_list, \
-                       .dev_clear = dev_clear, \
-                       .config_get = es51919_serial_config_get, \
-                       .config_set = es51919_serial_config_set, \
-                       .config_list = es51919_serial_config_list, \
-                       .dev_open = std_serial_dev_open, \
-                       .dev_close = std_serial_dev_close, \
-                       .dev_acquisition_start = es51919_serial_acquisition_start, \
-                       .dev_acquisition_stop = std_serial_dev_acquisition_stop, \
-                       .context = NULL, \
-               }, \
-               vendor, model, \
-       }).di
-
-SR_REGISTER_DEV_DRIVER_LIST(lcr_es51919_drivers,
-       LCR_ES51919("deree-de5000", "DER EE", "DE-5000"),
-       LCR_ES51919("peaktech-2170", "PeakTech", "2170"),
-);
diff --git a/src/hardware/serial-lcr/api.c b/src/hardware/serial-lcr/api.c
new file mode 100644 (file)
index 0000000..580add4
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * This file is part of the libsigrok project.
+ *
+ * Copyright (C) 2014 Janne Huttunen <jahuttun@gmail.com>
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include <stdint.h>
+#include <string.h>
+#include <math.h>
+#include <glib.h>
+#include <libsigrok/libsigrok.h>
+#include "libsigrok-internal.h"
+
+#define LOG_PREFIX "serial-lcr-es51919"
+
+struct lcr_es51919_info {
+       struct sr_dev_driver di;
+       const char *vendor;
+       const char *model;
+};
+
+static int dev_clear(const struct sr_dev_driver *di)
+{
+       return std_dev_clear(di, es51919_serial_clean);
+}
+
+static GSList *scan(struct sr_dev_driver *di, GSList *options)
+{
+       struct lcr_es51919_info *lcr;
+       struct sr_dev_inst *sdi;
+
+       lcr = (struct lcr_es51919_info *)di;
+
+       if (!(sdi = es51919_serial_scan(options, lcr->vendor, lcr->model)))
+               return NULL;
+
+       return std_scan_complete(di, g_slist_append(NULL, sdi));
+}
+
+#define LCR_ES51919(id, vendor, model) \
+       &((struct lcr_es51919_info) { \
+               { \
+                       .name = id, \
+                       .longname = vendor " " model, \
+                       .api_version = 1, \
+                       .init = std_init, \
+                       .cleanup = std_cleanup, \
+                       .scan = scan, \
+                       .dev_list = std_dev_list, \
+                       .dev_clear = dev_clear, \
+                       .config_get = es51919_serial_config_get, \
+                       .config_set = es51919_serial_config_set, \
+                       .config_list = es51919_serial_config_list, \
+                       .dev_open = std_serial_dev_open, \
+                       .dev_close = std_serial_dev_close, \
+                       .dev_acquisition_start = es51919_serial_acquisition_start, \
+                       .dev_acquisition_stop = std_serial_dev_acquisition_stop, \
+                       .context = NULL, \
+               }, \
+               vendor, model, \
+       }).di
+
+SR_REGISTER_DEV_DRIVER_LIST(lcr_es51919_drivers,
+       LCR_ES51919("deree-de5000", "DER EE", "DE-5000"),
+       LCR_ES51919("peaktech-2170", "PeakTech", "2170"),
+);