+/*--- dmm/bm25x.c -----------------------------------------------------------*/
+
+#define BRYMEN_BM25X_PACKET_SIZE 15
+
+/* Dummy info struct. The parser does not use it. */
+struct bm25x_info { int dummy; };
+
+SR_PRIV gboolean sr_brymen_bm25x_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_brymen_bm25x_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- dmm/bm52x.c -----------------------------------------------------------*/
+
+#define BRYMEN_BM52X_PACKET_SIZE 24
+#define BRYMEN_BM52X_DISPLAY_COUNT 2
+
+struct brymen_bm52x_info { size_t ch_idx; };
+
+#ifdef HAVE_SERIAL_COMM
+SR_PRIV int sr_brymen_bm52x_packet_request(struct sr_serial_dev_inst *serial);
+SR_PRIV int sr_brymen_bm82x_packet_request(struct sr_serial_dev_inst *serial);
+#endif
+SR_PRIV gboolean sr_brymen_bm52x_packet_valid(const uint8_t *buf);
+SR_PRIV gboolean sr_brymen_bm82x_packet_valid(const uint8_t *buf);
+/* BM520s and BM820s protocols are similar, the parse routine is shared. */
+SR_PRIV int sr_brymen_bm52x_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+struct brymen_bm52x_state;
+
+SR_PRIV void *brymen_bm52x_state_init(void);
+SR_PRIV void brymen_bm52x_state_free(void *state);
+SR_PRIV int brymen_bm52x_config_get(void *state, uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
+SR_PRIV int brymen_bm52x_config_set(void *state, uint32_t key, GVariant *data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
+SR_PRIV int brymen_bm52x_config_list(void *state, uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
+SR_PRIV int brymen_bm52x_acquire_start(void *state,
+ const struct sr_dev_inst *sdi,
+ sr_receive_data_callback *cb, void **cb_data);
+
+/*--- dmm/bm85x.c -----------------------------------------------------------*/
+
+#define BRYMEN_BM85x_PACKET_SIZE_MIN 4
+
+struct brymen_bm85x_info { int dummy; };
+
+#ifdef HAVE_SERIAL_COMM
+SR_PRIV int brymen_bm85x_after_open(struct sr_serial_dev_inst *serial);
+SR_PRIV int brymen_bm85x_packet_request(struct sr_serial_dev_inst *serial);
+#endif
+SR_PRIV gboolean brymen_bm85x_packet_valid(void *state,
+ const uint8_t *buf, size_t len, size_t *pkt_len);
+SR_PRIV int brymen_bm85x_parse(void *state, const uint8_t *buf, size_t len,
+ double *floatval, struct sr_datafeed_analog *analog, void *info);
+
+/*--- dmm/bm86x.c -----------------------------------------------------------*/
+
+#define BRYMEN_BM86X_PACKET_SIZE 24
+#define BRYMEN_BM86X_DISPLAY_COUNT 2
+
+struct brymen_bm86x_info { size_t ch_idx; };
+
+#ifdef HAVE_SERIAL_COMM
+SR_PRIV int sr_brymen_bm86x_packet_request(struct sr_serial_dev_inst *serial);
+#endif
+SR_PRIV gboolean sr_brymen_bm86x_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_brymen_bm86x_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- dmm/ut71x.c -----------------------------------------------------------*/
+
+#define UT71X_PACKET_SIZE 11
+
+struct ut71x_info {
+ gboolean is_voltage, is_resistance, is_capacitance, is_temperature;
+ gboolean is_celsius, is_fahrenheit, is_current, is_continuity;
+ gboolean is_diode, is_frequency, is_duty_cycle, is_dc, is_ac;
+ gboolean is_auto, is_manual, is_sign, is_power, is_loop_current;
+};
+
+SR_PRIV gboolean sr_ut71x_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_ut71x_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- dmm/vc870.c -----------------------------------------------------------*/
+
+#define VC870_PACKET_SIZE 23
+
+struct vc870_info {
+ gboolean is_voltage, is_dc, is_ac, is_temperature, is_resistance;
+ gboolean is_continuity, is_capacitance, is_diode, is_loop_current;
+ gboolean is_current, is_micro, is_milli, is_power;
+ gboolean is_power_factor_freq, is_power_apparent_power, is_v_a_rms_value;
+ gboolean is_sign2, is_sign1, is_batt, is_ol1, is_max, is_min;
+ gboolean is_maxmin, is_rel, is_ol2, is_open, is_manu, is_hold;
+ gboolean is_light, is_usb, is_warning, is_auto_power, is_misplug_warn;
+ gboolean is_lo, is_hi, is_open2;
+
+ gboolean is_frequency, is_dual_display, is_auto;
+};
+
+SR_PRIV gboolean sr_vc870_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_vc870_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- dmm/vc96.c ------------------------------------------------------------*/
+
+#define VC96_PACKET_SIZE 13
+
+struct vc96_info {
+ size_t ch_idx;
+ gboolean is_ac, is_dc, is_resistance, is_diode, is_ampere, is_volt;
+ gboolean is_ohm, is_micro, is_milli, is_kilo, is_mega, is_hfe;
+ gboolean is_unitless;
+};
+
+SR_PRIV gboolean sr_vc96_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_vc96_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- lcr/es51919.c ---------------------------------------------------------*/
+
+/* Acquisition details which apply to all supported serial-lcr devices. */
+struct lcr_parse_info {
+ size_t ch_idx;
+ uint64_t output_freq;
+ const char *circuit_model;
+};
+
+#define ES51919_PACKET_SIZE 17
+#define ES51919_CHANNEL_COUNT 2
+#define ES51919_COMM_PARAM "9600/8n1/rts=1/dtr=1"
+
+SR_PRIV int es51919_config_get(uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
+SR_PRIV int es51919_config_set(uint32_t key, GVariant *data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
+SR_PRIV int es51919_config_list(uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
+SR_PRIV gboolean es51919_packet_valid(const uint8_t *pkt);
+SR_PRIV int es51919_packet_parse(const uint8_t *pkt, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- lcr/vc4080.c ----------------------------------------------------------*/
+
+/* Note: Also uses 'struct lcr_parse_info' from es51919 above. */
+
+#define VC4080_PACKET_SIZE 39
+#define VC4080_COMM_PARAM "1200/8n1"
+#define VC4080_WITH_DQ_CHANS 0 /* Enable separate D/Q channels? */
+
+enum vc4080_display {
+ VC4080_DISPLAY_PRIMARY,
+ VC4080_DISPLAY_SECONDARY,
+#if VC4080_WITH_DQ_CHANS
+ VC4080_DISPLAY_D_VALUE,
+ VC4080_DISPLAY_Q_VALUE,
+#endif
+ VC4080_CHANNEL_COUNT,
+};
+
+extern SR_PRIV const char *vc4080_channel_formats[VC4080_CHANNEL_COUNT];
+
+SR_PRIV int vc4080_config_list(uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg);
+SR_PRIV int vc4080_packet_request(struct sr_serial_dev_inst *serial);
+SR_PRIV gboolean vc4080_packet_valid(const uint8_t *pkt);
+SR_PRIV int vc4080_packet_parse(const uint8_t *pkt, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- dmm/ut372.c -----------------------------------------------------------*/
+
+#define UT372_PACKET_SIZE 27
+
+struct ut372_info {
+ int dummy;
+};
+
+SR_PRIV gboolean sr_ut372_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- dmm/asycii.c ----------------------------------------------------------*/
+
+#define ASYCII_PACKET_SIZE 16
+
+struct asycii_info {
+ gboolean is_ac, is_dc, is_ac_and_dc;
+ gboolean is_resistance, is_capacitance, is_diode, is_gain;
+ gboolean is_frequency, is_duty_cycle, is_duty_pos, is_duty_neg;
+ gboolean is_pulse_width, is_period_pos, is_period_neg;
+ gboolean is_pulse_count, is_count_pos, is_count_neg;
+ gboolean is_ampere, is_volt, is_volt_ampere, is_farad, is_ohm;
+ gboolean is_hertz, is_percent, is_seconds, is_decibel;
+ gboolean is_pico, is_nano, is_micro, is_milli, is_kilo, is_mega;
+ gboolean is_unitless;
+ gboolean is_peak_min, is_peak_max;
+ gboolean is_invalid;
+};
+
+#ifdef HAVE_SERIAL_COMM
+SR_PRIV int sr_asycii_packet_request(struct sr_serial_dev_inst *serial);
+#endif
+SR_PRIV gboolean sr_asycii_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_asycii_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- dmm/eev121gw.c --------------------------------------------------------*/
+
+#define EEV121GW_PACKET_SIZE 19
+
+enum eev121gw_display {
+ EEV121GW_DISPLAY_MAIN,
+ EEV121GW_DISPLAY_SUB,
+ EEV121GW_DISPLAY_BAR,
+ EEV121GW_DISPLAY_COUNT,
+};
+
+struct eev121gw_info {
+ /* Selected channel. */
+ size_t ch_idx;
+ /*
+ * Measured value, number and sign/overflow flags, scale factor
+ * and significant digits.
+ */
+ uint32_t uint_value;
+ gboolean is_ofl, is_neg;
+ int factor, digits;
+ /* Currently active mode (meter's function). */
+ gboolean is_ac, is_dc, is_voltage, is_current, is_power, is_gain;
+ gboolean is_resistance, is_capacitance, is_diode, is_temperature;
+ gboolean is_continuity, is_frequency, is_period, is_duty_cycle;
+ /* Quantities associated with mode/function. */
+ gboolean is_ampere, is_volt, is_volt_ampere, is_dbm;
+ gboolean is_ohm, is_farad, is_celsius, is_fahrenheit;
+ gboolean is_hertz, is_seconds, is_percent, is_loop_current;
+ gboolean is_unitless, is_logic;
+ /* Other indicators. */
+ gboolean is_min, is_max, is_avg, is_1ms_peak, is_rel, is_hold;
+ gboolean is_low_pass, is_mem, is_bt, is_auto_range, is_test;
+ gboolean is_auto_poweroff, is_low_batt;
+};
+
+extern SR_PRIV const char *eev121gw_channel_formats[];
+SR_PRIV gboolean sr_eev121gw_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_eev121gw_3displays_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- scale/kern.c ----------------------------------------------------------*/
+
+struct kern_info {
+ gboolean is_gram, is_carat, is_ounce, is_pound, is_troy_ounce;
+ gboolean is_pennyweight, is_grain, is_tael, is_momme, is_tola;
+ gboolean is_percentage, is_piece, is_unstable, is_stable, is_error;
+ int buflen;
+};
+
+SR_PRIV gboolean sr_kern_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_kern_parse(const uint8_t *buf, float *floatval,
+ struct sr_datafeed_analog *analog, void *info);
+
+/*--- sw_limits.c -----------------------------------------------------------*/
+
+struct sr_sw_limits {
+ uint64_t limit_samples;
+ uint64_t limit_frames;
+ uint64_t limit_msec;
+ uint64_t samples_read;
+ uint64_t frames_read;
+ uint64_t start_time;
+};
+
+SR_PRIV int sr_sw_limits_config_get(const struct sr_sw_limits *limits, uint32_t key,
+ GVariant **data);
+SR_PRIV int sr_sw_limits_config_set(struct sr_sw_limits *limits, uint32_t key,
+ GVariant *data);
+SR_PRIV void sr_sw_limits_acquisition_start(struct sr_sw_limits *limits);
+SR_PRIV gboolean sr_sw_limits_check(struct sr_sw_limits *limits);
+SR_PRIV int sr_sw_limits_get_remain(const struct sr_sw_limits *limits,
+ uint64_t *samples, uint64_t *frames, uint64_t *msecs,
+ gboolean *exceeded);
+SR_PRIV void sr_sw_limits_update_samples_read(struct sr_sw_limits *limits,
+ uint64_t samples_read);
+SR_PRIV void sr_sw_limits_update_frames_read(struct sr_sw_limits *limits,
+ uint64_t frames_read);
+SR_PRIV void sr_sw_limits_init(struct sr_sw_limits *limits);
+
+/*--- feed_queue.h ----------------------------------------------------------*/
+
+struct feed_queue_logic;
+struct feed_queue_analog;
+
+SR_API struct feed_queue_logic *feed_queue_logic_alloc(
+ const struct sr_dev_inst *sdi,
+ size_t sample_count, size_t unit_size);
+SR_API int feed_queue_logic_submit(struct feed_queue_logic *q,
+ const uint8_t *data, size_t count);
+SR_API int feed_queue_logic_flush(struct feed_queue_logic *q);
+SR_API int feed_queue_logic_send_trigger(struct feed_queue_logic *q);
+SR_API void feed_queue_logic_free(struct feed_queue_logic *q);
+
+SR_API struct feed_queue_analog *feed_queue_analog_alloc(
+ const struct sr_dev_inst *sdi,
+ size_t sample_count, int digits, struct sr_channel *ch);
+SR_API int feed_queue_analog_mq_unit(struct feed_queue_analog *q,
+ enum sr_mq mq, enum sr_mqflag mq_flag, enum sr_unit unit);
+SR_API int feed_queue_analog_scale_offset(struct feed_queue_analog *q,
+ const struct sr_rational *scale, const struct sr_rational *offset);
+SR_API int feed_queue_analog_submit(struct feed_queue_analog *q,
+ float data, size_t count);
+SR_API int feed_queue_analog_flush(struct feed_queue_analog *q);
+SR_API void feed_queue_analog_free(struct feed_queue_analog *q);
+