From: Uwe Hermann Date: Mon, 29 Apr 2013 18:23:21 +0000 (+0200) Subject: uni-t-dmm: Add support for the UNI-T UT61E. X-Git-Tag: dsupstream~22 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bbef5e326de1669b039413d8753fceda7281e936;p=libsigrok.git uni-t-dmm: Add support for the UNI-T UT61E. This DMM is already supported via the serial-dmm driver when using the RS232 cable. The uni-t-dmm support makes it usable with the USB/HID cable too. --- diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index 37e06dc7..f7c780d2 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -38,6 +38,7 @@ static const int32_t hwcaps[] = { }; SR_PRIV struct sr_dev_driver uni_t_ut61d_driver_info; +SR_PRIV struct sr_dev_driver uni_t_ut61e_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info; SR_PRIV struct dmm_info udmms[] = { @@ -48,6 +49,13 @@ SR_PRIV struct dmm_info udmms[] = { NULL, &uni_t_ut61d_driver_info, receive_data_UNI_T_UT61D, }, + { + "UNI-T", "UT61E", 19230, + ES51922_PACKET_SIZE, NULL, + sr_es51922_packet_valid, sr_es51922_parse, + NULL, + &uni_t_ut61e_driver_info, receive_data_UNI_T_UT61E, + }, { "Voltcraft", "VC-820", 2400, FS9721_PACKET_SIZE, NULL, @@ -309,4 +317,5 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \ }; 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") DRV(voltcraft_vc820, VOLTCRAFT_VC820, "voltcraft-vc820", "Voltcraft VC-820") diff --git a/hardware/uni-t-dmm/protocol.c b/hardware/uni-t-dmm/protocol.c index a18c2e6c..e53827a4 100644 --- a/hardware/uni-t-dmm/protocol.c +++ b/hardware/uni-t-dmm/protocol.c @@ -291,4 +291,5 @@ SR_PRIV int receive_data_##ID_UPPER(int fd, int revents, void *cb_data) { \ /* Driver-specific receive_data() wrappers */ RECEIVE_DATA(UNI_T_UT61D, fs9922) +RECEIVE_DATA(UNI_T_UT61E, es51922) RECEIVE_DATA(VOLTCRAFT_VC820, fs9721) diff --git a/hardware/uni-t-dmm/protocol.h b/hardware/uni-t-dmm/protocol.h index 3376861a..4250c0e4 100644 --- a/hardware/uni-t-dmm/protocol.h +++ b/hardware/uni-t-dmm/protocol.h @@ -39,10 +39,11 @@ /* Note: When adding entries here, don't forget to update DMM_COUNT. */ enum { UNI_T_UT61D, + UNI_T_UT61E, VOLTCRAFT_VC820, }; -#define DMM_COUNT 2 +#define DMM_COUNT 3 struct dmm_info { char *vendor; @@ -86,6 +87,7 @@ struct dev_context { }; 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); SR_PRIV int receive_data_VOLTCRAFT_VC820(int fd, int revents, void *cb_data); #endif diff --git a/hwdriver.c b/hwdriver.c index 07957345..5ee94e7d 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -165,6 +165,7 @@ 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 uni_t_ut61d_driver_info; +extern SR_PRIV struct sr_dev_driver uni_t_ut61e_driver_info; extern SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info; #endif /** @endcond */ @@ -248,6 +249,7 @@ static struct sr_dev_driver *drivers_list[] = { #endif #ifdef HAVE_HW_UNI_T_DMM &uni_t_ut61d_driver_info, + &uni_t_ut61e_driver_info, &voltcraft_vc820_driver_info, #endif NULL,