22 #include "libsigrok-internal.h"
25 #define LOG_PREFIX "trigger"
60 trig->
name = g_strdup(name);
82 for (l = trig->
stages; l; l = l->next) {
86 g_slist_free_full(stage->
matches, g_free);
88 g_slist_free_full(trig->
stages, g_free);
142 struct sr_channel *ch,
int trigger_match,
float value)
155 sr_err(
"Invalid trigger match for a logic channel.");
164 sr_err(
"Invalid trigger match for an analog channel.");
168 sr_err(
"Unsupported channel type: %d.", ch->
type);
174 match->
match = trigger_match;
The representation of a trigger, consisting of one or more stages containing one or more matches on a...
struct sr_trigger_stage * sr_trigger_stage_add(struct sr_trigger *trig)
Allocate a new trigger stage and add it to the specified trigger.
The public libsigrok header file to be used by frontends.
struct sr_trigger * sr_trigger_new(const char *name)
Create a new trigger.
int match
The trigger match to use.
float value
If the trigger match is one of SR_TRIGGER_OVER or SR_TRIGGER_UNDER, this contains the value to compar...
char * name
A name for this trigger.
int type
Channel type (SR_CHANNEL_LOGIC, ...)
Information on single channel.
void sr_trigger_free(struct sr_trigger *trig)
Free a previously allocated trigger.
Channel type is analog channel.
A channel to match and what to match it on.
int sr_trigger_match_add(struct sr_trigger_stage *stage, struct sr_channel *ch, int trigger_match, float value)
Allocate a new trigger match and add it to the specified trigger stage.
GSList * stages
List of pointers to struct sr_trigger_stage.
struct sr_channel * channel
The channel to trigger on.
Channel type is logic channel.
GSList * matches
List of pointers to struct sr_trigger_match.