From: Matt Ranostay Date: Sun, 25 Aug 2013 05:01:15 +0000 (-0700) Subject: ols: add external clock support X-Git-Tag: libsigrok-0.2.2~78 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eb1b610b1281bd83cb4dbd02b2eccdf4888bb093;p=libsigrok.git ols: add external clock support Add external clock support that allows you to use the tracing targets bus clock line for sampling. Signed-off-by: Matt Ranostay --- diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 0000b42d..87e43080 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -32,6 +32,7 @@ static const int32_t hwcaps[] = { SR_CONF_TRIGGER_TYPE, SR_CONF_CAPTURE_RATIO, SR_CONF_LIMIT_SAMPLES, + SR_CONF_EXTERNAL_CLOCK, SR_CONF_PATTERN_MODE, SR_CONF_RLE, }; @@ -301,6 +302,16 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi) } else ret = SR_OK; break; + case SR_CONF_EXTERNAL_CLOCK: + if (g_variant_get_boolean(data)) { + sr_info("Enabling external clock."); + devc->flag_reg |= FLAG_CLOCK_EXTERNAL; + } else { + sr_info("Disabled external clock."); + devc->flag_reg &= ~FLAG_CLOCK_EXTERNAL; + } + ret = SR_OK; + break; case SR_CONF_PATTERN_MODE: stropt = g_variant_get_string(data, NULL); ret = SR_OK; diff --git a/hwdriver.c b/hwdriver.c index 65c8c258..c5a78476 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -63,6 +63,8 @@ static struct sr_config_info sr_config_info_data[] = { "Pattern generator mode", NULL}, {SR_CONF_TRIGGER_TYPE, SR_T_CHAR, "triggertype", "Trigger types", NULL}, + {SR_CONF_EXTERNAL_CLOCK, SR_T_BOOL, "external_clock", + "External clock mode", 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 a93a07ea..b8f4f757 100644 --- a/libsigrok.h +++ b/libsigrok.h @@ -628,6 +628,9 @@ enum { /** The device supports setting a pattern (pattern generator mode). */ SR_CONF_PATTERN_MODE, + /** The devices supports using a external clock. */ + SR_CONF_EXTERNAL_CLOCK, + /** The device supports Run Length Encoding. */ SR_CONF_RLE,