From: Uwe Hermann Date: Tue, 30 Apr 2013 18:27:04 +0000 (+0200) Subject: uni-t-dmm: Add support for the Voltcraft VC-840. X-Git-Tag: dsupstream~21 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=695d0e1efa819dc98914ce1baec388c8734e98a7;p=libsigrok.git uni-t-dmm: Add support for the Voltcraft VC-840. 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 f7c780d2..7cf29fcb 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -40,6 +40,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 sr_dev_driver voltcraft_vc840_driver_info; SR_PRIV struct dmm_info udmms[] = { { @@ -63,6 +64,13 @@ SR_PRIV struct dmm_info udmms[] = { NULL, &voltcraft_vc820_driver_info, receive_data_VOLTCRAFT_VC820, }, + { + "Voltcraft", "VC-840", 2400, + FS9721_PACKET_SIZE, NULL, + sr_fs9721_packet_valid, sr_fs9721_parse, + NULL, + &voltcraft_vc840_driver_info, receive_data_VOLTCRAFT_VC840, + }, }; static int clear_instances(int dmm) @@ -319,3 +327,4 @@ 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") +DRV(voltcraft_vc840, VOLTCRAFT_VC840, "voltcraft-vc840", "Voltcraft VC-840") diff --git a/hardware/uni-t-dmm/protocol.c b/hardware/uni-t-dmm/protocol.c index e53827a4..d6cfcb87 100644 --- a/hardware/uni-t-dmm/protocol.c +++ b/hardware/uni-t-dmm/protocol.c @@ -293,3 +293,4 @@ SR_PRIV int receive_data_##ID_UPPER(int fd, int revents, void *cb_data) { \ RECEIVE_DATA(UNI_T_UT61D, fs9922) RECEIVE_DATA(UNI_T_UT61E, es51922) RECEIVE_DATA(VOLTCRAFT_VC820, fs9721) +RECEIVE_DATA(VOLTCRAFT_VC840, fs9721) diff --git a/hardware/uni-t-dmm/protocol.h b/hardware/uni-t-dmm/protocol.h index 4250c0e4..a367336a 100644 --- a/hardware/uni-t-dmm/protocol.h +++ b/hardware/uni-t-dmm/protocol.h @@ -41,9 +41,10 @@ enum { UNI_T_UT61D, UNI_T_UT61E, VOLTCRAFT_VC820, + VOLTCRAFT_VC840, }; -#define DMM_COUNT 3 +#define DMM_COUNT 4 struct dmm_info { char *vendor; @@ -89,5 +90,6 @@ 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); +SR_PRIV int receive_data_VOLTCRAFT_VC840(int fd, int revents, void *cb_data); #endif diff --git a/hwdriver.c b/hwdriver.c index 5ee94e7d..e9a15c1a 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -167,6 +167,7 @@ extern SR_PRIV struct sr_dev_driver uni_t_ut61e_ser_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; extern SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info; +extern SR_PRIV struct sr_dev_driver voltcraft_vc840_driver_info; #endif /** @endcond */ @@ -251,6 +252,7 @@ static struct sr_dev_driver *drivers_list[] = { &uni_t_ut61d_driver_info, &uni_t_ut61e_driver_info, &voltcraft_vc820_driver_info, + &voltcraft_vc840_driver_info, #endif NULL, };