]> sigrok.org Git - libsigrok.git/commitdiff
Add config keys for setting the number of analog probes.
authorBert Vermeulen <redacted>
Sun, 22 Dec 2013 23:01:59 +0000 (00:01 +0100)
committerBert Vermeulen <redacted>
Sun, 29 Dec 2013 09:58:56 +0000 (10:58 +0100)
This is primarily of use in the demo driver, but this patch also
takes in the logic probe setting config key used only by the
session driver so far.

hwdriver.c
libsigrok.h
session_driver.c
session_file.c

index 83582ad2310abeb7c3bf9210a6cca41fc7ebf231..b1d94ccd10609090e537e25fd15655fdecc4227d 100644 (file)
@@ -96,6 +96,10 @@ static struct sr_config_info sr_config_info_data[] = {
                "Power off", NULL},
        {SR_CONF_DATA_SOURCE, SR_T_CHAR, "data_source",
                "Data source", NULL},
+       {SR_CONF_NUM_LOGIC_PROBES, SR_T_INT32, "logic_probes",
+               "Number of logic probes", NULL},
+       {SR_CONF_NUM_ANALOG_PROBES, SR_T_INT32, "analog_probes",
+               "Number of analog probes", NULL},
        {0, 0, NULL, NULL, NULL},
 };
 
index caa13757c32a9923976524a840c19cf64e025f1e..a301132090965f2a9f89a08318440566118cdfab 100644 (file)
@@ -145,6 +145,7 @@ enum {
        SR_T_KEYVALUE,
        SR_T_UINT64_RANGE,
        SR_T_DOUBLE_RANGE,
+       SR_T_INT32,
 };
 
 /** Value for sr_datafeed_packet.type. */
@@ -785,7 +786,7 @@ enum {
        /** Logic low-high threshold range. */
        SR_CONF_VOLTAGE_THRESHOLD,
 
-       /** The device supports using a external clock. */
+       /** The device supports using an external clock. */
        SR_CONF_EXTERNAL_CLOCK,
 
        /**
@@ -794,11 +795,17 @@ enum {
         */
        SR_CONF_SWAP,
 
-        /** Center frequency.
-         * The input signal is downmixed by this frequency before the ADC
-         * anti-aliasing filter.
-         */
-        SR_CONF_CENTER_FREQUENCY,
+       /** Center frequency.
+        * The input signal is downmixed by this frequency before the ADC
+        * anti-aliasing filter.
+        */
+       SR_CONF_CENTER_FREQUENCY,
+
+       /** The device supports setting the number of logic probes. */
+       SR_CONF_NUM_LOGIC_PROBES,
+
+       /** The device supports setting the number of analog probes. */
+       SR_CONF_NUM_ANALOG_PROBES,
 
        /*--- Special stuff -------------------------------------------------*/
 
@@ -817,9 +824,6 @@ enum {
        /** The device supports specifying the capturefile unit size. */
        SR_CONF_CAPTURE_UNITSIZE,
 
-       /** The device supports setting the number of probes. */
-       SR_CONF_CAPTURE_NUM_PROBES,
-
        /** Power off the device. */
        SR_CONF_POWER_OFF,
 
index b023cbc0fc8401449cca2024249ee00d8200c01f..2b6bfbbeda9a9c0ce9e297c1da5cec802163f851 100644 (file)
@@ -244,7 +244,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        case SR_CONF_CAPTURE_UNITSIZE:
                vdev->unitsize = g_variant_get_uint64(data);
                break;
-       case SR_CONF_CAPTURE_NUM_PROBES:
+       case SR_CONF_NUM_LOGIC_PROBES:
                vdev->num_probes = g_variant_get_uint64(data);
                break;
        default:
index 27e540955ba5d499a5a7d5ee0fd5ef7ec42fe5ce..6c794545de28b74ef8f4699a15b62675988e778b 100644 (file)
@@ -181,7 +181,7 @@ SR_API int sr_session_load(const char *filename)
                                                        g_variant_new_uint64(tmp_u64), sdi, NULL);
                                } else if (!strcmp(keys[j], "total probes")) {
                                        total_probes = strtoull(val, NULL, 10);
-                                       sdi->driver->config_set(SR_CONF_CAPTURE_NUM_PROBES,
+                                       sdi->driver->config_set(SR_CONF_NUM_LOGIC_PROBES,
                                                        g_variant_new_uint64(total_probes), sdi, NULL);
                                        for (p = 0; p < total_probes; p++) {
                                                snprintf(probename, SR_MAX_PROBENAME_LEN, "%" PRIu64, p);