New trigger specification
Currently libsigrok supports only a very basic trigger specification. Triggers are expressed as a string, in the format which sigrok-cli supports (it passes it on unchanged to libsigrok). The format is <probe>=<trigger>, where <probe> is the name of number of the probe and <trigger> can be:
- 0 or 1: low or high value on the pin. A series of these specifies a sequence of values the probe must match before the trigger is considered to fire.
- r or f: A rising or falling value on the pin. An r effectively corresponds to 01.
- c: Any kind of change on a pin (either a rising or a falling edge).
However, there are some problems with this:
- It's not a very precise specification. For example, there is no way to specify that either this probe should match its trigger, OR another probe should.
- It's not very expressive, and only allows for very simple triggers to be specified. Some hardware supported by sigrok is capable of much more complex triggering.
- A text-based specification will only go so far before it becomes more of a problem to parse than the convenience it provides to the CLI frontend.
This page attempts to provide a work document where requirements and design ideas can be gathered before a new trigger specification is implemented in libsigrok.
Trigger support examples
The following triggers are supported by the hardware:
- Defined duration of the condition ("longer than" and/or "shorter than")
- Sequence of two different conditions
- 16-bit counter - triggering after N-th occurence of the condition
- Extensive condition definition options using logical functions (N)AND,(N)OR,(N)XOR
- Any value or edge on any input condition
Openbench Logic Sniffer
- old SUMP-style triggers (see Openbench_Logic_Sniffer#Long_Commands)
- HP16550A-style triggers (see http://dangerousprototypes.com/forum/viewtopic.php?f=23&t=1711)
This should be a (long) list of all types of triggers and trigger combinations we want to support in sigrok.
- Rising edge
- Falling edge
- Either rising or falling edge
- Low signal value
- High signal value
Protocol decoder triggering:
The system should support specifying
- Hardware triggers (that are used to configure the respective device to use its own internal hardware-based triggering)
- Note: Some devices do not support internal/hardware triggers at all. Those will use software triggers only.
- Software triggers (that are implemented in libsigrok/libsigrokdecode and can run after the hardware triggers)
- A combination of software and hardware triggers