From 4554314c4f72d8df69b7236cb19d15a00fdceaeb Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 1 May 2013 03:04:46 +0200 Subject: [PATCH] uni-t-dmm: Add Tecpel DMM-8060 support. This is _very_ likely to be a rebadged Voltcraft VC-820, treating as such. --- hardware/uni-t-dmm/api.c | 9 +++++++++ hardware/uni-t-dmm/protocol.c | 1 + hardware/uni-t-dmm/protocol.h | 4 +++- hwdriver.c | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index 7cc8ee8a..1d5b511b 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -37,6 +37,7 @@ static const int32_t hwcaps[] = { SR_CONF_CONTINUOUS, }; +SR_PRIV struct sr_dev_driver tecpel_dmm_8060_driver_info; SR_PRIV struct sr_dev_driver tecpel_dmm_8061_driver_info; SR_PRIV struct sr_dev_driver uni_t_ut61d_driver_info; SR_PRIV struct sr_dev_driver uni_t_ut61e_driver_info; @@ -44,6 +45,13 @@ SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc840_driver_info; SR_PRIV struct dmm_info udmms[] = { + { + "Tecpel", "DMM-8060", 2400, + FS9721_PACKET_SIZE, NULL, + sr_fs9721_packet_valid, sr_fs9721_parse, + NULL, + &tecpel_dmm_8060_driver_info, receive_data_TECPEL_DMM_8060, + }, { "Tecpel", "DMM-8061", 2400, FS9721_PACKET_SIZE, NULL, @@ -332,6 +340,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ .priv = NULL, \ }; +DRV(tecpel_dmm_8060, TECPEL_DMM_8060, "tecpel-dmm-8060", "Tecpel DMM-8060") DRV(tecpel_dmm_8061, TECPEL_DMM_8061, "tecpel-dmm-8061", "Tecpel DMM-8061") DRV(uni_t_ut61d, UNI_T_UT61D, "uni-t-ut61d", "UNI-T UT61D") DRV(uni_t_ut61e, UNI_T_UT61E, "uni-t-ut61e", "UNI-T UT61E") diff --git a/hardware/uni-t-dmm/protocol.c b/hardware/uni-t-dmm/protocol.c index d24b12c1..2963e659 100644 --- a/hardware/uni-t-dmm/protocol.c +++ b/hardware/uni-t-dmm/protocol.c @@ -292,6 +292,7 @@ SR_PRIV int receive_data_##ID_UPPER(int fd, int revents, void *cb_data) { \ return receive_data(fd, revents, ID_UPPER, &info, cb_data); } /* Driver-specific receive_data() wrappers */ +RECEIVE_DATA(TECPEL_DMM_8060, fs9721) RECEIVE_DATA(TECPEL_DMM_8061, fs9721) RECEIVE_DATA(UNI_T_UT61D, fs9922) RECEIVE_DATA(UNI_T_UT61E, es51922) diff --git a/hardware/uni-t-dmm/protocol.h b/hardware/uni-t-dmm/protocol.h index 51128f6d..fbfd9556 100644 --- a/hardware/uni-t-dmm/protocol.h +++ b/hardware/uni-t-dmm/protocol.h @@ -38,6 +38,7 @@ /* Note: When adding entries here, don't forget to update DMM_COUNT. */ enum { + TECPEL_DMM_8060, TECPEL_DMM_8061, UNI_T_UT61D, UNI_T_UT61E, @@ -45,7 +46,7 @@ enum { VOLTCRAFT_VC840, }; -#define DMM_COUNT 5 +#define DMM_COUNT 6 struct dmm_info { char *vendor; @@ -88,6 +89,7 @@ struct dev_context { uint8_t buflen; }; +SR_PRIV int receive_data_TECPEL_DMM_8060(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_UT61D(int fd, int revents, void *cb_data); SR_PRIV int receive_data_UNI_T_UT61E(int fd, int revents, void *cb_data); diff --git a/hwdriver.c b/hwdriver.c index 88b00060..dd5a6301 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -164,6 +164,7 @@ extern SR_PRIV struct sr_dev_driver uni_t_ut61d_ser_driver_info; extern SR_PRIV struct sr_dev_driver uni_t_ut61e_ser_driver_info; #endif #ifdef HAVE_HW_UNI_T_DMM +extern SR_PRIV struct sr_dev_driver tecpel_dmm_8060_driver_info; extern SR_PRIV struct sr_dev_driver tecpel_dmm_8061_driver_info; extern SR_PRIV struct sr_dev_driver uni_t_ut61d_driver_info; extern SR_PRIV struct sr_dev_driver uni_t_ut61e_driver_info; @@ -250,6 +251,7 @@ static struct sr_dev_driver *drivers_list[] = { &uni_t_ut61e_ser_driver_info, #endif #ifdef HAVE_HW_UNI_T_DMM + &tecpel_dmm_8060_driver_info, &tecpel_dmm_8061_driver_info, &uni_t_ut61d_driver_info, &uni_t_ut61e_driver_info,