]> sigrok.org Git - libsigrok.git/commitdiff
ut372: Initial sub-driver skeleton.
authorMartin Ling <redacted>
Sun, 1 Mar 2015 21:13:30 +0000 (21:13 +0000)
committerMartin Ling <redacted>
Sun, 1 Mar 2015 22:30:57 +0000 (22:30 +0000)
Makefile.am
src/dmm/ut372.c [new file with mode: 0644]
src/drivers.c
src/hardware/uni-t-dmm/api.c
src/hardware/uni-t-dmm/protocol.c
src/hardware/uni-t-dmm/protocol.h
src/libsigrok-internal.h

index 16007a8001a270820e34271782d43841887b625a..0d45f7c45638fdce57f8aae49ae7375a6276b43e 100644 (file)
@@ -115,7 +115,8 @@ libsigrok_la_SOURCES += \
        src/dmm/metex14.c \
        src/dmm/rs9lcd.c \
        src/dmm/bm25x.c \
-       src/dmm/ut71x.c
+       src/dmm/ut71x.c \
+       src/dmm/ut372.c
 
 # Hardware (LCR chip parsers)
 if NEED_SERIAL
diff --git a/src/dmm/ut372.c b/src/dmm/ut372.c
new file mode 100644 (file)
index 0000000..4e763a3
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the libsigrok project.
+ *
+ * Copyright (C) 2015 Martin Ling <martin-sigrok@earth.li>
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+/*
+ * UNI-T UT372 protocol parser.
+ */
+
+#include "libsigrok.h"
+#include "libsigrok-internal.h"
+
+#define LOG_PREFIX "ut372"
+
+SR_PRIV gboolean sr_ut372_packet_valid(const uint8_t *buf)
+{
+       return FALSE;
+}
+
+SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval,
+               struct sr_datafeed_analog *analog, void *info)
+{
+       return SR_OK;
+}
index 3f006b61dc5566a340cabe42948ab0602d3e6bea..c80af43f05dde96b9acdd4636f930f1e2f52f9bf 100644 (file)
@@ -186,6 +186,7 @@ extern SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info;
 #endif
 #ifdef HAVE_HW_UNI_T_DMM
 extern SR_PRIV struct sr_dev_driver tecpel_dmm_8061_driver_info;
+extern SR_PRIV struct sr_dev_driver uni_t_ut372_driver_info;
 extern SR_PRIV struct sr_dev_driver uni_t_ut60a_driver_info;
 extern SR_PRIV struct sr_dev_driver uni_t_ut60e_driver_info;
 extern SR_PRIV struct sr_dev_driver uni_t_ut60g_driver_info;
@@ -386,6 +387,7 @@ SR_PRIV struct sr_dev_driver *drivers_list[] = {
 #endif
 #ifdef HAVE_HW_UNI_T_DMM
        &tecpel_dmm_8061_driver_info,
+       &uni_t_ut372_driver_info,
        &uni_t_ut60a_driver_info,
        &uni_t_ut60e_driver_info,
        &uni_t_ut60g_driver_info,
index e1580b998df3914c4f260c58370dd8f04c175ce8..a34873b4c7da835f9943af1a216583e996236ee7 100644 (file)
@@ -38,6 +38,7 @@ static const uint32_t devopts[] = {
 };
 
 SR_PRIV struct sr_dev_driver tecpel_dmm_8061_driver_info;
+SR_PRIV struct sr_dev_driver uni_t_ut372_driver_info;
 SR_PRIV struct sr_dev_driver uni_t_ut60a_driver_info;
 SR_PRIV struct sr_dev_driver uni_t_ut60e_driver_info;
 SR_PRIV struct sr_dev_driver uni_t_ut60g_driver_info;
@@ -67,6 +68,13 @@ SR_PRIV struct dmm_info udmms[] = {
                sr_fs9721_00_temp_c,
                &tecpel_dmm_8061_driver_info, receive_data_TECPEL_DMM_8061,
        },
+       {
+               "UNI-T", "UT372", 2400,
+               UT372_PACKET_SIZE,
+               sr_ut372_packet_valid, sr_ut372_parse,
+               NULL,
+               &uni_t_ut372_driver_info, receive_data_UNI_T_UT372,
+       },
        {
                "UNI-T", "UT60A", 2400,
                FS9721_PACKET_SIZE,
@@ -446,6 +454,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \
 };
 
 DRV(tecpel_dmm_8061, TECPEL_DMM_8061, "tecpel-dmm-8061", "Tecpel DMM-8061")
+DRV(uni_t_ut372, UNI_T_UT372, "uni-t-ut372", "UNI-T UT372")
 DRV(uni_t_ut60a, UNI_T_UT60A, "uni-t-ut60a", "UNI-T UT60A")
 DRV(uni_t_ut60e, UNI_T_UT60E, "uni-t-ut60e", "UNI-T UT60E")
 DRV(uni_t_ut60g, UNI_T_UT60G, "uni-t-ut60g", "UNI-T UT60G")
index 37144980fa108ea13e5b880274b491e686ec47ff..8355382fb466f6f49f5d0fa7b53d0217747a1077 100644 (file)
@@ -303,6 +303,7 @@ SR_PRIV int receive_data_##ID_UPPER(int fd, int revents, void *cb_data) { \
 
 /* Driver-specific receive_data() wrappers */
 RECEIVE_DATA(TECPEL_DMM_8061, fs9721)
+RECEIVE_DATA(UNI_T_UT372, ut372)
 RECEIVE_DATA(UNI_T_UT60A, fs9721)
 RECEIVE_DATA(UNI_T_UT60E, fs9721)
 RECEIVE_DATA(UNI_T_UT60G, es519xx)
index 85783082cd9b5194253ed9a4ad0c3adfe37482e6..141414a71ca5ddbbd207796550ea9d2a6d46bda7 100644 (file)
@@ -31,6 +31,7 @@
 
 enum {
        TECPEL_DMM_8061,
+       UNI_T_UT372,
        UNI_T_UT60A,
        UNI_T_UT60E,
        UNI_T_UT60G,
@@ -94,6 +95,7 @@ struct dev_context {
 };
 
 SR_PRIV int receive_data_TECPEL_DMM_8061(int fd, int revents, void *cb_data);
+SR_PRIV int receive_data_UNI_T_UT372(int fd, int revents, void *cb_data);
 SR_PRIV int receive_data_UNI_T_UT60A(int fd, int revents, void *cb_data);
 SR_PRIV int receive_data_UNI_T_UT60E(int fd, int revents, void *cb_data);
 SR_PRIV int receive_data_UNI_T_UT60G(int fd, int revents, void *cb_data);
index 9e080265fda5e93f2fda811eee7b6884a72b2e5b..574497c11afa4d5a7bf1a76cead3e33724bde32a 100644 (file)
@@ -1092,4 +1092,16 @@ SR_PRIV int es51919_serial_acquisition_start(const struct sr_dev_inst *sdi,
 SR_PRIV int es51919_serial_acquisition_stop(struct sr_dev_inst *sdi,
                                            void *cb_data);
 
+/*--- hardware/dmm/ut372.c --------------------------------------------------*/
+
+#define UT372_PACKET_SIZE 27
+
+struct ut372_info {
+       int dummy;
+};
+
+SR_PRIV gboolean sr_ut372_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval,
+               struct sr_datafeed_analog *analog, void *info);
+
 #endif