From: Uwe Hermann Date: Mon, 29 Apr 2013 18:15:02 +0000 (+0200) Subject: serial-dmm: Add support for the UNI-T UT61D. X-Git-Tag: dsupstream~23 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ae3a59de62e5912d68d8738a78a4403146cbfda5;p=libsigrok.git serial-dmm: Add support for the UNI-T UT61D. This DMM is already supported via the uni-t-dmm driver when using the USB/HID cable. The serial-dmm support makes it usable with the RS232 cable too. --- diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index f59702cc..89ea0dc8 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -55,6 +55,7 @@ SR_PRIV struct sr_dev_driver radioshack_22_805_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 sr_dev_driver uni_t_ut61d_ser_driver_info; SR_PRIV struct sr_dev_driver uni_t_ut61e_ser_driver_info; SR_PRIV struct dmm_info dmms[] = { @@ -158,6 +159,12 @@ SR_PRIV struct dmm_info dmms[] = { &voltcraft_vc840_ser_driver_info, receive_data_VOLTCRAFT_VC840_SER, }, + { + "UNI-T", "UT61D (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", + 2400, FS9922_PACKET_SIZE, NULL, + sr_fs9922_packet_valid, sr_fs9922_parse, NULL, + &uni_t_ut61d_ser_driver_info, receive_data_UNI_T_UT61D_SER, + }, { /* Note: ES51922 baudrate is actually 19230! */ "UNI-T", "UT61E (UT-D02 cable)", "19200/7o1/rts=0/dtr=1", @@ -508,4 +515,5 @@ DRV(radioshack_22_805, RADIOSHACK_22_805, "radioshack-22-805", "RadioShack 22-80 DRV(radioshack_22_812, RADIOSHACK_22_812, "radioshack-22-812", "RadioShack 22-812") DRV(voltcraft_vc820_ser, VOLTCRAFT_VC820_SER, "voltcraft-vc820-ser", "Voltcraft VC-820 (UT-D02 cable)") DRV(voltcraft_vc840_ser, VOLTCRAFT_VC840_SER, "voltcraft-vc840-ser", "Voltcraft VC-840 (UT-D02 cable)") +DRV(uni_t_ut61d_ser, UNI_T_UT61D_SER, "uni-t-ut61d-ser", "UNI-T UT61D (UT-D02 cable)") DRV(uni_t_ut61e_ser, UNI_T_UT61E_SER, "uni-t-ut61e-ser", "UNI-T UT61E (UT-D02 cable)") diff --git a/hardware/serial-dmm/protocol.c b/hardware/serial-dmm/protocol.c index 52efecb3..04d0dc69 100644 --- a/hardware/serial-dmm/protocol.c +++ b/hardware/serial-dmm/protocol.c @@ -222,4 +222,5 @@ RECEIVE_DATA(RADIOSHACK_22_805, metex14) RECEIVE_DATA(RADIOSHACK_22_812, rs9lcd) RECEIVE_DATA(VOLTCRAFT_VC820_SER, fs9721) RECEIVE_DATA(VOLTCRAFT_VC840_SER, fs9721) +RECEIVE_DATA(UNI_T_UT61D_SER, fs9922) RECEIVE_DATA(UNI_T_UT61E_SER, es51922) diff --git a/hardware/serial-dmm/protocol.h b/hardware/serial-dmm/protocol.h index f15eef32..aff12c27 100644 --- a/hardware/serial-dmm/protocol.h +++ b/hardware/serial-dmm/protocol.h @@ -45,10 +45,11 @@ enum { RADIOSHACK_22_812, VOLTCRAFT_VC820_SER, VOLTCRAFT_VC840_SER, + UNI_T_UT61D_SER, UNI_T_UT61E_SER, }; -#define DMM_COUNT 15 +#define DMM_COUNT 16 struct dmm_info { char *vendor; @@ -104,6 +105,7 @@ SR_PRIV int receive_data_RADIOSHACK_22_805(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_SER(int fd, int revents, void *cb_data); SR_PRIV int receive_data_VOLTCRAFT_VC840_SER(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_UNI_T_UT61D_SER(int fd, int revents, void *cb_data); SR_PRIV int receive_data_UNI_T_UT61E_SER(int fd, int revents, void *cb_data); SR_PRIV void dmm_details_tp4000zc(struct sr_datafeed_analog *analog, void *info); diff --git a/hwdriver.c b/hwdriver.c index c0381432..07957345 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -160,6 +160,7 @@ extern SR_PRIV struct sr_dev_driver radioshack_22_805_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; +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 @@ -242,6 +243,7 @@ static struct sr_dev_driver *drivers_list[] = { &radioshack_22_812_driver_info, &voltcraft_vc820_ser_driver_info, &voltcraft_vc840_ser_driver_info, + &uni_t_ut61d_ser_driver_info, &uni_t_ut61e_ser_driver_info, #endif #ifdef HAVE_HW_UNI_T_DMM