SR_CONF_LOGIC_ANALYZER,
SR_CONF_SAMPLERATE,
SR_CONF_LIMIT_SAMPLES,
- SR_CONF_TRIGGER_TYPE,
+ SR_CONF_TRIGGER_MATCH,
SR_CONF_CAPTURE_RATIO,
};
+static const int32_t trigger_matches[] = {
+ SR_TRIGGER_RISING,
+ SR_TRIGGER_FALLING,
+ SR_TRIGGER_EDGE,
+};
+
SR_PRIV const uint64_t sl2_samplerates[NUM_SAMPLERATES] = {
SR_KHZ(1.25),
SR_KHZ(10),
SR_MHZ(20),
};
-static const char *channel_names[NUM_PROBES + 1] = {
+static const char *channel_names[NUM_CHANNELS + 1] = {
"0", "1", "2", "3",
NULL,
};
sdi->conn = usb;
for (i = 0; channel_names[i]; i++) {
- ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE,
+ ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
channel_names[i]);
sdi->channels = g_slist_append(sdi->channels, ch);
devc->channels[i] = ch;
g_variant_builder_add(&gvb, "{sv}", "samplerates", gvar);
*data = g_variant_builder_end(&gvb);
break;
- case SR_CONF_TRIGGER_TYPE:
- *data = g_variant_new_string(TRIGGER_TYPES);
+ case SR_CONF_TRIGGER_MATCH:
+ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+ trigger_matches, ARRAY_SIZE(trigger_matches),
+ sizeof(int32_t));
break;
case SR_CONF_LIMIT_SAMPLES:
grange[0] = g_variant_new_uint64(0);
* The trigger must be configured first because the calculation of the
* pre and post trigger samples depends on a configured trigger.
*/
- sl2_configure_trigger(sdi);
+ sl2_convert_trigger(sdi);
sl2_calculate_trigger_samples(sdi);
trigger_bytes = devc->pre_trigger_bytes + devc->post_trigger_bytes;
* Count the number of enabled channels and number them for a sequential
* access.
*/
- for (i = 0, j = 0; i < NUM_PROBES; i++) {
+ for (i = 0, j = 0; i < NUM_CHANNELS; i++) {
if (devc->channels[i]->enabled) {
devc->num_enabled_channels++;
devc->channel_map[j] = i;