]> sigrok.org Git - libsigrok.git/commitdiff
ols: add swap channels feature
authorMatt Ranostay <redacted>
Wed, 28 Aug 2013 04:19:56 +0000 (21:19 -0700)
committerBert Vermeulen <redacted>
Wed, 28 Aug 2013 08:21:59 +0000 (10:21 +0200)
Allow channel groups to be swapped. This is useful
for demux at 200mhz with the unbuffered channels.

Signed-off-by: Matt Ranostay <redacted>
hardware/openbench-logic-sniffer/api.c
hardware/openbench-logic-sniffer/protocol.h
hwdriver.c
libsigrok.h

index 77082257454e4dac3c059d20341cb94ae8b34750..f738dce49479c594bfd21d781fc99ac0d80706ca 100644 (file)
@@ -34,6 +34,7 @@ static const int32_t hwcaps[] = {
        SR_CONF_LIMIT_SAMPLES,
        SR_CONF_EXTERNAL_CLOCK,
        SR_CONF_PATTERN_MODE,
+       SR_CONF_SWAP,
        SR_CONF_RLE,
 };
 
@@ -325,6 +326,17 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
                        ret = SR_ERR;
                }
                break;
+       case SR_CONF_SWAP:
+               if (g_variant_get_boolean(data)) {
+                       sr_info("Enabling channel swapping.");
+                       devc->flag_reg |= FLAG_SWAP_PROBES;
+               } else {
+                       sr_info("Disabling channel swapping.");
+                       devc->flag_reg &= ~FLAG_SWAP_PROBES;
+               }
+               ret = SR_OK;
+               break;
+
        case SR_CONF_RLE:
                if (g_variant_get_boolean(data)) {
                        sr_info("Enabling RLE.");
index a721c50b731220e8cf15a24cb92d0a3166c04645..402c6246c56b7b861674db90a58e207999be5a17 100644 (file)
@@ -75,6 +75,7 @@
 #define FLAG_CLOCK_EXTERNAL        0x40
 #define FLAG_CLOCK_INVERTED        0x80
 #define FLAG_RLE                   0x0100
+#define FLAG_SWAP_PROBES           0x0200
 #define FLAG_EXTERNAL_TEST_MODE    0x0400
 #define FLAG_INTERNAL_TEST_MODE    0x0800
 
index c5a78476e6392f83b738b792bf30a662390adb8c..61cf5928b7c6bf1c9b38fc1fe3960baf78e3f7e6 100644 (file)
@@ -65,6 +65,8 @@ static struct sr_config_info sr_config_info_data[] = {
                "Trigger types", NULL},
        {SR_CONF_EXTERNAL_CLOCK, SR_T_BOOL, "external_clock",
                "External clock mode", NULL},
+       {SR_CONF_SWAP, SR_T_BOOL, "swap",
+               "Swap channel order", NULL},
        {SR_CONF_RLE, SR_T_BOOL, "rle",
                "Run Length Encoding", NULL},
        {SR_CONF_TRIGGER_SLOPE, SR_T_UINT64, "triggerslope",
index b8f4f757019d45c6be16c957c2e0f83e2e0e4a2d..cfaec89bb1e027e64586f77bd9d747dcd54d280c 100644 (file)
@@ -631,6 +631,11 @@ enum {
        /** The devices supports using a external clock. */
        SR_CONF_EXTERNAL_CLOCK,
 
+       /** The device supports swapping channels. Typical this is between
+        *  buffered and unbuffered channels.
+        */
+       SR_CONF_SWAP,
+
        /** The device supports Run Length Encoding. */
        SR_CONF_RLE,