]> sigrok.org Git - libsigrok.git/blobdiff - libsigrok.h
Deprecate SR_DI_CUR_SAMPLERATE.
[libsigrok.git] / libsigrok.h
index 825591d62b78c2b4c95aea754c3a9d82fcc4cf62..d8b90f989e97ba9cf349c2d41b840ea1d989ede6 100644 (file)
@@ -125,7 +125,7 @@ enum {
 
 typedef int (*sr_receive_data_callback_t)(int fd, int revents, void *cb_data);
 
-/** Data types used by hardware drivers for dev_config_set(). */
+/** Data types used by sr_config_info(). */
 enum {
        SR_T_UINT64 = 10000,
        SR_T_CHAR,
@@ -279,22 +279,14 @@ struct sr_datafeed_meta {
        GSList *config;
 };
 
-struct sr_datafeed_meta_logic {
-       int num_probes;
-       uint64_t samplerate;
-};
-
 struct sr_datafeed_logic {
        uint64_t length;
        uint16_t unitsize;
        void *data;
 };
 
-struct sr_datafeed_meta_analog {
-       int num_probes;
-};
-
 struct sr_datafeed_analog {
+       GSList *probes;
        int num_samples;
        /** Measured quantity (voltage, current, temperature, and so on). */
        int mq;
@@ -333,9 +325,11 @@ struct sr_output_format {
        char *description;
        int df_type;
        int (*init) (struct sr_output *o);
+       /* Obsolete, use recv() instead. */
        int (*data) (struct sr_output *o, const uint8_t *data_in,
                     uint64_t length_in, uint8_t **data_out,
                     uint64_t *length_out);
+       /* Obsolete, use recv() instead. */
        int (*event) (struct sr_output *o, int event_type, uint8_t **data_out,
                      uint64_t *length_out);
        GString *(*recv) (struct sr_output *o, const struct sr_dev_inst *sdi,
@@ -343,27 +337,13 @@ struct sr_output_format {
        int (*cleanup) (struct sr_output *o);
 };
 
-/*
- * This represents a generic device connected to the system.
- * For device-specific information, ask the driver. The driver_index refers
- * to the device index within that driver; it may be handling more than one
- * device. All relevant driver calls take a dev_index parameter for this.
- */
-struct sr_dev {
-       /** Which driver handles this device. */
-       struct sr_dev_driver *driver;
-       /** A driver may handle multiple devices of the same type. */
-       int driver_index;
-       /** List of struct sr_probe pointers. */
-       GSList *probes;
-};
-
 enum {
        SR_PROBE_LOGIC = 10000,
        SR_PROBE_ANALOG,
 };
 
 struct sr_probe {
+       /* The index field will go: use g_slist_length(sdi->probes) instead. */
        int index;
        int type;
        gboolean enabled;
@@ -571,12 +551,8 @@ enum {
        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. */
@@ -615,14 +591,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,