From: Uwe Hermann Date: Wed, 26 Dec 2012 00:53:50 +0000 (+0100) Subject: serial-dmm: Add UNI-T UT61E support (UT-D02 cable). X-Git-Tag: dsupstream~382 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=986fde755d6bec3dfbf6d2bf4768ca359fc05174;p=libsigrok.git serial-dmm: Add UNI-T UT61E support (UT-D02 cable). --- diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index bb13110c..aa86f3b5 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -61,6 +61,7 @@ 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 sr_dev_driver uni_t_ut61e_ser_driver_info; SR_PRIV struct dmm_info dmms[] = { { @@ -156,6 +157,13 @@ SR_PRIV struct dmm_info dmms[] = { &voltcraft_vc840_ser_driver_info, receive_data_VOLTCRAFT_VC840_SER, }, + { + /* Note: ES51922 baudrate is actually 19230! */ + "UNI-T", "UT61E (UT-D02 cable)", "19200/7o1/rts=0/dtr=1", + 19200, ES51922_PACKET_SIZE, NULL, + sr_es51922_packet_valid, sr_es51922_parse, NULL, + &uni_t_ut61e_ser_driver_info, receive_data_UNI_T_UT61E_SER, + }, }; /* Properly close and free all devices. */ @@ -555,3 +563,4 @@ DRV(radioshack_22_168, RADIOSHACK_22_168, "radioshack-22-168", "RadioShack 22-16 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_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 90c43c69..15ddc74d 100644 --- a/hardware/serial-dmm/protocol.c +++ b/hardware/serial-dmm/protocol.c @@ -215,3 +215,4 @@ RECEIVE_DATA(RADIOSHACK_22_168, metex14) RECEIVE_DATA(RADIOSHACK_22_812, rs9lcd) RECEIVE_DATA(VOLTCRAFT_VC820_SER, fs9721) RECEIVE_DATA(VOLTCRAFT_VC840_SER, fs9721) +RECEIVE_DATA(UNI_T_UT61E_SER, es51922) diff --git a/hardware/serial-dmm/protocol.h b/hardware/serial-dmm/protocol.h index a15469ec..51ad9c48 100644 --- a/hardware/serial-dmm/protocol.h +++ b/hardware/serial-dmm/protocol.h @@ -44,9 +44,10 @@ enum { RADIOSHACK_22_812, VOLTCRAFT_VC820_SER, VOLTCRAFT_VC840_SER, + UNI_T_UT61E_SER, }; -#define DMM_COUNT 13 +#define DMM_COUNT 14 struct dmm_info { char *vendor; @@ -103,6 +104,7 @@ 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_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_UT61E_SER(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 455f02aa..bee5c022 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -130,6 +130,7 @@ 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; +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; @@ -200,6 +201,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_ut61e_ser_driver_info, #endif #ifdef HAVE_HW_UNI_T_DMM &uni_t_ut61d_driver_info,