Commit Graph

1520 Commits

Author SHA1 Message Date
Marek Vasut 6057d9fa54 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 <marex@denx.de>
2014-04-30 09:45:51 -07:00
Marek Vasut 00c8650877 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 <marex@denx.de>
2014-04-30 09:45:51 -07:00
Marek Vasut d405193074 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 <marex@denx.de>
2014-04-30 09:45:51 -07:00
Marek Vasut 58d6f20748 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 <marex@denx.de>
2014-04-30 09:45:51 -07:00
Marek Vasut 011f1091fa 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 <marex@denx.de>
2014-04-30 09:45:51 -07:00
Marek Vasut 1c2736f909 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 <marex@denx.de>
2014-04-30 09:45:51 -07:00
Marek Vasut 64fe661b87 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 <marex@denx.de>
2014-04-30 09:45:51 -07:00
Marek Vasut 29b66a2eb0 asix-sigma: Squash yoda-condition in upload_firmware()
Signed-off-by: Marek Vasut <marex@denx.de>
2014-04-30 09:45:51 -07:00
Marek Vasut a80226bbb9 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 <marex@denx.de>
2014-04-30 09:45:50 -07:00
Marek Vasut d485d44361 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 <marex@denx.de>
2014-04-30 09:45:50 -07:00
Marek Vasut 8bbf7627df 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 <marex@denx.de>
2014-04-30 09:45:50 -07:00
Marek Vasut 499b17e9c0 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 <marex@denx.de>
2014-04-30 09:45:50 -07:00
Marek Vasut d5fa188ac9 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 <marex@denx.de>
2014-04-30 09:45:50 -07:00
Marek Vasut 790c7ccc88 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 <marex@denx.de>
2014-04-30 09:45:50 -07:00
Marek Vasut b1648dea88 asix-sigma: Document sampling rate table
Add comments to the sampling rate table explaining how the frequencies
are selected and where do those numbers come from.

Signed-off-by: Marek Vasut <marex@denx.de>
2014-04-30 09:45:50 -07:00
Bert Vermeulen 6868626bd3 asix-sigma: Acquisition fixes. 2014-04-30 09:45:50 -07:00
Bert Vermeulen 06b5d7f70d fx2lafw: Don't send more samples than requested.
It's the new law.
2014-04-24 21:04:23 +02:00
Bert Vermeulen b0ccd64d02 WIP 2014-04-23 19:27:31 +02:00
Bert Vermeulen 1e1dac0c07 ols: Allow disabling all channels.
This fixed bug 316.
2014-04-21 14:46:49 +02:00
Bert Vermeulen 7e7b7fb7d3 Removed ALSA driver.
This driver has been unmaintained for years, and was never good code
to begin with. It's also questionable whether it was ever useful,
particularly with the demo driver now supporting various analog
signalling.
2014-04-19 13:37:53 +02:00
Uwe Hermann 55f98c6533 sr_dev_inst_new(): Use NULL (not "") if version unknown/nonexisting.
Unify the whole code-base to use NULL there, not a mix of "" and NULL.
2014-04-13 18:57:54 +02:00
Uwe Hermann cfe01d0607 chronovu-la: Show errors other than "device not found".
This can be useful for the user to see, e.g. for permission related
issues (device is there, but cannot be accessed).
2014-04-13 18:57:53 +02:00
Aurelien Jacobs 99af83b738 rigol-ds: fix long memory depth setting on DS1000 2014-04-06 22:47:44 +02:00
Aurelien Jacobs f589a6d499 scpi_usbtmc_libusb: disable all clear_halt for Rigol DS1000 2014-04-06 22:47:44 +02:00
Aurelien Jacobs 50e6311a1b scpi_usbtmc_libusb: disable bulk_out clear_halt for Rigol DS1000
fix hangup issue with Rigol firmware version 00.02.02.02.00
2014-04-06 17:32:59 +02:00
Aurelien Jacobs eb28f1b7b2 fx2lafw: fix possible use of uninitialized variable (gcc-4.9 warning fix)
hardware/fx2lafw/protocol.c: In function 'fx2lafw_command_start_acquisition':
hardware/fx2lafw/protocol.c:113:7: warning: 'cmd.flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
   (cmd.flags & CMD_START_FLAGS_CLK_48MHZ) ? "48" : "30");
       ^
2014-04-06 17:32:46 +02:00
Uwe Hermann 38d3246497 Various drivers: Expose SR_CONF_TRIGGER_TYPE.
Without this, sigrok-cli --show (for example) will not show the
supported trigger types.
2014-04-02 17:20:10 +02:00
Uwe Hermann 69bdcd8bb4 chronovu-la: LA16 has fewer max. samples than LA8.
Each LA16 sample is 16bits wide (LA8 samples are 8 bits wide). Adapt the
number returned for SR_CONF_LIMIT_SAMPLES in config_list() accordingly.
2014-04-02 17:20:10 +02:00
Uwe Hermann 05266f36a5 chronovu-la: Fix byte order for LA16 samples sent to the bus. 2014-04-02 17:20:10 +02:00
Uwe Hermann b0efc84e12 chronovu-la: Document that streaming is not possible.
This closes bug #261.
2014-04-02 17:20:10 +02:00
Uwe Hermann 7b3567126c Rename 'chronovu-la8' driver to 'chronovu-la'.
The driver now also supports the LA16 device (and possibly others in the
future).
2014-04-02 17:20:09 +02:00
Uwe Hermann 00910580bb la8: Add support for the ChronoVu LA16.
The ChronoVu LA16 is a new logic analyzer from ChronoVu with some
differences in features compared to the LA8, e.g.

 - Supports 16 channels (instead of 8).
 - Max. 200MHz samplerate (instead of 100MHz).
 - Supports state triggering (low and high channel value) and edge triggering
   (rising or falling edge), the LA8 only supports state triggering.

This driver now supports both the LA8 and LA16, but it needed a few
changes:

 - Add support for detecting multiple device instances at all.
 - Add support for both LA8 and/or LA16 devices being detected.
 - Add a device profile struct for LA8-/LA16-specific device properties.
 - Move the samplerates list to devc (it's different for LA8 and LA16).
 - Split scan() into two functions, one for scanning, one for adding a device.
 - Expand some variables and fields from uint8_t to uint16_t in order to
   support 16 channels.
 - Update the samplerate related functions to support the LA16's 200MHz.
 - Various other minor updates in order to better handle both device types.
 - Various error handling improvements and simplifications.
 - Also, replace time() with g_get_monotonic_time() everywhere.

This also fixes bug #247 (which was related to incorrect handling of
resources during scan and open of the device, which was exposed by
PulseView allowing multiple consecutive scan/close/open calls).
2014-04-02 17:20:09 +02:00
Uwe Hermann b172c1301e la8: Cleanups, cosmetics, simplifications.
Also, make some LA8 references more generic in preparation of
LA16 support.
2014-04-02 17:20:09 +02:00
Uwe Hermann 9503583268 demo: Fix typos. 2014-03-30 18:06:54 +02:00
Uwe Hermann 8bd3daa48a Various drivers: Drop some unneeded lines. 2014-03-30 18:06:45 +02:00
Bert Vermeulen 0bcfc9dcd8 rigol-ds: Don't close SCPI handle we didn't open. 2014-03-27 15:13:24 +01:00
Aurelien Jacobs 5d336f1130 rigol-ds: Add the TRIGGER_SLOPE entry to config_get() and config_list() 2014-03-25 23:11:31 +01:00
Uwe Hermann 61e77667de hameg-hmo: Change some PG_/pg_ names to CG_/cg_.
This fixes parts of bug #259.
2014-03-25 21:02:05 +01:00
Uwe Hermann fca75cbb74 A few more random 'probe' to 'channel' changes.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann f3ca73edd2 Rename a few more API calls with 'probe' in their name.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 3f239f0803 Rename various *PROBE* macros to *CHANNEL*.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 56d0d24535 Rename sr_probe_new() to sr_channel_new().
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann ba7dd8bbb8 Replace 'probe' with 'channel' in most places.
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.
2014-03-25 20:58:54 +01:00
Uwe Hermann 91aea754aa Rename 'struct sr_probe' to 'struct sr_channel' everywhere.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 53b4680fce Consistently use 'cg' for channel group variables.
This matches how we consistently use sdi, devc, and so on all over
the code-base.

This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann a68bf88e3a Replace channel_group.probes with channel_group.channels.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 40fd0264f9 Replace some 'pg' with 'cg'.
(since 'probe groups' are now called 'channel groups')

This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 660e398fe9 Replace 'probe group' with 'channel group' everywhere.
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.
2014-03-25 20:58:54 +01:00
poljar (Damir Jelić) 3fd2dca207 hameg-hmo: Add missing cases in config_get(). 2014-03-25 20:48:58 +01:00
poljar (Damir Jelić) bbabdaf1e2 hameg-hmo: Add the TRIGGER_SLOPE entry to config_list(). 2014-03-25 20:48:58 +01:00