Bert Vermeulen [Sun, 10 Nov 2013 11:42:11 +0000 (12:42 +0100)]
Implement OUTPUT_BINARY
This requires the PD to have a tuple in its class called 'binary',
which contains a list of strings describing the different binary
classes it can output. For the SPI decoder this might be 'MOSI' and
'MISO', for example.
The data is submitted to the frontend as struct srd_proto_data_binary,
which contains the class that data belongs to.
'id' defaults to the protocol decoder instance id, and only needs changing
if a decoder chain needs to fork.
'object-type' refers to a Python object, such as int or str.
After registering, the PD submits data as usual with Decoder.put(), with
the only argument a value of the registered object-type.
Bert Vermeulen [Wed, 30 Oct 2013 15:30:05 +0000 (16:30 +0100)]
Pass metadata to PDs only at runtime, not at decoder start
The SRD_CONF_NUM_PROBES metadata key was removed. It wasn't actually
used for anything, since this is trivially available via the configured
(or default) probe list.
The SRD_CONF_UNITSIZE key was removed. The unit size is instead derived
from the probe list: the number of probes packed into the least amount
of space possible defines the unit size.
PD changes:
* The start() method no longer takes a 'metadata' parameter.
* Metadata now comes in only via the metadata() method, which takes
a key and value. The only key defined so far is SRD_CONF_SAMPLERATE,
which is exported into the module namespace.
API changes:
* srd_session_send() now takes an end_samplenum parameter, and had its
options rearranged.
* srd_session_config_set() is now srd_session_metadata_set(). This keeps
"config" options for a future feature to allow PDs or frontends to
configure each other's options on the fly, up and down the stack.
Move all decoder instances and callbacks into a session struct
The struct srd_session also holds configuration parameters formerly
passed to srd_session_start().
The new call srd_session_new() takes a pointer where a newly allocated
pointer to struct srd_session will be stored. This pointer must be
passed as the first argument to all functions that require it.
The SRD_CONF_NUM_PROBES, SRD_CONF_UNITSIZE and SRD_CONF_SAMPLERATE
keys must be configured with srd_config_set() before srd_session_start()
is called.
A new call srd_session_destroy() is also available. This cleans up all
resources the session holds. This is also called from srd_exit() for
all sessions.
Uwe Hermann [Thu, 10 Oct 2013 20:44:02 +0000 (22:44 +0200)]
usb_signalling: Drop packet handling.
The usb_signalling PD should not care about packets, only symbols and bits.
The new (fixed) usb_packet PD constructs packets out of individual bits now.
Uwe Hermann [Fri, 4 Oct 2013 09:35:56 +0000 (11:35 +0200)]
usb_packet: Major rewrite, e.g. to prepare for GUI usage.
Restructure the PD into a state machine, output individual packet
components as separate annotations, define a protocol output format and
implement it (so that other PDs can stack on top of this one), and fix
various other isses in the PD.
Uwe Hermann [Sat, 28 Sep 2013 22:18:24 +0000 (00:18 +0200)]
usb_signalling: Fix decode of individual bits.
After a Start of Packet (SOP) has been detected, "sample" the individual
USB symbolѕ/bits in the middle of the respective bittime (depending on
whether full-speed or low-speed signalling is used).
This fixes various incorrectly decoded cases (bug #158).
Uwe Hermann [Sun, 15 Sep 2013 14:33:32 +0000 (16:33 +0200)]
dcf77: Drop PON pin handling.
The PON pin is specific to the Pollin "DCF1 module", but has nothing to
do with DCF77 itself. Thus, drop it from this PD. It can be part of
another stacked PD if needed.
Uwe Hermann [Sat, 14 Sep 2013 18:28:40 +0000 (20:28 +0200)]
i2c: Drop unneeded 'addressing' option.
This (unimplemented so far) option is not needed at all, since the
decoder will be able to detect 7/10 bit slave addresses automatically,
the user doesn't have to specify slave address sizes.
Uwe Hermann [Fri, 13 Sep 2013 17:08:34 +0000 (19:08 +0200)]
i2c: Various fixes to make the PD suitable for GUIs.
The output format of the slave address is now a PD option. It can be
"shifted" or "unshifted", i.e. bit 0 (which contains a read/write
marker) is either shifted out or not, i.e., the slave address is
displayed as 8bit or 7bit number (or 11bit/10bit number for 10bit slave
addresses).
Data bytes (not address bytes) are always shown as 8bit values, of course.
Add annotation types for the individual I2C components such as
start conditions, stop conditions, ACK/NACK, address read/writes,
data read/writes and so on.
Uwe Hermann [Thu, 12 Sep 2013 19:19:55 +0000 (21:19 +0200)]
spi: Make CS# optional and use it if supplied.
The CS# pin is now optional, it can either be supplied to the PD or not.
If it _is_ supplied, reset the PD state every time it changes. This has
the effect that "incomplete" SPI frames and those where CS# is not
asserted are ignored and not decoded.
Uwe Hermann [Thu, 12 Sep 2013 07:40:40 +0000 (09:40 +0200)]
uart: Output data in separate RX and TX annotation types.
There is one annotation type for the RX side of the communication/data
output now, and another one for the TX side.
This allows GUIs to show them in two different traces, and/or show them in
the same trace but with different colors.
This also has the additional benefit that it is clear which databyte
belongs to which direction. Previously the annotations had to look like
"RX: 5F" or "TX: 11001011", but the "RX: " and "TX: " prefixes are now
no longer required, making the GUI traces (and CLI output too) much more
readable.
Uwe Hermann [Thu, 12 Sep 2013 07:32:28 +0000 (09:32 +0200)]
uart: Use same length for data output in all cases.
Until now you could get e.g. "d" or "df" as hex output from the UART PD.
This will now be a common-length "0D" and "DF". When all data byte
annotations are of the same lengths the readability in GUI traces is a lot
better. Also, hardcode hex characters to be upper-case (for now).
The same applies to oct ("021" instead of "21") and bin output
("00001001" instead of "1001").
Uwe Hermann [Thu, 12 Sep 2013 07:17:12 +0000 (09:17 +0200)]
uart: Put annotations into proper annotation types.
There are now extra annotation types for data, start/stop/parity bits and
for warnings (e.g. "invalid parity" or "frame error" or such).
This allows users to select which of the annotation types they want to
see (they can select one/multiple/all annotations as needed), and also
allows them to use different visual representation for the different
annotation types in GUIs (e.g. different colors for the blobs, different
fonts, rectangle/round/elliptic blobs, and so on; how the annotation
blobs are displayed is entirely up to the GUI and its configuration by
the user).
Uwe Hermann [Thu, 12 Sep 2013 07:01:52 +0000 (09:01 +0200)]
uart: Drop extensive protocol info (moved to wiki).
Move the full details of the protocol to the wiki, the docs in the PD
itself should only be a short description and/or a collection of notes
that could be useful for a user in a GUI (or CLI) to decide which
PD to select, which options to set how, what PDs to stack where, and so on.
The full protocol description (including photos, examples, ...) is here: