From: Matt Ranostay Date: Wed, 28 Aug 2013 04:19:56 +0000 (-0700) Subject: ols: add swap channels feature X-Git-Tag: libsigrok-0.2.2~74 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7b0a57fd1c1d1b658864b81df2357849ccc4715c;p=libsigrok.git ols: add swap channels feature Allow channel groups to be swapped. This is useful for demux at 200mhz with the unbuffered channels. Signed-off-by: Matt Ranostay --- diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 77082257..f738dce4 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -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."); diff --git a/hardware/openbench-logic-sniffer/protocol.h b/hardware/openbench-logic-sniffer/protocol.h index a721c50b..402c6246 100644 --- a/hardware/openbench-logic-sniffer/protocol.h +++ b/hardware/openbench-logic-sniffer/protocol.h @@ -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 diff --git a/hwdriver.c b/hwdriver.c index c5a78476..61cf5928 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -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", diff --git a/libsigrok.h b/libsigrok.h index b8f4f757..cfaec89b 100644 --- a/libsigrok.h +++ b/libsigrok.h @@ -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,