]> sigrok.org Git - libsigrok.git/commitdiff
ols: add external clock support
authorMatt Ranostay <redacted>
Sun, 25 Aug 2013 05:01:15 +0000 (22:01 -0700)
committerBert Vermeulen <redacted>
Mon, 26 Aug 2013 08:28:45 +0000 (10:28 +0200)
Add external clock support that allows you to use the tracing
targets bus clock line for sampling.

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

index 0000b42dd9e9983a8c1d98da4ef8ba7daf2e7c8a..87e430806af78d60c96f461a2384978c0ee479a2 100644 (file)
@@ -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;
index 65c8c2583b4bb6c540f3ffb7fe3f6f12be21f5d2..c5a78476e6392f83b738b792bf30a662390adb8c 100644 (file)
@@ -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",
index a93a07ea3a4745218ce74c167117f254d3df75a8..b8f4f757019d45c6be16c957c2e0f83e2e0e4a2d 100644 (file)
@@ -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,