From: Uwe Hermann Date: Mon, 6 Jan 2014 16:20:35 +0000 (+0100) Subject: Add support for the Tenma 72-7750 (UNI-T UT60G rebadge). X-Git-Tag: libsigrok-0.3.0~333 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=d9e79c512289201a76e55435c09d7d7e68a1cf1b Add support for the Tenma 72-7750 (UNI-T UT60G rebadge). --- diff --git a/README.devices b/README.devices index ca4439b9..70706be1 100644 --- a/README.devices +++ b/README.devices @@ -295,6 +295,7 @@ a short list for convenience: - PCE PCE-DM32: Briefly press the "RS232" button. - RadioShack 22-812: Press and hold "SELECT" and "RANGE" together. - TekPower TP4000ZC: Briefly press the "RS232" button. + - Tenma 72-7750: Briefly press the "RS232C" button. - UNI-T UT60G: Briefly press the "RS232C" button. - UNI-T UT61B/C/D: Press the "REL/RS232/USB" button for roughly 1 second. - UNI-T UT325: Briefly press the "SEND" button (as per manual). However, it diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index ea1ba90a..7fa7aa2a 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -70,6 +70,7 @@ SR_PRIV struct sr_dev_driver uni_t_ut61c_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 sr_dev_driver iso_tech_idm103n_driver_info; +SR_PRIV struct sr_dev_driver tenma_72_7750_ser_driver_info; SR_PRIV struct dmm_info dmms[] = { { @@ -283,6 +284,14 @@ SR_PRIV struct dmm_info dmms[] = { sr_es519xx_2400_11b_packet_valid, sr_es519xx_2400_11b_parse, NULL, &iso_tech_idm103n_driver_info, receive_data_ISO_TECH_IDM103N, }, + { + /* Note: ES51986 baudrate is actually 19230! */ + "Tenma", "72-7750 (UT-D02 cable)", "19200/7o1/rts=0/dtr=1", + 19200, ES519XX_11B_PACKET_SIZE, NULL, + sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse, + NULL, + &tenma_72_7750_ser_driver_info, receive_data_TENMA_72_7750_SER, + }, }; static int dev_clear(int dmm) @@ -591,3 +600,4 @@ DRV(uni_t_ut61c_ser, UNI_T_UT61C_SER, "uni-t-ut61c-ser", "UNI-T UT61C (UT-D02 ca 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)") DRV(iso_tech_idm103n, ISO_TECH_IDM103N, "iso-tech-idm103n", "ISO-TECH IDM103N") +DRV(tenma_72_7750_ser, TENMA_72_7750_SER, "tenma-72-7750-ser", "Tenma 72-7750 (UT-D02 cable)") diff --git a/hardware/serial-dmm/protocol.c b/hardware/serial-dmm/protocol.c index efb687aa..69727e10 100644 --- a/hardware/serial-dmm/protocol.c +++ b/hardware/serial-dmm/protocol.c @@ -189,3 +189,4 @@ RECEIVE_DATA(UNI_T_UT61C_SER, fs9922) RECEIVE_DATA(UNI_T_UT61D_SER, fs9922) RECEIVE_DATA(UNI_T_UT61E_SER, es519xx) RECEIVE_DATA(ISO_TECH_IDM103N, es519xx) +RECEIVE_DATA(TENMA_72_7750_SER, es519xx) diff --git a/hardware/serial-dmm/protocol.h b/hardware/serial-dmm/protocol.h index 569aedcc..28211d32 100644 --- a/hardware/serial-dmm/protocol.h +++ b/hardware/serial-dmm/protocol.h @@ -53,9 +53,10 @@ enum { UNI_T_UT61D_SER, UNI_T_UT61E_SER, ISO_TECH_IDM103N, + TENMA_72_7750_SER, }; -#define DMM_COUNT 29 +#define DMM_COUNT 30 struct dmm_info { /** Manufacturer/brand. */ @@ -137,5 +138,6 @@ SR_PRIV int receive_data_UNI_T_UT61C_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 int receive_data_ISO_TECH_IDM103N(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_TENMA_72_7750_SER(int fd, int revents, void *cb_data); #endif diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index 99c026a9..1eccfdc5 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -49,6 +49,7 @@ SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc830_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc840_driver_info; SR_PRIV struct sr_dev_driver tenma_72_7745_driver_info; +SR_PRIV struct sr_dev_driver tenma_72_7750_driver_info; SR_PRIV struct dmm_info udmms[] = { { @@ -73,15 +74,7 @@ SR_PRIV struct dmm_info udmms[] = { &uni_t_ut60e_driver_info, receive_data_UNI_T_UT60E, }, { - /* - * Important: The actual baudrate of the Cyrustek ES51986 chip - * used in this DMM is 19230. However, the WCH CH9325 chip - * (UART to USB/HID) used in (some versions of) the UNI-T - * UT-D04 cable doesn't support 19230 baud. It only supports - * 19200, and setting an unsupported baudrate will result in - * the default of 2400 being used (which will not work with - * this DMM, of course). - */ + /* The baudrate is actually 19230, see "Note 1" below. */ "UNI-T", "UT60G", 19200, ES519XX_11B_PACKET_SIZE, sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse, @@ -110,15 +103,7 @@ SR_PRIV struct dmm_info udmms[] = { &uni_t_ut61d_driver_info, receive_data_UNI_T_UT61D, }, { - /* - * Important: The actual baudrate of the Cyrustek ES51922 chip - * used in this DMM is 19230. However, the WCH CH9325 chip - * (UART to USB/HID) used in (some versions of) the UNI-T - * UT-D04 cable doesn't support 19230 baud. It only supports - * 19200, and setting an unsupported baudrate will result in - * the default of 2400 being used (which will not work with - * this DMM, of course). - */ + /* The baudrate is actually 19230, see "Note 1" below. */ "UNI-T", "UT61E", 19200, ES519XX_14B_PACKET_SIZE, sr_es519xx_19200_14b_packet_valid, sr_es519xx_19200_14b_parse, @@ -156,12 +141,26 @@ SR_PRIV struct dmm_info udmms[] = { FS9721_PACKET_SIZE, sr_fs9721_packet_valid, sr_fs9721_parse, sr_fs9721_00_temp_c, - &tenma_72_7745_driver_info, - /* This is a basic rebadge of the UT60E. */ - receive_data_UNI_T_UT60E, + &tenma_72_7745_driver_info, receive_data_TENMA_72_7745, + }, + { + /* The baudrate is actually 19230, see "Note 1" below. */ + "Tenma", "72-7750", 19200, + ES519XX_11B_PACKET_SIZE, + sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse, + NULL, + &tenma_72_7750_driver_info, receive_data_TENMA_72_7750, }, }; +/* + * Note 1: The actual baudrate of the Cyrustek ES519xx chip used in this DMM + * is 19230. However, the WCH CH9325 chip (UART to USB/HID) used in (some + * versions of) the UNI-T UT-D04 cable doesn't support 19230 baud. It only + * supports 19200, and setting an unsupported baudrate will result in the + * default of 2400 being used (which will not work with this DMM, of course). + */ + static int dev_clear(int dmm) { return std_dev_clear(udmms[dmm].di, NULL); @@ -425,3 +424,4 @@ DRV(voltcraft_vc820, VOLTCRAFT_VC820, "voltcraft-vc820", "Voltcraft VC-820") DRV(voltcraft_vc830, VOLTCRAFT_VC830, "voltcraft-vc830", "Voltcraft VC-830") DRV(voltcraft_vc840, VOLTCRAFT_VC840, "voltcraft-vc840", "Voltcraft VC-840") DRV(tenma_72_7745, TENMA_72_7745, "tenma-72-7745", "Tenma 72-7745") +DRV(tenma_72_7750, TENMA_72_7750, "tenma-72-7750", "Tenma 72-7750") diff --git a/hardware/uni-t-dmm/protocol.c b/hardware/uni-t-dmm/protocol.c index 5b9c57bb..5843d5e7 100644 --- a/hardware/uni-t-dmm/protocol.c +++ b/hardware/uni-t-dmm/protocol.c @@ -311,3 +311,5 @@ RECEIVE_DATA(UNI_T_UT61E, es519xx) RECEIVE_DATA(VOLTCRAFT_VC820, fs9721) RECEIVE_DATA(VOLTCRAFT_VC830, fs9922) RECEIVE_DATA(VOLTCRAFT_VC840, fs9721) +RECEIVE_DATA(TENMA_72_7745, es519xx) +RECEIVE_DATA(TENMA_72_7750, es519xx) diff --git a/hardware/uni-t-dmm/protocol.h b/hardware/uni-t-dmm/protocol.h index 1fa1830b..08fb5373 100644 --- a/hardware/uni-t-dmm/protocol.h +++ b/hardware/uni-t-dmm/protocol.h @@ -42,6 +42,7 @@ enum { VOLTCRAFT_VC830, VOLTCRAFT_VC840, TENMA_72_7745, + TENMA_72_7750, }; struct dmm_info { @@ -95,5 +96,7 @@ 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_VC830(int fd, int revents, void *cb_data); SR_PRIV int receive_data_VOLTCRAFT_VC840(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_TENMA_72_7745(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_TENMA_72_7750(int fd, int revents, void *cb_data); #endif diff --git a/hwdriver.c b/hwdriver.c index 6ff5ebc5..300bfe66 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -226,6 +226,7 @@ extern SR_PRIV struct sr_dev_driver uni_t_ut61c_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; extern SR_PRIV struct sr_dev_driver iso_tech_idm103n_driver_info; +extern SR_PRIV struct sr_dev_driver tenma_72_7750_ser_driver_info; #endif #ifdef HAVE_HW_UNI_T_DMM extern SR_PRIV struct sr_dev_driver tecpel_dmm_8061_driver_info; @@ -240,6 +241,7 @@ extern SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info; extern SR_PRIV struct sr_dev_driver voltcraft_vc830_driver_info; extern SR_PRIV struct sr_dev_driver voltcraft_vc840_driver_info; extern SR_PRIV struct sr_dev_driver tenma_72_7745_driver_info; +extern SR_PRIV struct sr_dev_driver tenma_72_7750_driver_info; #endif /** @endcond */ @@ -366,6 +368,8 @@ static struct sr_dev_driver *drivers_list[] = { &uni_t_ut61d_ser_driver_info, &uni_t_ut61e_ser_driver_info, &iso_tech_idm103n_driver_info, + &tenma_72_7745_ser_driver_info, + &tenma_72_7750_ser_driver_info, #endif #ifdef HAVE_HW_UNI_T_DMM &tecpel_dmm_8061_driver_info, @@ -380,6 +384,7 @@ static struct sr_dev_driver *drivers_list[] = { &voltcraft_vc830_driver_info, &voltcraft_vc840_driver_info, &tenma_72_7745_driver_info, + &tenma_72_7750_driver_info, #endif NULL, };