Age | Commit message (Collapse) | Author |
|
|
|
|
|
Absence of a samplerate for the input stream should not be fatal. The
protocol decodes fine, we just cannot determine a bitrate for frames.
This addresses part of bug 1076.
|
|
Nobody has seen any such slave in the wild, yet. In the very unlikely
case that someone actually sees or needs this, patches are welcome
though (together with sample .sr files).
|
|
Move initialization code of protocol decoders from the constructor to a
new reset() helper method. The libsigrokdecode backend could run this
method several times to clear the decoder's internal state, before new
data from another acquisition gets fed to decode() calls.
|
|
The previous implementation of the I2C decoder used to retrieve and not
process the first sample of the input stream. Remove this instruction.
|
|
This allows frontends to set the assumed initial pins (i.e., the assumed
state of the pins before the first sample of a capture) to user-specified
values.
The assumed initial pins can be either low, or high, or "use same value
as the first sample of the capture".
The special self.initial_pins decoder attribute is now removed.
|
|
Some PDs were using a temporary workaround for (as it turned out) a
refcounting issue that was fixed in 066fbafdc3ba734a73b5f7fcfa1dbae67ddebf8a.
|
|
Remove the FSF postal address as it might change (it did in the past).
Reference the gnu.org website instead which is more stable.
|
|
|
|
The previous **kwargs some PDs had is not actually ever used, so drop it.
|
|
This is more consistent with annotation syntax and looks slightly
better in most cases.
|
|
Use self.ss/self.es, or if there's a need to differentiate
them a bit more, use self.ss_<suffix>/self.es_<suffix> consistently.
Also, drop some unused variables.
|
|
- No newlines at the end of files.
- No trailing ';' characters.
- Comparison with None: Use 'is None' or 'is not None'.
- Comparison with True/False: Use 'if cond:' or 'if not cond:'.
- Various minor whitespace fixes.
|
|
Also, use the "if not self.samplerate" form, which catches both the case
where self.samplerate is None, as well as the case where it is 0.
|
|
Also remove some dead code.
|
|
|
|
Older libsigrokdecode versions are no longer able to use the current
versions of the PDs (various changes in syntax etc).
|
|
Variables of type 'struct srd_channel *' are consistently named 'pdch' to
make them easily distinguishable from libsigrok's 'struct sr_channel *'
variables that are consistently named 'ch'.
|
|
Annotation entries also consist of a tuple, not a list.
|
|
|
|
Each option consists of a dictionary with the following keys:
id The option id, which is passed in when setting a value.
desc A description of the option, suitable for display.
def The default value for this option.
values (optional) If present, a tuple containing values the option
may take. They must be of the same type as the default.
Valid types for the options are UTF-8-encoded strings, integers, and
floating point values.
|
|
|
|
The output type is now called OUTPUT_PYTHON, adapt all PDs to that.
|
|
The single comment re-stating the PD's name / description / purpose in
each pd.py file is not really needed, that info is available in the
Decoder class' attributes already.
|
|
|
|
|
|
|
|
This adds a tool in the tests directory, called pdtest. It uses the
"test/" directory in every PD directory, if present, to run the
PD against dumps found in the sigrok-dumps repository, and compares
the output against ".output" files in the "test/" directory. The file
"test/test.conf" is used to configure which tests to run.
A separate tool (tests/runtc.c) is used to run the actual decoding and
report output.
To get an overview of the options, run tests/pdtest without any options.
|
|
|
|
|
|
|
|
This better reflects what it is: a python object generated and
processed by python code.
|
|
|
|
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.
|
|
|
|
|
|
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.
This fixes bug #151.
|
|
Until now the I2C PD was basically ignoring the very first sample, and
using that as the initial 'oldscl'/'oldsda' value.
However, if your logic analyzers trigger on, say, SDA=low that will
result in a file where the first sample is really important since it
is the one which the PD will need to know that there's a falling edge
on SDA.
Thus, assume both SCL and SDA are high/1 when the PD starts. This is
a good assumption since both pins have pullups on them in practice
and are thus high/1 when the bus is idle.
Later on we might want to have config options to let the PD assume
other states of SDA/SCL initially.
|
|
|
|
|
|
The Python module name is determined by the directory name (e.g. dcf77),
the *.py file names in that directory don't matter and can be kept
consistent.
|