SR_TRIGGER_EDGE,
};
-/* Channels are numbered 0-13 */
-SR_PRIV const char *beaglelogic_channel_names[NUM_CHANNELS + 1] = {
- "P8_45", "P8_46", "P8_43", "P8_44", "P8_41", "P8_42", "P8_39", "P8_40",
- "P8_27", "P8_29", "P8_28", "P8_30", "P8_21", "P8_20", NULL,
+SR_PRIV const char *channel_names[] = {
+ "P8_45", "P8_46", "P8_43", "P8_44", "P8_41", "P8_42", "P8_39",
+ "P8_40", "P8_27", "P8_29", "P8_28", "P8_30", "P8_21", "P8_20",
};
/* Possible sample rates : 10 Hz to 100 MHz = (100 / x) MHz */
/* Fill the channels */
for (i = 0; i < maxch; i++)
sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
- beaglelogic_channel_names[i]);
+ channel_names[i]);
sdi->priv = devc;
drvc->instances = g_slist_append(drvc->instances, sdi);
const struct sr_channel_group *cg)
{
struct dev_context *devc = sdi->priv;
+
(void)cg;
switch (key) {
case SR_CONF_LIMIT_SAMPLES:
*data = g_variant_new_uint64(devc->limit_samples);
break;
-
case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate);
break;
-
case SR_CONF_CAPTURE_RATIO:
*data = g_variant_new_uint64(devc->capture_ratio);
break;
-
case SR_CONF_NUM_LOGIC_CHANNELS:
*data = g_variant_new_uint32(g_slist_length(sdi->channels));
break;
-
default:
return SR_ERR_NA;
}
{
struct dev_context *devc = sdi->priv;
uint64_t tmp_u64;
+
(void)cg;
if (sdi->status != SR_ST_ACTIVE)
case SR_CONF_SAMPLERATE:
devc->cur_samplerate = g_variant_get_uint64(data);
return beaglelogic_set_samplerate(devc);
-
case SR_CONF_LIMIT_SAMPLES:
tmp_u64 = g_variant_get_uint64(data);
devc->limit_samples = tmp_u64;
(SAMPLEUNIT_TO_BYTES(devc->sampleunit) * 1000000));
}
return beaglelogic_set_triggerflags(devc);
-
case SR_CONF_CAPTURE_RATIO:
devc->capture_ratio = g_variant_get_uint64(data);
if (devc->capture_ratio > 100) {
return SR_ERR;
}
return SR_OK;
-
default:
return SR_ERR_NA;
}
GVariantBuilder gvb;
(void)sdi;
- (void)data;
(void)cg;
ret = SR_OK;