From: Uwe Hermann Date: Thu, 2 Jan 2014 00:34:21 +0000 (+0100) Subject: Add initial support for the V&A VA40B multimeter. X-Git-Tag: libsigrok-0.3.0~351 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d327972b9720b4c69b3aaca895416121757806e0;p=libsigrok.git Add initial support for the V&A VA40B multimeter. --- diff --git a/hardware/common/dmm/fs9721.c b/hardware/common/dmm/fs9721.c index 9b195d0b..85de0074 100644 --- a/hardware/common/dmm/fs9721.c +++ b/hardware/common/dmm/fs9721.c @@ -421,3 +421,25 @@ SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *i analog->unit = SR_UNIT_CELSIUS; } } + +SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog *analog, void *info) +{ + struct fs9721_info *info_local; + + info_local = (struct fs9721_info *)info; + + /* User-defined FS9721_LP3 flag 'c2c1_00' means MAX. */ + if (info_local->is_c2c1_00) + analog->mqflags |= SR_MQFLAG_MAX; + + /* User-defined FS9721_LP3 flag 'c2c1_01' means temperature (C). */ + if (info_local->is_c2c1_01) { + analog->mq = SR_MQ_TEMPERATURE; + analog->unit = SR_UNIT_CELSIUS; + } + + /* User-defined FS9721_LP3 flag 'c2c1_11' means MIN. */ + if (info_local->is_c2c1_11) + analog->mqflags |= SR_MQFLAG_MIN; + +} diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index b433c063..7091222f 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -48,6 +48,7 @@ SR_PRIV struct sr_dev_driver metex_me31_driver_info; SR_PRIV struct sr_dev_driver peaktech_3410_driver_info; SR_PRIV struct sr_dev_driver mastech_mas345_driver_info; SR_PRIV struct sr_dev_driver va_va18b_driver_info; +SR_PRIV struct sr_dev_driver va_va40b_driver_info; SR_PRIV struct sr_dev_driver metex_m3640d_driver_info; SR_PRIV struct sr_dev_driver metex_m4650cr_driver_info; SR_PRIV struct sr_dev_driver peaktech_4370_driver_info; @@ -119,6 +120,13 @@ SR_PRIV struct dmm_info dmms[] = { sr_fs9721_01_temp_c, &va_va18b_driver_info, receive_data_VA_VA18B, }, + { + "V&A", "VA40B", "2400/8n1", 2400, + FS9721_PACKET_SIZE, NULL, + sr_fs9721_packet_valid, sr_fs9721_parse, + sr_fs9721_max_c_min, + &va_va40b_driver_info, receive_data_VA_VA40B, + }, { "Metex", "M-3640D", "1200/7n2/rts=0/dtr=1", 1200, METEX14_PACKET_SIZE, sr_metex14_packet_request, @@ -552,6 +560,7 @@ DRV(metex_me31, METEX_ME31, "metex-me31", "Metex ME-31") DRV(peaktech_3410, PEAKTECH_3410, "peaktech-3410", "PeakTech 3410") DRV(mastech_mas345, MASTECH_MAS345, "mastech-mas345", "MASTECH MAS345") DRV(va_va18b, VA_VA18B, "va-va18b", "V&A VA18B") +DRV(va_va40b, VA_VA40B, "va-va40b", "V&A VA40B") DRV(metex_m3640d, METEX_M3640D, "metex-m3640d", "Metex M-3640D") DRV(metex_m4650cr, METEX_M4650CR, "metex-m4650cr", "Metex M-4650CR") DRV(peaktech_4370, PEAKTECH_4370, "peaktech-4370", "PeakTech 4370") diff --git a/hardware/serial-dmm/protocol.c b/hardware/serial-dmm/protocol.c index 71ebf0dc..8a1db9fb 100644 --- a/hardware/serial-dmm/protocol.c +++ b/hardware/serial-dmm/protocol.c @@ -167,6 +167,7 @@ RECEIVE_DATA(METEX_ME31, metex14) RECEIVE_DATA(PEAKTECH_3410, metex14) RECEIVE_DATA(MASTECH_MAS345, metex14) RECEIVE_DATA(VA_VA18B, fs9721) +RECEIVE_DATA(VA_VA40B, fs9721) RECEIVE_DATA(METEX_M3640D, metex14) RECEIVE_DATA(METEX_M4650CR, metex14) RECEIVE_DATA(PEAKTECH_4370, metex14) diff --git a/hardware/serial-dmm/protocol.h b/hardware/serial-dmm/protocol.h index 653101ce..eccd0f7a 100644 --- a/hardware/serial-dmm/protocol.h +++ b/hardware/serial-dmm/protocol.h @@ -31,6 +31,7 @@ enum { PEAKTECH_3410, MASTECH_MAS345, VA_VA18B, + VA_VA40B, METEX_M3640D, METEX_M4650CR, PEAKTECH_4370, @@ -53,7 +54,7 @@ enum { ISO_TECH_IDM103N, }; -#define DMM_COUNT 27 +#define DMM_COUNT 28 struct dmm_info { /** Manufacturer/brand. */ @@ -113,6 +114,7 @@ SR_PRIV int receive_data_METEX_ME31(int fd, int revents, void *cb_data); SR_PRIV int receive_data_PEAKTECH_3410(int fd, int revents, void *cb_data); SR_PRIV int receive_data_MASTECH_MAS345(int fd, int revents, void *cb_data); SR_PRIV int receive_data_VA_VA18B(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_VA_VA40B(int fd, int revents, void *cb_data); SR_PRIV int receive_data_METEX_M3640D(int fd, int revents, void *cb_data); SR_PRIV int receive_data_METEX_M4650CR(int fd, int revents, void *cb_data); SR_PRIV int receive_data_PEAKTECH_4370(int fd, int revents, void *cb_data); @@ -137,6 +139,7 @@ SR_PRIV int receive_data_ISO_TECH_IDM103N(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); SR_PRIV void dmm_details_va18b(struct sr_datafeed_analog *analog, void *info); +SR_PRIV void dmm_details_va40b(struct sr_datafeed_analog *analog, void *info); SR_PRIV void dmm_details_pce_dm32(struct sr_datafeed_analog *analog, void *info); #endif diff --git a/hwdriver.c b/hwdriver.c index bbba4411..3b9df923 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -204,6 +204,7 @@ extern SR_PRIV struct sr_dev_driver metex_me31_driver_info; extern SR_PRIV struct sr_dev_driver peaktech_3410_driver_info; extern SR_PRIV struct sr_dev_driver mastech_mas345_driver_info; extern SR_PRIV struct sr_dev_driver va_va18b_driver_info; +extern SR_PRIV struct sr_dev_driver va_va40b_driver_info; extern SR_PRIV struct sr_dev_driver metex_m3640d_driver_info; extern SR_PRIV struct sr_dev_driver metex_m4650cr_driver_info; extern SR_PRIV struct sr_dev_driver peaktech_4370_driver_info; @@ -341,6 +342,7 @@ static struct sr_dev_driver *drivers_list[] = { &peaktech_3410_driver_info, &mastech_mas345_driver_info, &va_va18b_driver_info, + &va_va40b_driver_info, &metex_m3640d_driver_info, &metex_m4650cr_driver_info, &peaktech_4370_driver_info, diff --git a/libsigrok-internal.h b/libsigrok-internal.h index 722441b3..2577fd0d 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -514,6 +514,7 @@ SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog *analog, void *info); SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog *analog, void *info); SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog *analog, void *info); SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *info); +SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog *analog, void *info); /*--- hardware/common/dmm/m2110.c -----------------------------------------*/