Also, consistently use 'ch' for channel variables. This matches how we
consistently use sdi, devc, and so on all over the code-base.
This fixes parts of bug #259.
The name 'probe' (and thus 'probe group') is a relic from the times when
sigrok was mostly about logic analyzers. Nowadays we support a lot more
device types where 'probe' is not really a good term and 'channel' is
much better suited.
This fixes parts of bug #259.
The maximum sample size that can be set on a device is now published
by sr_config_list(SR_CONF_LIMIT_SAMPLES). This returns a tuple of
uint64_t representing minimum and maximum number of samples.
The sample buffer is a still a bit of a mystery, but this should help.
The variables in play:
triggerbar/ramsize_trigger - These two variables added together indicate
how many samples we want captured. ramsize_trigger - triggerbar
indicades how many samples must be captured. The ratio between the two
is determined by capture ratio.
memory_size - This indicates the number of samples in the circular
capture buffer. stop_address, now_address, and trigger_address are
pointers within the zeroplus that wrap based on this size.
now_address - The address that the zeroplus was about to write to when
it finished capturing, and now the address that will be read from when
reads are done from the capture buffer
stop_address - The address that the zeroplus last wrote to when it
completed capture.
trigger_address - The sample address for which the trigger occured.
status - This one is a bit tricky. Some testing has shown that if the
zeroplus has captured memory_size or less samples, the STATUS_READY bit
is set. For all captures generated with more samples than this,
STATUS_READY was cleared. However, boundary conditions are difficult to
test and values such as, memory_size + 1 have not been tested. We use
this to determine if the capture has wrapped through the sample buffer.
More testing is required, but this improves behavior in a number of
cases, specifically capturing sample amounts that are not a power of 2
of the sample buffer size. Before, random data was passed to libsigrok.
Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
This will need some additional work when support is added for compression
modes since group D is disabled for RLE compression and C and D are
disabled for "double" compression.
Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
The per-driver API calls no longer have a hw_ prefix (e.g. hw_init()
became init() and so on), so drop the 'hw_' from the std versions
for those API callbacks too.
This invalidates previously returned sr_dev_inst pointers, which a
frontend may be holding. It's the frontend's responsibility to clear
the list of instances a driver keeps track of by calling
sr_dev_clear(driver);
if it wants a completely new scan done.
The currently supported model LAP-C(16032) doesn't support the
samplerates 150MHz and 200MHz which some of the other models have.
Thus, do not report these samplerates to the frontends. E.g. sigrok-cli
should not show them via --show and GUIs should not list them in their
"Samplerates" drop-down.