X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=libsigrok-internal.h;h=b8b2adc0a7df9fc20bc22baff66a88c29f7479e1;hb=82b904b173f1443c4d6bdebdf1a7f0dda01c4982;hp=0b92a488bfa43b43bd0cfc94b11e5582572b50b6;hpb=9871215c83f70a2008272de03268291445ed59c3;p=libsigrok.git diff --git a/libsigrok-internal.h b/libsigrok-internal.h index 0b92a488..b8b2adc0 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -1,7 +1,7 @@ /* * This file is part of the sigrok project. * - * Copyright (C) 2010-2012 Bert Vermeulen + * Copyright (C) 2013 Bert Vermeulen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,9 +48,6 @@ #define g_match_info_unref g_match_info_free #endif -/* Size of a datastore chunk in units */ -#define DATASTORE_CHUNKSIZE (512 * 1024) - struct sr_context { #ifdef HAVE_LIBUSB_1_0 libusb_context *libusb_ctx; @@ -76,6 +73,7 @@ struct sr_serial_dev_inst { /* Private driver context. */ struct drv_context { + struct sr_context *sr_ctx; GSList *instances; }; @@ -102,6 +100,7 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi); /* USB-specific instances */ SR_PRIV struct sr_usb_dev_inst *sr_usb_dev_inst_new(uint8_t bus, uint8_t address, struct libusb_device_handle *hdl); +SR_PRIV GSList *sr_usb_find_usbtmc(libusb_context *usb_ctx); SR_PRIV void sr_usb_dev_inst_free(struct sr_usb_dev_inst *usb); #endif @@ -114,6 +113,8 @@ SR_PRIV void sr_serial_dev_inst_free(struct sr_serial_dev_inst *serial); /*--- hwdriver.c ------------------------------------------------------------*/ SR_PRIV void sr_hw_cleanup_all(void); +SR_PRIV struct sr_config *sr_config_new(int key, GVariant *data); +SR_PRIV void sr_config_free(struct sr_config *src); SR_PRIV int sr_source_remove(int fd); SR_PRIV int sr_source_add(int fd, int events, int timeout, sr_receive_data_callback_t cb, void *cb_data); @@ -121,7 +122,19 @@ SR_PRIV int sr_source_add(int fd, int events, int timeout, /*--- session.c -------------------------------------------------------------*/ SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi, - struct sr_datafeed_packet *packet); + const struct sr_datafeed_packet *packet); + +/*--- std.c -----------------------------------------------------------------*/ + +typedef int (*dev_close_t)(struct sr_dev_inst *sdi); + +SR_PRIV int std_hw_init(struct sr_context *sr_ctx, struct sr_dev_driver *di, + const char *prefix); +SR_PRIV int std_hw_dev_acquisition_stop_serial(struct sr_dev_inst *sdi, + void *cb_data, dev_close_t hw_dev_close_fn, + struct sr_serial_dev_inst *serial, const char *prefix); +SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi, + const char *prefix); /*--- hardware/common/serial.c ----------------------------------------------*/ @@ -164,10 +177,27 @@ SR_PRIV int ezusb_upload_firmware(libusb_device *dev, int configuration, /*--- hardware/common/usb.c -------------------------------------------------*/ #ifdef HAVE_LIBUSB_1_0 -SR_PRIV GSList *sr_usb_connect(libusb_context *usb_ctx, const char *conn); +SR_PRIV GSList *sr_usb_find(libusb_context *usb_ctx, const char *conn); SR_PRIV int sr_usb_open(libusb_context *usb_ctx, struct sr_usb_dev_inst *usb); #endif +/*--- hardware/common/dmm/es51922.c -----------------------------------------*/ + +#define ES51922_PACKET_SIZE 14 + +struct es51922_info { + gboolean is_judge, is_vbar, is_voltage, is_auto, is_micro, is_current; + gboolean is_milli, is_resistance, is_continuity, is_diode, is_lpf; + gboolean is_frequency, is_duty_cycle, is_capacitance, is_temperature; + gboolean is_celsius, is_fahrenheit, is_adp, is_sign, is_batt, is_ol; + gboolean is_max, is_min, is_rel, is_rmr, is_ul, is_pmax, is_pmin; + gboolean is_dc, is_ac, is_vahz, is_hold, is_nano, is_kilo, is_mega; +}; + +SR_PRIV gboolean sr_es51922_packet_valid(const uint8_t *buf); +SR_PRIV int sr_es51922_parse(const uint8_t *buf, float *floatval, + struct sr_datafeed_analog *analog, void *info); + /*--- hardware/common/dmm/fs9922.c ------------------------------------------*/ SR_PRIV int sr_dmm_parse_fs9922(const uint8_t *buf, float *floatval, @@ -205,4 +235,15 @@ SR_PRIV gboolean sr_metex14_packet_valid(const uint8_t *buf); SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval, struct sr_datafeed_analog *analog, void *info); +/*--- hardware/common/dmm/rs9lcd.c ------------------------------------------*/ + +#define RS9LCD_PACKET_SIZE 9 + +/* Dummy info struct. The parser does not use it. */ +struct rs9lcd_info { int dummy; }; + +SR_PRIV gboolean sr_rs9lcd_packet_valid(const uint8_t *buf); +SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval, + struct sr_datafeed_analog *analog, void *info); + #endif