X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fserial-dmm%2Fprotocol.h;h=51cdc0435d04bb30cb46787ec4d0059e5ba1dcc7;hb=fb8d593cfea094dd50d74873c8c00445eb0a040f;hp=af457fa2b21d65aa360ce40714b1e5e50f3fe5eb;hpb=d4bd66a0c7196fb44f6f22036e3ea452ad5870df;p=libsigrok.git diff --git a/hardware/serial-dmm/protocol.h b/hardware/serial-dmm/protocol.h index af457fa2..51cdc043 100644 --- a/hardware/serial-dmm/protocol.h +++ b/hardware/serial-dmm/protocol.h @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrok project. * * Copyright (C) 2012 Alexandru Gagniuc * @@ -20,14 +20,14 @@ #ifndef LIBSIGROK_HARDWARE_SERIAL_DMM_PROTOCOL_H #define LIBSIGROK_HARDWARE_SERIAL_DMM_PROTOCOL_H -/* Message logging helpers with driver-specific prefix string. */ -#define DRIVER_LOG_DOMAIN "serial-dmm: " -#define sr_log(l, s, args...) sr_log(l, DRIVER_LOG_DOMAIN s, ## args) -#define sr_spew(s, args...) sr_spew(DRIVER_LOG_DOMAIN s, ## args) -#define sr_dbg(s, args...) sr_dbg(DRIVER_LOG_DOMAIN s, ## args) -#define sr_info(s, args...) sr_info(DRIVER_LOG_DOMAIN s, ## args) -#define sr_warn(s, args...) sr_warn(DRIVER_LOG_DOMAIN s, ## args) -#define sr_err(s, args...) sr_err(DRIVER_LOG_DOMAIN s, ## args) +/* Message logging helpers with subsystem-specific prefix string. */ +#define LOG_PREFIX "serial-dmm: " +#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) +#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) +#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) +#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) +#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) +#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) /* Note: When adding entries here, don't forget to update DMM_COUNT. */ enum { @@ -40,9 +40,20 @@ enum { METEX_M3640D, PEAKTECH_4370, PCE_PCE_DM32, + RADIOSHACK_22_168, + RADIOSHACK_22_805, + RADIOSHACK_22_812, + TECPEL_DMM_8060_SER, + TECPEL_DMM_8061_SER, + VOLTCRAFT_M3650D, + VOLTCRAFT_VC820_SER, + VOLTCRAFT_VC830_SER, + VOLTCRAFT_VC840_SER, + UNI_T_UT61D_SER, + UNI_T_UT61E_SER, }; -#define DMM_COUNT 9 +#define DMM_COUNT 20 struct dmm_info { char *vendor; @@ -55,9 +66,11 @@ struct dmm_info { int (*packet_parse)(const uint8_t *, float *, struct sr_datafeed_analog *, void *); void (*dmm_details)(struct sr_datafeed_analog *, void *); + struct sr_dev_driver *di; + int (*receive_data)(int, int, void *); }; -SR_PRIV struct dmm_info dmms[DMM_COUNT]; +extern SR_PRIV struct dmm_info dmms[DMM_COUNT]; #define DMM_BUFSIZE 256 @@ -66,28 +79,42 @@ struct dev_context { /** The current sampling limit (in number of samples). */ uint64_t limit_samples; + /** The time limit (in milliseconds). */ + uint64_t limit_msec; + /** Opaque pointer passed in by the frontend. */ void *cb_data; /** The current number of already received samples. */ uint64_t num_samples; - struct sr_serial_dev_inst *serial; + int64_t starttime; uint8_t buf[DMM_BUFSIZE]; int bufoffset; int buflen; }; -SR_PRIV int digitek_dt4000zc_receive_data(int fd, int revents, void *cb_data); -SR_PRIV int tekpower_tp4000zc_receive_data(int fd, int revents, void *cb_data); -SR_PRIV int metex_me31_receive_data(int fd, int revents, void *cb_data); -SR_PRIV int peaktech_3410_receive_data(int fd, int revents, void *cb_data); -SR_PRIV int mastech_mas345_receive_data(int fd, int revents, void *cb_data); -SR_PRIV int va_va18b_receive_data(int fd, int revents, void *cb_data); -SR_PRIV int metex_m3640d_receive_data(int fd, int revents, void *cb_data); -SR_PRIV int peaktech_4370_receive_data(int fd, int revents, void *cb_data); -SR_PRIV int pce_pce_dm32_receive_data(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_DIGITEK_DT4000ZC(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_TEKPOWER_TP4000ZC(int fd, int revents, void *cb_data); +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_METEX_M3640D(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_PEAKTECH_4370(int fd, int revents, void *cb_data); +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_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_TECPEL_DMM_8060_SER(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_TECPEL_DMM_8061_SER(int fd, int revents, void *cb_data); +SR_PRIV int receive_data_VOLTCRAFT_M3650D(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_VC830_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); SR_PRIV void dmm_details_dt4000zc(struct sr_datafeed_analog *analog, void *info);