]> sigrok.org Git - libsigrok.git/blobdiff - libsigrok.h
input: feed the filename to the module's init() function
[libsigrok.git] / libsigrok.h
index 63b2a6087cc26c511f93ea681ad5e08c9d53a955..b6d2b64046ebbda6f2a438a91ea5bf5fea2c1854 100644 (file)
@@ -286,6 +286,7 @@ struct sr_datafeed_logic {
 };
 
 struct sr_datafeed_analog {
+       /** The probes for which data is included in this packet. */
        GSList *probes;
        int num_samples;
        /** Measured quantity (voltage, current, temperature, and so on). */
@@ -294,7 +295,8 @@ struct sr_datafeed_analog {
        int unit;
        /** Bitmap with extra information about the MQ. */
        uint64_t mqflags;
-       /** The analog value. */
+       /** The analog value(s). The data is interleaved according to
+        * the probes list. */
        float *data;
 };
 
@@ -309,7 +311,7 @@ struct sr_input_format {
        char *id;
        char *description;
        int (*format_match) (const char *filename);
-       int (*init) (struct sr_input *in);
+       int (*init) (struct sr_input *in, const char *filename);
        int (*loadfile) (struct sr_input *in, const char *filename);
 };
 
@@ -388,7 +390,7 @@ enum {
        /** The device can measure humidity. */
        SR_CONF_HYGROMETER,
 
-       /*--- Driver options ------------------------------------------------*/
+       /*--- Driver scan options -------------------------------------------*/
 
        /**
         * Specification on how to connect to a device.
@@ -461,20 +463,26 @@ enum {
        /** Coupling. */
        SR_CONF_COUPLING,
 
+       /** Trigger types.  */
+       SR_CONF_TRIGGER_TYPE,
+
        /*--- Special stuff -------------------------------------------------*/
 
+       /** Scan options supported by the driver. */
+       SR_CONF_SCAN_OPTIONS = 40000,
+
+       /** Device options for a particular device. */
+       SR_CONF_DEVICE_OPTIONS,
+
        /** Session filename. */
-       SR_CONF_SESSIONFILE = 40000,
+       SR_CONF_SESSIONFILE,
 
-       /* TODO: Better description. */
        /** The device supports specifying a capturefile to inject. */
        SR_CONF_CAPTUREFILE,
 
-       /* TODO: Better description. */
        /** The device supports specifying the capturefile unit size. */
        SR_CONF_CAPTURE_UNITSIZE,
 
-       /* TODO: Better description. */
        /** The device supports setting the number of probes. */
        SR_CONF_CAPTURE_NUM_PROBES,
 
@@ -540,39 +548,6 @@ enum {
        SR_ST_STOPPING,
 };
 
-/*
- * TODO: This sucks, you just kinda have to "know" the returned type.
- * TODO: Need a DI to return the number of trigger stages supported.
- */
-
-/** Device info IDs. */
-enum {
-       /** A list of options supported by the driver. */
-       SR_DI_HWOPTS = 10000,
-       /** A list of capabilities supported by the device. */
-       SR_DI_HWCAPS,
-       /** Samplerates supported by this device (struct sr_samplerates). */
-       SR_DI_SAMPLERATES,
-       /** Types of logic trigger supported, out of "01crf" (char *). */
-       SR_DI_TRIGGER_TYPES,
-       /** The currently set samplerate in Hz (uint64_t). */
-       SR_DI_CUR_SAMPLERATE,
-       /** Supported patterns (in pattern generator mode). */
-       SR_DI_PATTERNS,
-       /** Supported buffer sizes. */
-       SR_DI_BUFFERSIZES,
-       /** Supported time bases. */
-       SR_DI_TIMEBASES,
-       /** Supported trigger sources. */
-       SR_DI_TRIGGER_SOURCES,
-       /** Supported filter targets. */
-       SR_DI_FILTERS,
-       /** Valid volts/div values. */
-       SR_DI_VDIVS,
-       /** Coupling options. */
-       SR_DI_COUPLING,
-};
-
 /*
  * A device supports either a range of samplerates with steps of a given
  * granularity, or is limited to a set of defined samplerates. Use either
@@ -595,14 +570,16 @@ struct sr_dev_driver {
        GSList *(*scan) (GSList *options);
        GSList *(*dev_list) (void);
        int (*dev_clear) (void);
+       int (*config_get) (int id, const void **value,
+                       const struct sr_dev_inst *sdi);
+       int (*config_set) (int id, const void *value,
+                       const struct sr_dev_inst *sdi);
+       int (*config_list) (int info_id, const void **data,
+                       const struct sr_dev_inst *sdi);
 
        /* Device-specific */
        int (*dev_open) (struct sr_dev_inst *sdi);
        int (*dev_close) (struct sr_dev_inst *sdi);
-       int (*info_get) (int info_id, const void **data,
-                       const struct sr_dev_inst *sdi);
-       int (*dev_config_set) (const struct sr_dev_inst *sdi, int hwcap,
-                       const void *value);
        int (*dev_acquisition_start) (const struct sr_dev_inst *sdi,
                        void *cb_data);
        int (*dev_acquisition_stop) (struct sr_dev_inst *sdi,