From: Uwe Hermann Date: Sun, 16 Dec 2012 21:17:48 +0000 (+0100) Subject: serial-dmm: Add Voltcraft VC-840 (UT-D02) support. X-Git-Tag: dsupstream~440 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=54d112218713b34491cd65454abad340ff19a393;p=libsigrok.git serial-dmm: Add Voltcraft VC-840 (UT-D02) support. This works with the UNI-T UT-D02 (RS232) cable. For the USB/HID based cable (UNI-T UT-D04), the uni-t-dmm driver must be used. Note: This is untested, but should work just fine for all settings, with the possible exception of temperature (testers needed!) --- diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index bbf821ee..b132ee42 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -59,6 +59,7 @@ SR_PRIV struct sr_dev_driver pce_pce_dm32_driver_info; SR_PRIV struct sr_dev_driver radioshack_22_168_driver_info; SR_PRIV struct sr_dev_driver radioshack_22_812_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc820_ser_driver_info; +SR_PRIV struct sr_dev_driver voltcraft_vc840_ser_driver_info; SR_PRIV struct dmm_info dmms[] = { { @@ -145,6 +146,13 @@ SR_PRIV struct dmm_info dmms[] = { NULL, &voltcraft_vc820_ser_driver_info, receive_data_VOLTCRAFT_VC820, }, + { + "Voltcraft", "VC-840 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", + 2400, FS9721_PACKET_SIZE, NULL, + sr_fs9721_packet_valid, sr_fs9721_parse, + NULL, + &voltcraft_vc840_ser_driver_info, receive_data_VOLTCRAFT_VC840, + }, }; /* Properly close and free all devices. */ diff --git a/hardware/serial-dmm/protocol.c b/hardware/serial-dmm/protocol.c index 4fea8def..d10eec26 100644 --- a/hardware/serial-dmm/protocol.c +++ b/hardware/serial-dmm/protocol.c @@ -204,3 +204,4 @@ RECEIVE_DATA(PCE_PCE_DM32, fs9721) RECEIVE_DATA(RADIOSHACK_22_168, metex14) RECEIVE_DATA(RADIOSHACK_22_812, rs9lcd) RECEIVE_DATA(VOLTCRAFT_VC820, fs9721) +RECEIVE_DATA(VOLTCRAFT_VC840, fs9721) diff --git a/hardware/serial-dmm/protocol.h b/hardware/serial-dmm/protocol.h index e419b34d..d03a391b 100644 --- a/hardware/serial-dmm/protocol.h +++ b/hardware/serial-dmm/protocol.h @@ -43,9 +43,10 @@ enum { RADIOSHACK_22_168, RADIOSHACK_22_812, VOLTCRAFT_VC820, + VOLTCRAFT_VC840, }; -#define DMM_COUNT 12 +#define DMM_COUNT 13 struct dmm_info { char *vendor; @@ -96,6 +97,7 @@ SR_PRIV int receive_data_PCE_PCE_DM32(int fd, int revents, void *cb_data); SR_PRIV int receive_data_RADIOSHACK_22_168(int fd, int revents, void *cb_data); SR_PRIV int receive_data_RADIOSHACK_22_812(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); SR_PRIV void dmm_details_tp4000zc(struct sr_datafeed_analog *analog, void *info); SR_PRIV void dmm_details_dt4000zc(struct sr_datafeed_analog *analog, void *info); diff --git a/hwdriver.c b/hwdriver.c index a42f4fba..6c2c960a 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -126,6 +126,7 @@ extern SR_PRIV struct sr_dev_driver pce_pce_dm32_driver_info; extern SR_PRIV struct sr_dev_driver radioshack_22_168_driver_info; extern SR_PRIV struct sr_dev_driver radioshack_22_812_driver_info; extern SR_PRIV struct sr_dev_driver voltcraft_vc820_ser_driver_info; +extern SR_PRIV struct sr_dev_driver voltcraft_vc840_ser_driver_info; #endif #ifdef HAVE_HW_UNI_T_DMM extern SR_PRIV struct sr_dev_driver uni_t_ut61d_driver_info; @@ -192,6 +193,7 @@ static struct sr_dev_driver *drivers_list[] = { &radioshack_22_168_driver_info, &radioshack_22_812_driver_info, &voltcraft_vc820_ser_driver_info, + &voltcraft_vc840_ser_driver_info, #endif #ifdef HAVE_HW_UNI_T_DMM &uni_t_ut61d_driver_info,