]> sigrok.org Git - libsigrok.git/log
libsigrok.git
9 years agoAdd VID/PID for Testo 435.
Bert Vermeulen [Sat, 5 Jul 2014 19:45:54 +0000 (21:45 +0200)]
Add VID/PID for Testo 435.

9 years agomanson-hcs-3xxx: Use maximum voltage and current read from device.
Matthias Heidbrink [Thu, 26 Jun 2014 15:56:54 +0000 (17:56 +0200)]
manson-hcs-3xxx: Use maximum voltage and current read from device.

9 years agoserial: docs.
Matthias Heidbrink [Thu, 26 Jun 2014 12:22:50 +0000 (14:22 +0200)]
serial: docs.

9 years agomanson-hcs-3xxx: Implemented setting voltage, current and output.
Matthias Heidbrink [Thu, 26 Jun 2014 12:14:31 +0000 (14:14 +0200)]
manson-hcs-3xxx: Implemented setting voltage, current and output.

9 years agomanson-hcs-3xxx: Cleanup, improved error handling, docs.
Matthias Heidbrink [Thu, 26 Jun 2014 09:23:29 +0000 (11:23 +0200)]
manson-hcs-3xxx: Cleanup, improved error handling, docs.

9 years agomanson-hcs-3xxx: Added missing models of series, fixed current resolution.
Matthias Heidbrink [Wed, 25 Jun 2014 21:22:50 +0000 (23:22 +0200)]
manson-hcs-3xxx: Added missing models of series, fixed current resolution.

9 years agomanson-hcs-3xxx: Fixed build without libserialport.
Matthias Heidbrink [Fri, 27 Jun 2014 21:31:50 +0000 (23:31 +0200)]
manson-hcs-3xxx: Fixed build without libserialport.

9 years agomanson-hcs-3xxx: Initial driver implementation.
Uwe Hermann [Sun, 22 Jun 2014 22:40:58 +0000 (00:40 +0200)]
manson-hcs-3xxx: Initial driver implementation.

Currently supports only few HCS-3xxx models (tested on HCS-3202), and
not all commands/operations yet.

9 years agomanson-hcs-3xxx: Initial driver skeleton.
Uwe Hermann [Sun, 22 Jun 2014 22:31:22 +0000 (00:31 +0200)]
manson-hcs-3xxx: Initial driver skeleton.

9 years agoserial-dmm: Implement request timeout mechanism.
Matthias Heidbrink [Fri, 23 May 2014 20:26:34 +0000 (22:26 +0200)]
serial-dmm: Implement request timeout mechanism.

(fixes request flooding for Voltcraft ME-42 and M-3650CR)

This fixes bug #345.

9 years agoREADME: Document that libftdi1 is also an option.
Uwe Hermann [Mon, 16 Jun 2014 11:20:56 +0000 (13:20 +0200)]
README: Document that libftdi1 is also an option.

9 years agoLower libftdi1 requirement to 1.0 (builds fine too).
Uwe Hermann [Mon, 16 Jun 2014 11:19:34 +0000 (13:19 +0200)]
Lower libftdi1 requirement to 1.0 (builds fine too).

9 years agodetect version 1.x of libftdi library
Dan Horák [Sun, 15 Jun 2014 09:08:37 +0000 (11:08 +0200)]
detect version 1.x of libftdi library

The FDTI library changed version, module name and also soname, so add an option to detect it
when the 0.x version is not found. The 1.x API is compatible enough for libsigrok to build.

9 years agodo not add check to common cflags/libs
Mike Frysinger [Sat, 14 Jun 2014 02:44:39 +0000 (22:44 -0400)]
do not add check to common cflags/libs

Only the unittests use these flags, so don't go linking them in for
the main library too.

9 years agoasix-sigma: fix build time warnings
Mike Frysinger [Sat, 14 Jun 2014 02:44:40 +0000 (22:44 -0400)]
asix-sigma: fix build time warnings

We need to include unistd.h for usleep():
hardware/asix-sigma/asix-sigma.c: In function 'sigma_fpga_init_bitbang':
hardware/asix-sigma/asix-sigma.c:450:3: warning: implicit declaration of function 'usleep'
   usleep(10000);

And we need to tweak the type of chunks_per_read to match dl_lines_total:
hardware/asix-sigma/asix-sigma.c: In function 'download_capture':
hardware/asix-sigma/asix-sigma.c:1161:39: warning: comparison between signed and unsigned integer expressions
   dl_lines_curr = MIN(chunks_per_read, dl_lines_total);

9 years agoadd explicit configure flags for ftdi/serial/usb libraries
Mike Frysinger [Sat, 14 Jun 2014 02:44:38 +0000 (22:44 -0400)]
add explicit configure flags for ftdi/serial/usb libraries

This makes it a lot easier for distros to control this functionality.

9 years agonorma-dmm: Added request timeout mechanism; docs.
Matthias Heidbrink [Fri, 13 Jun 2014 19:22:11 +0000 (21:22 +0200)]
norma-dmm: Added request timeout mechanism; docs.

9 years agonorma-dmm: Added separate driver siemens-b102x for Siemens B1024-B1028 DMMs (just...
Matthias Heidbrink [Sat, 7 Jun 2014 17:45:41 +0000 (19:45 +0200)]
norma-dmm: Added separate driver siemens-b102x for Siemens B1024-B1028 DMMs (just for cosmetic reasons).

9 years agochronovu-la: re-add return that was inadvertently removed in commit aeff7fa2
Aurelien Jacobs [Tue, 3 Jun 2014 14:43:04 +0000 (16:43 +0200)]
chronovu-la: re-add return that was inadvertently removed in commit aeff7fa2

9 years agotrigger: Rename sr_trigger_stage_new() to sr_trigger_stage_add().
Bert Vermeulen [Sat, 31 May 2014 08:34:56 +0000 (10:34 +0200)]
trigger: Rename sr_trigger_stage_new() to sr_trigger_stage_add().

9 years agosession: Expose sr_session_trigger_get() as a public API call.
Bert Vermeulen [Sat, 31 May 2014 08:17:17 +0000 (10:17 +0200)]
session: Expose sr_session_trigger_get() as a public API call.

9 years agofx2lafw: Fix sample count.
Bert Vermeulen [Thu, 29 May 2014 20:58:58 +0000 (22:58 +0200)]
fx2lafw: Fix sample count.

9 years agosaleae-logic16: Fix acquisition with fewer than nine channels enabled.
Bert Vermeulen [Thu, 29 May 2014 20:55:52 +0000 (22:55 +0200)]
saleae-logic16: Fix acquisition with fewer than nine channels enabled.

9 years agosaleae-logic16: Use new library software trigger.
Bert Vermeulen [Thu, 29 May 2014 20:16:58 +0000 (22:16 +0200)]
saleae-logic16: Use new library software trigger.

9 years agofx2lafw: Use new library software trigger.
Bert Vermeulen [Wed, 28 May 2014 13:54:46 +0000 (15:54 +0200)]
fx2lafw: Use new library software trigger.

9 years agoAdd new software trigger as a library-wide facility.
Bert Vermeulen [Wed, 28 May 2014 13:53:27 +0000 (15:53 +0200)]
Add new software trigger as a library-wide facility.

This is strictly an internal feature, for use by drivers for hardware
that doesn't have its own trigger mechanism.

9 years agosession: Free session-wide trigger if set.
Bert Vermeulen [Wed, 28 May 2014 13:46:43 +0000 (15:46 +0200)]
session: Free session-wide trigger if set.

9 years agotrigger: Fix memory leak.
Bert Vermeulen [Wed, 28 May 2014 13:46:21 +0000 (15:46 +0200)]
trigger: Fix memory leak.

9 years agozeroplus-logic-cube: Use new trigger API.
Bert Vermeulen [Tue, 27 May 2014 22:22:06 +0000 (00:22 +0200)]
zeroplus-logic-cube: Use new trigger API.

9 years agosysclk-lwla: Use new trigger API.
Bert Vermeulen [Tue, 27 May 2014 22:21:56 +0000 (00:21 +0200)]
sysclk-lwla: Use new trigger API.

9 years agools: Use new trigger API.
Bert Vermeulen [Tue, 27 May 2014 22:21:45 +0000 (00:21 +0200)]
ols: Use new trigger API.

9 years agoikalogic-scanalogic2: Use new trigger API.
Bert Vermeulen [Tue, 27 May 2014 22:21:23 +0000 (00:21 +0200)]
ikalogic-scanalogic2: Use new trigger API.

9 years agofx2lafw: Use new trigger API.
Bert Vermeulen [Tue, 27 May 2014 22:21:10 +0000 (00:21 +0200)]
fx2lafw: Use new trigger API.

9 years agochronovu-la: Use new trigger API.
Bert Vermeulen [Tue, 27 May 2014 22:20:51 +0000 (00:20 +0200)]
chronovu-la: Use new trigger API.

9 years agoasix-sigma: Use new trigger API.
Bert Vermeulen [Tue, 27 May 2014 22:19:58 +0000 (00:19 +0200)]
asix-sigma: Use new trigger API.

9 years agoRemove dead code from session read.
Bert Vermeulen [Tue, 27 May 2014 22:05:51 +0000 (00:05 +0200)]
Remove dead code from session read.

The "trigger" keyword was supported in theory, but in practice nothing
ever wrote it, so it was never used.

9 years agoRemove obsolete API call sr_parse_triggerstring().
Bert Vermeulen [Tue, 27 May 2014 22:05:00 +0000 (00:05 +0200)]
Remove obsolete API call sr_parse_triggerstring().

Since triggers are now passed to libsigrok with an API, this moved
to sigrok-cli.

9 years agoRemove obsolete API call sr_dev_trigger_set().
Bert Vermeulen [Tue, 27 May 2014 22:01:54 +0000 (00:01 +0200)]
Remove obsolete API call sr_dev_trigger_set().

Triggers are now set on the session, not on a channel.

9 years agoRename SR_CONF_TRIGGER_TYPE to SR_CONF_TRIGGER_MATCH.
Bert Vermeulen [Tue, 27 May 2014 21:55:26 +0000 (23:55 +0200)]
Rename SR_CONF_TRIGGER_TYPE to SR_CONF_TRIGGER_MATCH.

Drivers supporting triggering need to implement this in config_list()
and return an array of int32_t consisting of SR_TRIGGER_*.

9 years agoAdd new triggering framework.
Bert Vermeulen [Thu, 22 May 2014 23:21:58 +0000 (01:21 +0200)]
Add new triggering framework.

The new triggers consist of a set of structs and an API to manipulate
them.  Both logic and analog triggers are supported, in an unlimited
number of stages.

A single struct sr_trigger containing its stages and triggers is then
added to the session.

In case of a driver where the hardware supports triggering, the struct
is then converted and used to arm the hardware trigger. Drivers without
hardware trigger support, such as fx2lafw or multimeter drivers, use it
as the basis for a software-based trigger implementation instead.

9 years agofx2lafw: Rename trigger constant.
Bert Vermeulen [Thu, 22 May 2014 21:22:37 +0000 (23:22 +0200)]
fx2lafw: Rename trigger constant.

9 years agomotech-lps-30x: Cleanup.
Matthias Heidbrink [Mon, 19 May 2014 19:38:23 +0000 (21:38 +0200)]
motech-lps-30x: Cleanup.

9 years agomotech-lps-30x: Cleanup.
Matthias Heidbrink [Mon, 19 May 2014 18:47:15 +0000 (20:47 +0200)]
motech-lps-30x: Cleanup.

9 years agomotech-lps-30x: Implemented driver.
Matthias Heidbrink [Mon, 19 May 2014 17:48:28 +0000 (19:48 +0200)]
motech-lps-30x: Implemented driver.

9 years agoWhitespace and comment improvements, no semantical changes.
Matthias Heidbrink [Mon, 19 May 2014 17:44:04 +0000 (19:44 +0200)]
Whitespace and comment improvements, no semantical changes.

9 years agostrutil: Now using base 10 in sr_atol(), sr_atoi() for compatibility to atoi(), atol...
Matthias Heidbrink [Mon, 19 May 2014 17:40:53 +0000 (19:40 +0200)]
strutil: Now using base 10 in sr_atol(), sr_atoi() for compatibility to atoi(), atol(); docs.

9 years agomotech-lps-30x: Initial driver framework.
Matthias Heidbrink [Mon, 19 May 2014 17:23:30 +0000 (19:23 +0200)]
motech-lps-30x: Initial driver framework.

9 years agoconfigure.ac: Bump package version to 0.3.0.
Uwe Hermann [Tue, 6 May 2014 21:00:08 +0000 (23:00 +0200)]
configure.ac: Bump package version to 0.3.0.

9 years agoconfigure.ac: Bump libtool/library version from 1:2:0 to 2:0:0.
Uwe Hermann [Tue, 6 May 2014 20:59:00 +0000 (22:59 +0200)]
configure.ac: Bump libtool/library version from 1:2:0 to 2:0:0.

The libtool current:revision:age numbers change from 1:2:0 to 2:0:0.

Details:
http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info

This changes the library filename (e.g. on Linux) from libsigrok.so.1.0.2
to libsigrok.so.2.0.0, the SONAME (+symlink) becomes libsigrok.so.2.

9 years agoNEWS: Add list of user-visible changes so far.
Uwe Hermann [Tue, 6 May 2014 07:00:00 +0000 (09:00 +0200)]
NEWS: Add list of user-visible changes so far.

9 years agoRename SR_T_CHAR to SR_T_STRING.
Uwe Hermann [Tue, 6 May 2014 18:18:54 +0000 (20:18 +0200)]
Rename SR_T_CHAR to SR_T_STRING.

This is more correct and less confusing.

9 years agorigol-ds: Quick hack to fix bug #354.
Martin Ling [Sun, 4 May 2014 23:38:58 +0000 (00:38 +0100)]
rigol-ds: Quick hack to fix bug #354.

10 years agoREADME: Mention missing dependency 'librevisa'.
Uwe Hermann [Sun, 4 May 2014 20:04:37 +0000 (22:04 +0200)]
README: Mention missing dependency 'librevisa'.

10 years agolog.c: Avoid using the same name for a variable and enum.
Uwe Hermann [Sun, 4 May 2014 18:57:38 +0000 (20:57 +0200)]
log.c: Avoid using the same name for a variable and enum.

10 years agoAdd/update Doxygen @since tags.
Uwe Hermann [Sun, 4 May 2014 18:51:05 +0000 (20:51 +0200)]
Add/update Doxygen @since tags.

10 years agolibsigrok.h: Add some missing enum names for consistency.
Uwe Hermann [Sun, 4 May 2014 17:58:56 +0000 (19:58 +0200)]
libsigrok.h: Add some missing enum names for consistency.

10 years agoasix-sigma: Don't set invalid configuration options.
Bert Vermeulen [Sun, 4 May 2014 18:48:17 +0000 (11:48 -0700)]
asix-sigma: Don't set invalid configuration options.

10 years agodoxygen: Updated Doxyfile to doxygen 1.8.6.
Uwe Hermann [Sun, 4 May 2014 15:55:46 +0000 (17:55 +0200)]
doxygen: Updated Doxyfile to doxygen 1.8.6.

10 years agoUnhook the Link Instruments MSO-19 from the build for now.
Uwe Hermann [Sun, 4 May 2014 15:44:05 +0000 (17:44 +0200)]
Unhook the Link Instruments MSO-19 from the build for now.

This driver is neither working nor has it been in a compiling state for
a long time, so unhook it from the build until it is fixed and works.

The files (api.c and protocol.[ch]) are still in git, but won't end up in
released tarballs and they don't get built (neither git nor tarballs).

This also allows us to drop the otherwise unneeded dependency on libudev.
When the MSO-19 driver comes back, it should be in a form that doesn't
require the inherently Linux-only libudev anyway. See also:
http://sigrok.org/bugzilla/show_bug.cgi?id=65

10 years agoDrop obsolete Linux-only usbtmc backend.
Uwe Hermann [Sun, 4 May 2014 15:38:09 +0000 (17:38 +0200)]
Drop obsolete Linux-only usbtmc backend.

We're now using a portable libusb-based (userspace) backend which should
in theory work on any OS with libusb support.

10 years agoREADME.devices: Various updates and fixes.
Uwe Hermann [Sun, 4 May 2014 15:35:47 +0000 (17:35 +0200)]
README.devices: Various updates and fixes.

10 years agoDrop left-overs of the removed alsa driver.
Uwe Hermann [Sun, 4 May 2014 14:57:58 +0000 (16:57 +0200)]
Drop left-overs of the removed alsa driver.

10 years agoDon't define names ending with _t (POSIX reserved).
Uwe Hermann [Sat, 3 May 2014 20:14:01 +0000 (22:14 +0200)]
Don't define names ending with _t (POSIX reserved).

Avoid defining any names ending in _t, those are generally reserved
for POSIX usage. For details see:

http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html
http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html

10 years agoasix-sigma: Disable sample-limited capture for now.
Bert Vermeulen [Sun, 4 May 2014 07:35:24 +0000 (00:35 -0700)]
asix-sigma: Disable sample-limited capture for now.

This is not really supported yet in the driver.

10 years agoasix-sigma: Publish capture ratio correctly.
Bert Vermeulen [Sun, 4 May 2014 07:34:24 +0000 (00:34 -0700)]
asix-sigma: Publish capture ratio correctly.

10 years agosaleae-logic16: Minor whitespace fixes, cosmetics.
Uwe Hermann [Sat, 3 May 2014 19:22:38 +0000 (21:22 +0200)]
saleae-logic16: Minor whitespace fixes, cosmetics.

10 years agosaleae-logic16: Use unitsize 1 if none of channels 8-15 are used.
Marcus Comstedt [Fri, 25 Apr 2014 19:27:49 +0000 (21:27 +0200)]
saleae-logic16: Use unitsize 1 if none of channels 8-15 are used.

10 years agosaleae-logic16: Don't send more samples than requested.
Marcus Comstedt [Fri, 25 Apr 2014 19:07:16 +0000 (21:07 +0200)]
saleae-logic16: Don't send more samples than requested.

This fixes bug #350.

10 years agoAdd SR_CONF_DEVICE_MODE and SR_CONF_TEST_MODE config keys.
Martin Ling [Tue, 15 Apr 2014 20:26:26 +0000 (21:26 +0100)]
Add SR_CONF_DEVICE_MODE and SR_CONF_TEST_MODE config keys.

10 years agofx2lafw: Allow matching USB descriptor strings as well as VID/PID.
Martin Ling [Tue, 15 Apr 2014 20:16:20 +0000 (21:16 +0100)]
fx2lafw: Allow matching USB descriptor strings as well as VID/PID.

10 years agofx2lafw: tidy up config_set().
Martin Ling [Tue, 15 Apr 2014 10:23:51 +0000 (11:23 +0100)]
fx2lafw: tidy up config_set().

10 years agofx2lafw: implement config_get for SR_CONF_LIMIT_SAMPLES and tidy up.
Martin Ling [Tue, 15 Apr 2014 10:03:59 +0000 (11:03 +0100)]
fx2lafw: implement config_get for SR_CONF_LIMIT_SAMPLES and tidy up.

10 years agofx2lafw: pass sdi to command functions.
Martin Ling [Mon, 14 Apr 2014 20:32:01 +0000 (21:32 +0100)]
fx2lafw: pass sdi to command functions.

10 years agoasix-sigma: Init cur_sample_rate
Marek Vasut [Fri, 25 Apr 2014 16:03:47 +0000 (18:03 +0200)]
asix-sigma: Init cur_sample_rate

Init the cur_sample_rate to 200kHz. This is now the default sample
rate for the ASIX Sigma if no other is specified by -c samplerate=N
on the command line. Without this change, the driver would crash on
SIGFPE because a division by zero would happen.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Fix the trigger handling
Marek Vasut [Sun, 20 Apr 2014 23:44:36 +0000 (01:44 +0200)]
asix-sigma: Fix the trigger handling

Due to the recent changes in the sigma driver, the trigger handling got
broken. Fix this by properly calculating and propagating the fact that
the trigger happened.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Pull out cluster decoding
Marek Vasut [Sun, 20 Apr 2014 23:29:52 +0000 (01:29 +0200)]
asix-sigma: Pull out cluster decoding

Pull out the code for decoding the DRAM clusters into separate function.
This shall improve readability some more.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Exterminate passing lastts and lastsample
Marek Vasut [Sun, 20 Apr 2014 23:14:54 +0000 (01:14 +0200)]
asix-sigma: Exterminate passing lastts and lastsample

These two values can pulled out from devc->state, so there really is
no need to pass them as function argument when we already pass the
devc.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Rework decode_chunk_ts()
Marek Vasut [Sun, 20 Apr 2014 01:10:05 +0000 (03:10 +0200)]
asix-sigma: Rework decode_chunk_ts()

This function could have never returned correct data. Rework the decoding
logic according to the Sigma documentation. This patch also fixes the
handling of partial DRAM lines and partial DRAM clusters.

While at it, do not allocate megabytes of data on stack, just allocate 2KiB
which is plenty for all the work this function needs to do.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Suspend support for trailing DRAM lines
Marek Vasut [Sun, 20 Apr 2014 20:58:34 +0000 (22:58 +0200)]
asix-sigma: Suspend support for trailing DRAM lines

The support for trailing DRAM lines was broken. This patch starts
rework of support for this, but in order to do that, we need to
rework decode_chunk_ts() a little first.

This patch adjusts the decode_chunk_ts() a little to receive the
total amount of events in DRAM line instead of some nonsense value.
This patch temporarily removes the support for the trailing DRAM
lines until the decode_chunk_ts() is fixed to cope with this, so
yes, this patch introduces breakage!

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Properly fetch timestamp in decode_chunk_ts()
Marek Vasut [Sun, 20 Apr 2014 20:45:25 +0000 (22:45 +0200)]
asix-sigma: Properly fetch timestamp in decode_chunk_ts()

Instead of this ad-hoc readout voodoo, use proper function to read
the timestemp. One which will not break even on big-endian machines.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Use proper structure for DRAM lines
Marek Vasut [Sun, 20 Apr 2014 20:40:38 +0000 (22:40 +0200)]
asix-sigma: Use proper structure for DRAM lines

Use proper structure instead of plain buffer of uint8_t for the contents
of DRAM in download_capture(). This is beneficial as we can interpret the
contents easily.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Introduce function to read DRAM cluster timestamp
Marek Vasut [Sun, 20 Apr 2014 20:36:55 +0000 (22:36 +0200)]
asix-sigma: Introduce function to read DRAM cluster timestamp

Introduce helper function which returns the timestamp of DRAM cluster
and use it in download_capture().

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Unify calling of decode_chunk_ts()
Marek Vasut [Sun, 20 Apr 2014 20:28:33 +0000 (22:28 +0200)]
asix-sigma: Unify calling of decode_chunk_ts()

Clean up the way decode_chunk_ts() is called a little. Introduce a variable
which will not be -1 only in case a trigger happened on the particular DRAM
line.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Rework download_capture() to support more than 32 lines
Marek Vasut [Sun, 20 Apr 2014 20:19:11 +0000 (22:19 +0200)]
asix-sigma: Rework download_capture() to support more than 32 lines

In the current configuration, the download capture used 32KiB buffer
for samples. This was the upper limit this function could download
from the Sigma. Even the sigma_read_dram() was only called once to
read up-to 32 DRAM line from address 0x0 in the DRAM.

This patch reworks the function to call sigma_read_dram() in a loop
in case there is need to download more than 32 DRAM lines of data
from Sigma. The data are then correctly passed for decoding to the
decoding function.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Remove stack-based alloc in download_capture()
Marek Vasut [Sun, 20 Apr 2014 19:34:36 +0000 (21:34 +0200)]
asix-sigma: Remove stack-based alloc in download_capture()

Avoid allocating 32KiB of data on stack in download_capture(). Instead,
do a glib-variant of calloc(1, ) to allocate the data for the samples
which will be downloaded. This avoids explosions of stack on systems
with tight stack limits.

Furthermore, define structures describing the organisation of Sigma's
DRAM memory and start using those instead of ad-hoc preprocessor macros
defining the sizes of various structures in memory.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Localize variables
Marek Vasut [Sun, 20 Apr 2014 18:50:10 +0000 (20:50 +0200)]
asix-sigma: Localize variables

The trigger position, stop position and chunk in which the trigger happened
are no longer needed in the global scope. Make those variables local to the
download_capture() function.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Move all register I/O into download_capture()
Marek Vasut [Sun, 20 Apr 2014 18:45:40 +0000 (20:45 +0200)]
asix-sigma: Move all register I/O into download_capture()

Move all the register I/O that is necessary to do the download of samples
from Sigma into download_capture() function. This makes the downloading
code contained a bit more again.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Clearly separate the sample download
Marek Vasut [Sun, 20 Apr 2014 18:40:00 +0000 (20:40 +0200)]
asix-sigma: Clearly separate the sample download

Reorder the sigma_capture_mode() function so that the part which handles
the download of samples from Sigma is clearly separated from the tests if
the download should be started.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Pull out the CAPTURE mode handler
Marek Vasut [Sun, 20 Apr 2014 18:30:16 +0000 (20:30 +0200)]
asix-sigma: Pull out the CAPTURE mode handler

Pull out the code handling the Sigma which is in CAPTURE mode into
a separate function. This is so we can start reworking this entire
code easily soon.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Read position only in CAPTURE state
Marek Vasut [Sun, 20 Apr 2014 17:57:02 +0000 (19:57 +0200)]
asix-sigma: Read position only in CAPTURE state

Check the position of ForceStop and Trigger events only in case we
are in CAPTURE state, it's useless to do this unconditionally when
receive_data() is called.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Decrypt the LA mode switch sequence
Marek Vasut [Sun, 20 Apr 2014 17:49:44 +0000 (19:49 +0200)]
asix-sigma: Decrypt the LA mode switch sequence

Decode the logic mode start sequence into a series of FPGA instructions
instead and get rid of this sequence of magic numbers.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Encode the opcodes as hex values
Marek Vasut [Sun, 20 Apr 2014 17:41:23 +0000 (19:41 +0200)]
asix-sigma: Encode the opcodes as hex values

Just encode the opcodes as hexadecimal values. This makes for better
readability when mapping the communication dump with the sigma to the
code.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Pull out the logic-mode switching
Marek Vasut [Sun, 20 Apr 2014 17:36:40 +0000 (19:36 +0200)]
asix-sigma: Pull out the logic-mode switching

Pull out the code which switches Sigma from the FPGA programming mode
into Logic-Analyzer mode into separate function. Also, given the reply
is only ever 3-byte long, do not allocate 32 byte big buffer, but only
a 3-byte long one.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Squash yoda-condition in upload_firmware()
Marek Vasut [Sun, 20 Apr 2014 17:29:52 +0000 (19:29 +0200)]
asix-sigma: Squash yoda-condition in upload_firmware()

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Move the sigma_fw_2_bitbang()
Marek Vasut [Sun, 20 Apr 2014 17:27:43 +0000 (19:27 +0200)]
asix-sigma: Move the sigma_fw_2_bitbang()

Move the sigma_fw_2_bitbang() function closer to the upload_firmware()
function so there's not such a horrible mess in the file.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Cleanup the bit2bitbang
Marek Vasut [Sun, 20 Apr 2014 17:19:33 +0000 (19:19 +0200)]
asix-sigma: Cleanup the bit2bitbang

Rework the bit2bitbang function. Remarkable changes are:
- The function was renamed to sigma_fw_2_bitbang()
- We use glib function calls to work with the file
- We mmap the file containing firmware instead of opening the file
  and then reading it into a buffer.
- The magic firmware transformation is now type-safe.
- Documentation and comments were added where applicable.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Weed out in-condition assignments
Marek Vasut [Sun, 20 Apr 2014 15:58:35 +0000 (17:58 +0200)]
asix-sigma: Weed out in-condition assignments

Remove all those if ((ret = foo(bar)) < 0) constructs from upload_firmware()
function. This is just a confusing programming practice, kill it. While at it,
replace all the uses of &devc->ftdic with plain ftdic , which is defined at
the begining.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Fix firmware path construction
Marek Vasut [Sun, 20 Apr 2014 15:49:29 +0000 (17:49 +0200)]
asix-sigma: Fix firmware path construction

The code silently assumed the firmware path can be no longer than 128 bytes.
This doesn't scale. This patch fixes it in such a way that it completely
rips out the run-time computation of firmware path and instead replaces it
with compile-time computation. It's true this makes the library grow by a
couple bytes, but makes the code cleaner.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Cleanup FPGA initialization
Marek Vasut [Sun, 20 Apr 2014 15:18:31 +0000 (17:18 +0200)]
asix-sigma: Cleanup FPGA initialization

Rework the pre-firmware-upload FPGA initialization sequence so it matches
the documentation. Also, since this sequence is documented in a separate
section, wrap it into separate function.

Signed-off-by: Marek Vasut <redacted>
10 years agoasix-sigma: Remove NUM_CHANNELS macro
Marek Vasut [Sun, 20 Apr 2014 15:02:05 +0000 (17:02 +0200)]
asix-sigma: Remove NUM_CHANNELS macro

The NUM_CHANNELS macro is inflexible, since in 100MHz and 200MHz modes
we don't support 16 channels. Moreover, it's only used to limit the size
of array of channel labels, which can be done in much cleaner way.

Signed-off-by: Marek Vasut <redacted>