]> sigrok.org Git - libsigrok.git/commitdiff
dslogic: Implement acquisition with external clock.
authorDiego Asanza <redacted>
Wed, 4 May 2016 17:50:42 +0000 (19:50 +0200)
committerUwe Hermann <redacted>
Mon, 16 May 2016 16:18:58 +0000 (18:18 +0200)
DSLogic hardware provides an external clock input.
This commit adds support for this capability.

Signed-off-by: Diego Asanza <redacted>
src/hardware/fx2lafw/api.c
src/hardware/fx2lafw/protocol.h

index 2eb5ac7ce3c6861d2b1ff79d74e76d4e6e1998a3..ffb1cf1ed14b8d8d40eb4909807fcaeae7f7aa0c 100644 (file)
@@ -142,6 +142,7 @@ static const uint32_t dslogic_devopts[] = {
        SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
        SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
        SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
+       SR_CONF_EXTERNAL_CLOCK | SR_CONF_GET | SR_CONF_SET,
 };
 
 static const int32_t soft_trigger_matches[] = {
@@ -567,6 +568,9 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
        case SR_CONF_CAPTURE_RATIO:
                *data = g_variant_new_uint64(devc->capture_ratio);
                break;
+       case SR_CONF_EXTERNAL_CLOCK:
+               *data = g_variant_new_boolean(devc->dslogic_external_clock);
+               break;
        default:
                return SR_ERR_NA;
        }
@@ -632,6 +636,9 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
                        ret = dslogic_fpga_firmware_upload(sdi, DSLOGIC_PRO_FPGA_FIRMWARE);
                }
                break;
+       case SR_CONF_EXTERNAL_CLOCK:
+               devc->dslogic_external_clock = g_variant_get_boolean(data);
+               break;
        default:
                ret = SR_ERR_NA;
        }
index 955045a60c0f3423d3997fb16a6259aad9290443..a02c697f9c2708660428377464a06ed6f134f5d2 100644 (file)
@@ -135,7 +135,7 @@ struct dev_context {
        gboolean dslogic;
        uint16_t dslogic_mode;
        uint32_t trigger_pos;
-       int dslogic_external_clock;
+       gboolean dslogic_external_clock;
        int dslogic_voltage_threshold;
 };