ut372: Initial sub-driver skeleton.
This commit is contained in:
parent
2cb63065f5
commit
f3cde30904
|
@ -115,7 +115,8 @@ libsigrok_la_SOURCES += \
|
||||||
src/dmm/metex14.c \
|
src/dmm/metex14.c \
|
||||||
src/dmm/rs9lcd.c \
|
src/dmm/rs9lcd.c \
|
||||||
src/dmm/bm25x.c \
|
src/dmm/bm25x.c \
|
||||||
src/dmm/ut71x.c
|
src/dmm/ut71x.c \
|
||||||
|
src/dmm/ut372.c
|
||||||
|
|
||||||
# Hardware (LCR chip parsers)
|
# Hardware (LCR chip parsers)
|
||||||
if NEED_SERIAL
|
if NEED_SERIAL
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -186,6 +186,7 @@ extern SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_HW_UNI_T_DMM
|
#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 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_ut60a_driver_info;
|
||||||
extern SR_PRIV struct sr_dev_driver uni_t_ut60e_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;
|
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
|
#endif
|
||||||
#ifdef HAVE_HW_UNI_T_DMM
|
#ifdef HAVE_HW_UNI_T_DMM
|
||||||
&tecpel_dmm_8061_driver_info,
|
&tecpel_dmm_8061_driver_info,
|
||||||
|
&uni_t_ut372_driver_info,
|
||||||
&uni_t_ut60a_driver_info,
|
&uni_t_ut60a_driver_info,
|
||||||
&uni_t_ut60e_driver_info,
|
&uni_t_ut60e_driver_info,
|
||||||
&uni_t_ut60g_driver_info,
|
&uni_t_ut60g_driver_info,
|
||||||
|
|
|
@ -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 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_ut60a_driver_info;
|
||||||
SR_PRIV struct sr_dev_driver uni_t_ut60e_driver_info;
|
SR_PRIV struct sr_dev_driver uni_t_ut60e_driver_info;
|
||||||
SR_PRIV struct sr_dev_driver uni_t_ut60g_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,
|
sr_fs9721_00_temp_c,
|
||||||
&tecpel_dmm_8061_driver_info, receive_data_TECPEL_DMM_8061,
|
&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,
|
"UNI-T", "UT60A", 2400,
|
||||||
FS9721_PACKET_SIZE,
|
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(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_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_ut60e, UNI_T_UT60E, "uni-t-ut60e", "UNI-T UT60E")
|
||||||
DRV(uni_t_ut60g, UNI_T_UT60G, "uni-t-ut60g", "UNI-T UT60G")
|
DRV(uni_t_ut60g, UNI_T_UT60G, "uni-t-ut60g", "UNI-T UT60G")
|
||||||
|
|
|
@ -303,6 +303,7 @@ SR_PRIV int receive_data_##ID_UPPER(int fd, int revents, void *cb_data) { \
|
||||||
|
|
||||||
/* Driver-specific receive_data() wrappers */
|
/* Driver-specific receive_data() wrappers */
|
||||||
RECEIVE_DATA(TECPEL_DMM_8061, fs9721)
|
RECEIVE_DATA(TECPEL_DMM_8061, fs9721)
|
||||||
|
RECEIVE_DATA(UNI_T_UT372, ut372)
|
||||||
RECEIVE_DATA(UNI_T_UT60A, fs9721)
|
RECEIVE_DATA(UNI_T_UT60A, fs9721)
|
||||||
RECEIVE_DATA(UNI_T_UT60E, fs9721)
|
RECEIVE_DATA(UNI_T_UT60E, fs9721)
|
||||||
RECEIVE_DATA(UNI_T_UT60G, es519xx)
|
RECEIVE_DATA(UNI_T_UT60G, es519xx)
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
TECPEL_DMM_8061,
|
TECPEL_DMM_8061,
|
||||||
|
UNI_T_UT372,
|
||||||
UNI_T_UT60A,
|
UNI_T_UT60A,
|
||||||
UNI_T_UT60E,
|
UNI_T_UT60E,
|
||||||
UNI_T_UT60G,
|
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_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_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_UT60E(int fd, int revents, void *cb_data);
|
||||||
SR_PRIV int receive_data_UNI_T_UT60G(int fd, int revents, void *cb_data);
|
SR_PRIV int receive_data_UNI_T_UT60G(int fd, int revents, void *cb_data);
|
||||||
|
|
|
@ -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,
|
SR_PRIV int es51919_serial_acquisition_stop(struct sr_dev_inst *sdi,
|
||||||
void *cb_data);
|
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
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue