]> sigrok.org Git - libsigrok.git/blobdiff - hwdriver.c
input/vcd: Remove debug output from inner loops.
[libsigrok.git] / hwdriver.c
index 55358ebf3953a86c7a6476dcb33041b940dd7a12..3dd44db0aa182c7f46236bb510c443be184e3cbc 100644 (file)
@@ -62,7 +62,7 @@ static struct sr_config_info sr_config_info_data[] = {
                "Swap channel order", NULL},
        {SR_CONF_RLE, SR_T_BOOL, "rle",
                "Run Length Encoding", NULL},
-       {SR_CONF_TRIGGER_SLOPE, SR_T_UINT64, "triggerslope",
+       {SR_CONF_TRIGGER_SLOPE, SR_T_CHAR, "triggerslope",
                "Trigger slope", NULL},
        {SR_CONF_TRIGGER_SOURCE, SR_T_CHAR, "triggersource",
                "Trigger source", NULL},
@@ -118,6 +118,8 @@ static struct sr_config_info sr_config_info_data[] = {
                "Over-current protection", NULL},
        {SR_CONF_LIMIT_SAMPLES, SR_T_UINT64, "limit_samples",
                "Sample limit", NULL},
+       {SR_CONF_CLOCK_EDGE, SR_T_CHAR, "clock_edge",
+               "Clock edge", NULL},
        {0, 0, NULL, NULL, NULL},
 };
 
@@ -633,6 +635,27 @@ SR_API int sr_config_set(const struct sr_dev_inst *sdi,
        return ret;
 }
 
+/**
+ * Apply configuration settings to the device hardware.
+ *
+ * @param sdi The device instance.
+ *
+ * @return SR_OK upon success or SR_ERR in case of error.
+ */
+SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
+{
+       int ret;
+
+       if (!sdi || !sdi->driver)
+               ret = SR_ERR;
+       else if (!sdi->driver->config_commit)
+               ret = SR_OK;
+       else
+               ret = sdi->driver->config_commit(sdi);
+
+       return ret;
+}
+
 /**
  * List all possible values for a configuration key.
  *