#include "protocol.h"
#define DEFAULT_NUM_LOGIC_CHANNELS 8
-#define DEFAULT_NUM_ANALOG_CHANNELS 4
+#define DEFAULT_LOGIC_PATTERN PATTERN_SIGROK
+#define DEFAULT_NUM_ANALOG_CHANNELS 4
#define DEFAULT_ANALOG_AMPLITUDE 10
+/* Note: No spaces allowed because of sigrok-cli. */
static const char *logic_pattern_str[] = {
"sigrok",
"random",
"incremental",
+ "walking-one",
+ "walking-zero",
"all-low",
"all-high",
+ "squid",
};
static const uint32_t drvopts[] = {
devc->cur_samplerate = SR_KHZ(200);
devc->num_logic_channels = num_logic_channels;
devc->logic_unitsize = (devc->num_logic_channels + 7) / 8;
- devc->logic_pattern = PATTERN_SIGROK;
+ devc->logic_pattern = DEFAULT_LOGIC_PATTERN;
devc->num_analog_channels = num_analog_channels;
if (num_logic_channels > 0) {
}
/* Analog channels, channel groups and pattern generators. */
+ devc->ch_ag = g_hash_table_new(g_direct_hash, g_direct_equal);
if (num_analog_channels > 0) {
pattern = 0;
/* An "Analog" channel group with all analog channels in it. */
acg->name = g_strdup("Analog");
sdi->channel_groups = g_slist_append(sdi->channel_groups, acg);
- devc->ch_ag = g_hash_table_new(g_direct_hash, g_direct_equal);
for (i = 0; i < num_analog_channels; i++) {
snprintf(channel_name, 16, "A%d", i);
ch = sr_channel_new(sdi, i + num_logic_channels, SR_CHANNEL_ANALOG,
/* Every channel gets a generator struct. */
ag = g_malloc(sizeof(struct analog_gen));
+ ag->ch = ch;
ag->amplitude = DEFAULT_ANALOG_AMPLITUDE;
sr_analog_init(&ag->packet, &ag->encoding, &ag->meaning, &ag->spec, 2);
ag->packet.meaning->channels = cg->channels;
/* We use this timestamp to decide how many more samples to send. */
devc->start_us = g_get_monotonic_time();
devc->spent_us = 0;
+ devc->step = 0;
return SR_OK;
}