SR_CONF_BUFFERSIZE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_NUM_VDIV | SR_CONF_GET,
+ SR_CONF_TRIGGER_LEVEL | SR_CONF_GET | SR_CONF_SET,
};
static const uint32_t devopts_cg[] = {
devc = sdi->priv;
if (!cg) {
switch (key) {
+ case SR_CONF_TRIGGER_LEVEL:
+ *data = g_variant_new_double(devc->voffset_trigger);
+ break;
case SR_CONF_CONN:
if (!sdi->conn)
return SR_ERR_ARG;
struct dev_context *devc;
int rat;
int ch_idx, idx;
+ float flt;
devc = sdi->priv;
if (!cg) {
case SR_CONF_LIMIT_FRAMES:
devc->limit_frames = g_variant_get_uint64(data);
break;
+ case SR_CONF_TRIGGER_LEVEL:
+ flt = g_variant_get_double(data);
+ if (flt < 0.0 || flt > 1.0) {
+ sr_err("Trigger level must be in [0.0,1.0].");
+ return SR_ERR_ARG;
+ }
+
+ devc->voffset_trigger = flt;
+ if (dso_set_voffsets(sdi) != SR_OK) {
+ return SR_ERR;
+ }
+ break;
case SR_CONF_TRIGGER_SLOPE:
if ((idx = std_str_idx(data, ARRAY_AND_SIZE(trigger_slopes))) < 0)
return SR_ERR_ARG;
return SR_OK;
}
-static int dso_set_voffsets(const struct sr_dev_inst *sdi)
+int dso_set_voffsets(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
struct sr_usb_dev_inst *usb;
SR_PRIV int dso_get_channeldata(const struct sr_dev_inst *sdi,
libusb_transfer_cb_fn cb);
SR_PRIV int dso_set_trigger_samplerate(const struct sr_dev_inst *sdi);
+SR_PRIV int dso_set_voffsets(const struct sr_dev_inst *sdi);
#endif