Commit Graph

751 Commits

Author SHA1 Message Date
Bert Vermeulen d3f8f1415c fluke-dmm: flesh out the driver API 2012-09-25 19:53:05 +02:00
Bert Vermeulen 4129832014 fluke-dmm: auto-discover serial bitrate if not provided 2012-09-25 19:53:05 +02:00
Bert Vermeulen bc41e012e6 fluke-dmm: don't log anything if no conn params given 2012-09-25 19:53:05 +02:00
Bert Vermeulen fb480d578e fluke-dmm: fix discovery 2012-09-25 19:53:05 +02:00
Bert Vermeulen 5c51e09868 sr: turn off canonical mode and echo ion serial ports by default 2012-09-25 19:53:05 +02:00
Bert Vermeulen e7edd64f45 fluke-dmm: build fixes 2012-09-25 19:53:05 +02:00
Bert Vermeulen 4f958423d1 fluke-dmm: basic scan functionality 2012-09-25 19:53:05 +02:00
Bert Vermeulen 883a2e9e71 fluke-dmm: initial driver skeleton 2012-09-25 19:53:05 +02:00
Bert Vermeulen c2016fa0eb agilent-dmm: don't log anything if no conn params given 2012-09-17 00:00:27 +02:00
Bert Vermeulen e9022f596d sr: make struct drv_context global 2012-09-11 21:27:26 +02:00
Bert Vermeulen f5cfe894ec fx2lafw: use default libusb context 2012-09-11 21:20:50 +02:00
Bert Vermeulen 19b0cce312 hantek-dso: use default libusb context 2012-09-11 21:16:16 +02:00
Bert Vermeulen b186aa78b8 agilent-dmm: fix model identifiers 2012-09-10 21:27:50 +02:00
Bert Vermeulen 8c0152f29b agilent-dmm: tentative support for all U123x and U125x models
Only tested on U1233A, but it just might work.

The U125x protocol decoding only supports voltage, current, resistance,
capacitance and diode measurements for now.
2012-09-10 01:00:48 +02:00
Bert Vermeulen a4394fb3d9 agilent-dmm: code cleanup
This should make it easier to support other Agilent U12xx models
2012-09-10 00:13:26 +02:00
Bert Vermeulen e066c32a25 agilent-dmm: fix AC/DC mode detection 2012-09-09 22:49:07 +02:00
Bert Vermeulen f2e86bbfa6 agilent-dmm: make parser deal with input better 2012-09-09 22:48:22 +02:00
Bert Vermeulen 81599cc55b agilent-dmm: remove IDN check at 1Hz, we just don't need it.
Some debug message cleanup.
2012-09-08 14:53:49 +02:00
Bert Vermeulen e6b021f377 agilent-dmm: support for submodes 2012-09-08 03:06:45 +02:00
Bert Vermeulen 69a7402490 genericdmm/victor-70c: fix resistance and frequency measurements 2012-09-08 02:28:41 +02:00
Bert Vermeulen c0d93341cb generic-dmm: cosmetics 2012-09-02 15:42:56 +02:00
Bert Vermeulen f6b8ffa6c0 genericdmm/victor-70c: warn if detaching kernel driver fails 2012-09-02 15:42:56 +02:00
Bert Vermeulen e93cdf428c sr: mostly finished Agilent DMM driver 2012-09-02 15:42:56 +02:00
Bert Vermeulen 792fc68658 serial: add serial_set_paramstr() 2012-09-02 15:42:56 +02:00
Bert Vermeulen f38b9763fa serial: fix flow control setting 2012-09-02 15:42:56 +02:00
Bert Vermeulen 6a6e23abf5 serial: set speed in both directions 2012-09-02 15:42:56 +02:00
Bert Vermeulen 6ac0db19f3 sr: add new agilent-dmm driver (Agilent U12xxA multimeters) 2012-09-02 15:42:56 +02:00
Bert Vermeulen b84c13d700 genericdmm: Victor 70C multimeter support 2012-08-18 16:23:08 +02:00
Bert Vermeulen 3c6ce226de genericdmm: finish basic USB support 2012-08-18 16:23:08 +02:00
Bert Vermeulen 811deee4af sr/drivers: add API calls sr_dev_inst_list() and sr_dev_inst_clear()
These are used to list the device instances currently known to the driver,
and clear that list.

Drivers that don't necessarily clear their list of instances on every scan,
such as genericdmm, need to provide these to the frontend to keep instance
management sane.
2012-08-06 00:59:25 +02:00
Bert Vermeulen 014359e329 sr/drivers: obsolete SR_HWCAP_PROBECONFIG
Since probes now live in a struct sr_dev_inst owned by the driver, it
already knows about them. Instead of a frontend telling the driver to
configure probes, all driver now do this just before starting acquisition.
2012-08-05 18:56:12 +02:00
Bert Vermeulen fabe59b326 sr: drivers using sr_usb_dev_inst_new() must free it properly as well
sr_usb_dev_inst_free() doesn't really do anything, but it might one
day.
2012-08-04 12:21:02 +02:00
Bert Vermeulen 228b2cccaf asix-sigma: fix double free 2012-08-03 14:19:00 +02:00
Bert Vermeulen 8012ae1e3b chronovu-la8: fix double free 2012-08-03 14:18:02 +02:00
Bert Vermeulen afc8831938 chronovu-la8: code cleanup 2012-08-03 14:06:52 +02:00
Bert Vermeulen 7021f98596 chronovu-la8: remove session source when done 2012-08-03 11:29:01 +02:00
Bert Vermeulen 503c4afbb4 asix-sigma: remove session source when done 2012-08-03 11:29:01 +02:00
Bert Vermeulen 7fd3e85961 demo: remove sources from session when done 2012-08-03 11:29:01 +02:00
Bert Vermeulen a3508e33f9 hantek-dso: remove sources from session when done 2012-08-03 11:29:01 +02:00
Bert Vermeulen 26bf9d56c0 ols: remove serial source from session when done 2012-08-03 11:29:01 +02:00
Bert Vermeulen 310e9e9be4 zeroplus: use driver-private storage for instances 2012-08-03 11:29:00 +02:00
Bert Vermeulen fefc4b858e ols: use driver-private storage for instances 2012-08-03 11:29:00 +02:00
Bert Vermeulen 301a5e4c4a genericdmm: use driver-private storage for instances 2012-08-03 11:29:00 +02:00
Bert Vermeulen b4750a3a93 demo: use driver-private storage for instances 2012-08-03 11:29:00 +02:00
Bert Vermeulen b9636cf4dc fx2lafw: minor cleanup 2012-08-03 11:29:00 +02:00
Bert Vermeulen cf1ebd5446 chronovu-la8: don't try to clean up unless we've initialized 2012-08-03 11:29:00 +02:00
Bert Vermeulen b32503cccd asix-sigma: properly init driver-private storage 2012-08-03 11:29:00 +02:00
Bert Vermeulen 1644fb2473 chronovu-la8: use driver-private storage for instances 2012-08-03 11:29:00 +02:00
Bert Vermeulen 0e1357e896 asix-sigma: use driver-private storage for instances 2012-08-03 11:29:00 +02:00
Bert Vermeulen dc9dbe949a fx2lafw: use driver-private storage for instances and libusb_context 2012-08-03 11:29:00 +02:00
Bert Vermeulen 269971ddce hantek-dso: use driver-private storage for instances and libusb_context 2012-08-03 11:29:00 +02:00
Bert Vermeulen 6f57fd9694 sr: remove obsolete SR_DI_INST 2012-08-03 11:29:00 +02:00
Bert Vermeulen 87ca93c504 sr/drivers: add proper probe list to instances of all drivers 2012-08-03 11:29:00 +02:00
Bert Vermeulen b35c829306 sr/drivers: fix off-by-one if frontend-initiated probe configuration 2012-08-03 11:29:00 +02:00
Bert Vermeulen 9e90dcba9c sr/drivers: remove driver API call dev_status_get()
It's obsolete: no frontend ever used it, and neither did libsigrok.
The sdi->status field is only used internally by some drivers, and
should probably be moved to the driver-specific context structs.
2012-08-03 11:27:31 +02:00
Bert Vermeulen 5d9ed643e9 ols: change driver dev_acquisition_start/_stop calls to use sdi
...yeah, forgot OLS.
2012-08-03 11:27:31 +02:00
Bert Vermeulen c4a1de59f8 genericdmm: cosmetic change 2012-08-03 11:27:31 +02:00
Bert Vermeulen 3f848bb7a9 zeroplus: comment out 32-probe models for now 2012-08-03 11:27:31 +02:00
Bert Vermeulen 428edbe13d zeroplus-logic-cube: fix scan to correctly find model 2012-08-03 11:27:31 +02:00
Bert Vermeulen 3ffb6964a1 sr/drivers: change driver dev_acquisition_start/_stop calls to use sdi 2012-08-03 11:27:31 +02:00
Bert Vermeulen 25a0f108f4 sr/drivers: change driver dev_open/dev_close calls to use sdi 2012-08-03 11:27:31 +02:00
Bert Vermeulen 6f4b1868e8 sr/drivers: use sr_dev_inst instead of device index for dev_config_set()
All driver API calls using device index as a parameter will instead use a
const struct sr_dev_inst.
2012-08-03 10:27:39 +02:00
Bert Vermeulen 9c4311c524 chronovu-la8: adjust to multi-vid/pid patch 2012-08-03 10:27:39 +02:00
Bert Vermeulen 444adea232 zeroplus-logic-cube: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:39 +02:00
Bert Vermeulen 2ca4465b3d ols: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:39 +02:00
Bert Vermeulen 2ce9f04629 hantek-dso: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:39 +02:00
Bert Vermeulen cbd798f400 fx2lafw: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:39 +02:00
Bert Vermeulen 46c7a4daa7 demo: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:39 +02:00
Bert Vermeulen 7566601c21 chronovu-la8: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:39 +02:00
Bert Vermeulen b2b5445c30 asix-sigma: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:39 +02:00
Bert Vermeulen 2efc5948b6 ols: scan fix 2012-08-03 10:27:39 +02:00
Bert Vermeulen b0c8d7ac7f hantek-dso: scan/info_get fixes 2012-08-03 10:27:39 +02:00
Bert Vermeulen 7dfcf010a0 demo: scan/info_get fixes 2012-08-03 10:27:39 +02:00
Bert Vermeulen cfe8a84dd7 chronovu-la8: scan/info_get fixes 2012-08-03 10:27:39 +02:00
Bert Vermeulen d7bbecfdb9 asix-sigma: scan/info_get fixes 2012-08-03 10:27:39 +02:00
Bert Vermeulen 626409abfb zeroplus-logic-cube: use new driver info_get() API call 2012-08-03 10:27:38 +02:00
Bert Vermeulen dddfb3dbf0 ols: use new driver info_get() API call 2012-08-03 10:27:38 +02:00
Bert Vermeulen 0b79bcbb9d hantek-dso: use new driver info_get() API call 2012-08-03 10:27:38 +02:00
Bert Vermeulen dfb0fa1a66 demo: use new driver info_get() API call 2012-08-03 10:27:38 +02:00
Bert Vermeulen 6a2761fd99 chronovu-la8: use new driver info_get() API call 2012-08-03 10:27:38 +02:00
Bert Vermeulen 4147960558 asix-sigma: use new driver info_get() API call 2012-08-03 10:27:38 +02:00
Bert Vermeulen eec944c5b8 asix-sigma: don't attempt to free static struct
Added more debugging as well.
2012-08-03 10:27:38 +02:00
Bert Vermeulen 067d07166b demo: use new scan API 2012-08-03 10:27:38 +02:00
Bert Vermeulen 7da6f9d54a zeroplus-logic-cube: init and scan fixes
libusb context needs to be initialized only once, not ever scan.
Every scan invalidates the last one, so clean up any previous run's
results first.
2012-08-03 10:27:38 +02:00
Bert Vermeulen 4ca3898445 zeroplus-logic-cube: use new scan API 2012-08-03 10:27:38 +02:00
Bert Vermeulen 39cfdd75f9 hantek-dso: use new scan API 2012-08-03 10:27:38 +02:00
Bert Vermeulen 0448d11097 asix-sigma: use new scan API + fixes
Now freeing FTDI context and driver-private context.
2012-08-03 10:27:38 +02:00
Bert Vermeulen c4f3ed4bb0 chronovu-la8: use new scan API + fixes
Now freeing FTDI context and driver-private context.
2012-08-03 10:27:38 +02:00
Bert Vermeulen f8c617cf4c hantek-dso: instance list fix 2012-08-03 10:27:38 +02:00
Bert Vermeulen 10e5cbede8 ols: use new scan API 2012-08-03 10:27:38 +02:00
Bert Vermeulen ed300b9f6a asix-sigma: use driver struct-based device instance list 2012-08-03 10:27:38 +02:00
Bert Vermeulen 765ef2f725 chronovu-la8: use driver struct-based device instance list 2012-08-03 10:27:38 +02:00
Bert Vermeulen dcf03d6dbd demo: use driver struct-based device instance list 2012-08-03 10:27:38 +02:00
Bert Vermeulen 3275654708 zeroplus-logic-cube: use driver struct-based device instance list 2012-08-03 10:27:38 +02:00
Bert Vermeulen 982947f7a2 hantek-dso: use driver struct-based device instance list 2012-08-03 10:27:38 +02:00
Bert Vermeulen e5e81856b4 ols: use driver struct-based device instance list 2012-08-03 10:27:38 +02:00
Bert Vermeulen d6db79a48c genericdmm: device scan fixes 2012-08-03 10:27:38 +02:00
Bert Vermeulen f1a14ea7ab genericdmm: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:37 +02:00
Bert Vermeulen 6910bf6bf6 genericdmm: use new driver info_get() API call 2012-08-03 10:27:37 +02:00
Bert Vermeulen a27999e657 fx2lafw: don't use deprecated hwcap_get_all() driver API call 2012-08-03 10:27:37 +02:00
Bert Vermeulen c5e82ca5e3 fx2lafw: device scan fixes 2012-08-03 10:27:37 +02:00
Bert Vermeulen f69b47f0f8 fx2lafw: a device scan always invalidates any previous scans 2012-08-03 10:27:37 +02:00
Bert Vermeulen 6e9339aae2 fx2lafw: use new driver info_get() API call 2012-08-03 10:27:37 +02:00
Bert Vermeulen 3a0fe4023d genericdmm: use new scan API 2012-08-03 10:27:37 +02:00
Bert Vermeulen bbb40871c8 genericdmm: more flexible device discovery 2012-08-03 10:27:37 +02:00
Bert Vermeulen 75337758d8 genericdmm: use driver struct-based device instance list 2012-08-03 10:27:37 +02:00
Bert Vermeulen a8cc8e44b9 fx2lafw: use driver struct-based device instance list 2012-08-03 10:27:37 +02:00
Bert Vermeulen 06717a8a60 fx2lafw: use new instance-based probe list 2012-08-03 10:27:37 +02:00
Bert Vermeulen 3a7a22cb07 fx2lafw: use new init/scan API 2012-08-03 10:27:37 +02:00
Bert Vermeulen 633b2fac75 genericdmm: better subdriver API arguments 2012-08-03 10:27:37 +02:00
Bert Vermeulen 1ef445b3d6 genericdmm/fs9922: no initialization needed 2012-08-03 10:27:36 +02:00
Bert Vermeulen 7fc754a0db genericdmm: allow for default options in DMM profiles
Much better than the special-cased USB vid.pid
2012-08-03 10:27:36 +02:00
Bert Vermeulen 7356a55db8 genericdmm: use vid.pid as USB conn spec
: is just too hard for the CLI
2012-08-03 10:27:36 +02:00
Bert Vermeulen db1352007d genericdmm: fix header guard 2012-08-03 10:27:36 +02:00
Bert Vermeulen 61136ea603 sr: add new driver API call: scan()
This changes the semantics of the init() call as well. That now only
initializes the driver -- an administrative affair, no hardware gets
touched during this call. It returns a standard SR_OK or SR_ERR* code.

The scan() call does a discovery run for devices it knows, and returns
the number found. It can be called at any time.
2012-08-03 10:27:36 +02:00
Bert Vermeulen 40dda2c3a5 sr: remove unused argument from hardware driver function init()
It was actually used in one way: the session file loaded abused it for
passing in the filename -- something it definitely wasn't intended for.
This now uses the proper way to pass arguments to a driver: the new
SR_HWCAP_SESSIONFILE.

The OLS driver could also use it as an indication of the serial port to
use instead of actively probing all serial ports on the system, but there
wasn't any frontend code that passed in such a parameter, making it
entirely useless. That will soon be handled differently with the new
scan() API call, regardless.
2012-08-03 10:27:36 +02:00
Ivan Fedorov 0e8d0e24d0 sr: fx2lafw: Add 16bit support for USBee DX and clones
gnuplot script support only 8 channels
2012-08-03 00:25:37 +02:00
Ivan Fedorov c9166745f2 sr: fx2lafw: Add basic support for USBee DX and clones 2012-08-01 00:12:00 +04:00
Bert Vermeulen d67b663e21 sr: chronovu-la8: fix segfault on discovery
If the uninitialized value didn't happen to contain 0, and there
is no Chronovu LA8 connected, the la8_close() causes a segfault
in libftdi.
2012-07-24 00:53:01 +02:00
Uwe Hermann 74e5f12d3d sr: la8: Support for newer USB VID/PID of the device.
Thanks to Jerry Jacobs for the patch!
2012-07-15 00:34:27 +02:00
Uwe Hermann 43be303c84 sr: la8: Drop useless cast. 2012-07-12 23:23:13 +02:00
Uwe Hermann 615183ea16 sr: Drop mastech-va18b, code will be in genericdmm. 2012-07-11 12:57:15 +02:00
Bert Vermeulen 28b9dd1861 sr: fix conditional build for ezusb and serial helpers 2012-07-11 12:36:49 +02:00
Lars-Peter Clausen e6e8f8e053 sr: demodevice: Make read channel non-blocking
Both pipe channels are currently configured as blocking. We read from the pipe
in receive_data. Since the channel is configured as blocking we'll block in
receive_data until all data has been received. receive_data will be called from
the mainloop, so as consequence the mainloop will be blocked until the demo
device has finished sampling. This is not so much of a problem if we are
sampling in blocking mode (using sr_session_run()) and the demo device is the
only device in the session, but it will fail badly for all other configurations
(e.g. multiple devices or async sampling).

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-07-10 20:13:31 +02:00
Lars-Peter Clausen e7d087bf0e sr: fx2lafw: Free transfers in reverse order
Free the USB transfers in the reverse order of which they were submitted. This
will avoid that while transfer 0 is cancelledd transfer 1 is started by the
host controller, and so on.

Reported-by: Peter Stuge <peter@stuge.se>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-07-08 21:39:30 +02:00
Lars-Peter Clausen 249ae2be8f sr: session/demo: Remove Windows specific hack
The session and demo device code contain a hack to make the demo device work on
Windows. This was neccessary since polling on windows requires special handling
and we can not just pass in the raw fd to poll.

With the previous patches which added support for non-fd based event sources
this hack is no longer required. The patch moves the GIOChannels used by the
demo device to the demo device context and uses sr_session_source_add_channel
to register a source for the channels instead of using the raw pipe fds.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-07-05 01:41:01 +02:00
Bert Vermeulen 45c59c8bdd sr: moved sigrok.h so libsigrok/libsigrok.h
All frontends will have to include <libsigrok/libsigrok.h> from now on.
This header includes proto.h and version.h, both installed from the
distribution into $INCLUDE/libsigrok/ as well.

The only dynamically changed header is now version.h, which has both
libsigrok and libtool compile-time versions in it.
2012-07-05 01:17:28 +02:00
Lars-Peter Clausen 8489264f1e sr: demodevice: Reset sample limit when setting time limit and vice versa
Only one limit should be active at a time. Make sure that the sample limit is
disabled when a time limit is set and vice versa.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-07-04 01:11:50 +02:00
Lars-Peter Clausen 25f5d66a77 sr: fx2lafw: Fix potential leaks in acquisition_start error paths
Call abort_acquisition if starting sampling fails in acquisition_start, this
will ensure that all already allocated resources are being freed again.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-07-04 01:11:50 +02:00
Lars-Peter Clausen c03f045004 sr: fx2lafw: Do not start a new acquisition if the old is still running
This may happen if the acquisition_start is called right after calling
acquisition_stop and not all transfers have been freed or on repeated calls to
acquisition_start. If it happens we'll enter an undefined state and all kind of
strange behavior may occur, so error out in such a case.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-07-04 01:11:50 +02:00
Lars-Peter Clausen 0caa1ef0cb sr: fx2lafw: Abort pending transfers when sampling is stopped
The recent reworks of the fx2lafw made sure that the total buffer size is large
enough hold 500ms of data. This was done to improve performance and stability.
That the timeout value for a transfer was also increased to over 500ms, a side
effect of this is that when sampling is stopped there will be a additional delay
of 500ms. This is because the driver waits for all transfers to be freed
before it sends a SR_DF_END packet. Once sampling has stopped this will only
happen once a transfer times out. This patch cancels all pending transfers when
sampling is stopped, this will cause them to be freed almost immediately and the
additional delay will disappear.

Also make sure, that if we know, that we just have received the last transfer to
not resubmit this transfer again.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-07-04 01:11:50 +02:00
Bert Vermeulen ca3d84cca1 sr: add genericdmm driver 2012-07-01 22:37:15 +02:00
Bert Vermeulen f8c1fcda46 sr: use proper definitions for parity setting
ols driver fixed to use these as well.
2012-07-01 22:31:31 +02:00
Uwe Hermann 163f0523f6 sr: Mastech VA18B: Partial protocol supports (WIP).
Disable the driver for now, as it's not usable for the general public, yet.
2012-06-28 22:57:03 +02:00
Uwe Hermann 99f5d45ecc sr: hantek-dso: Fix copy-paste error. 2012-06-28 01:47:38 +02:00
Lars-Peter Clausen 2769eed991 sr: fx2lafw: Move empty_transfer_count to device ctx
If one device is failing it should not affect the transfers of other devices.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-28 00:40:52 +02:00
Lars-Peter Clausen 5af666a94e sr: fx2lafw: Calculate buffer size and timeout based on sample rate
Currently timeout and buffer size are hard-coded in the fx2lafw driver which is
non-optimal if we want to get good results at both high and low sample rates.

The timeout is hard-coded to 40ms, which doesn't work well when sampling at
a low sample rate. E.g. at 20kHz filling all available buffer space alone takes
6 seconds. So naturally we'll see a lot of transfers timeout in this case.

The buffer size is hard-coded to 4096 bytes, which does not work well with high
sample rates. E.g. at 24MHz these 4096 bytes are enough space for 0.17ms of
data. The total buffer size is enough for about 5ms of data. Sooner or later the
application won't be able to resubmit a transfer within this time span and the
device will abort data acquisition. Usually this happens within the first few
seconds of sampling.

This patch adds a few new helper functions which calculate the buffer size and
timeout based on the current sample rate.

The buffer size is chosen to be large enough to hold about 10ms of data and it
also must be a multiple of 512 bytes since the firmware will send us the data
in 512 byte chunks.

The timeout is set to the time it would take to fill the whole available buffer
space plus a 25% headroom to accommodate for jitter. This is more than enough,
but there is no need to make the timeout a tight deadline, since it is only
meant as a last resort in case the device stops submitting data. And in this
case data acquisition will be aborted anyway.

The patch also limits the the number of transfers so that the total buffer
space is not much more of 500ms. This will ensure that we do not have to
wait too long when aborting data acquisition.

This patch also significantly reduces the number of context switches when
sampling at a higher sample rate. On my system for example the CPU load of
sigrok-cli when sampling at 24MHz goes down from ~25% to 3-4%.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-28 00:40:52 +02:00
Lars-Peter Clausen 7ce737a77c sr: fx2lafw: Handle the transfer's status
While errors are usually already implicitly caught by looking at the packet
length field there is one error status which is worth special handling. If the
device has been removed there is not really a chance to recover from this error
so data acquisition can be stopped immediately.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-28 00:40:52 +02:00
Lars-Peter Clausen 17dff8a1e6 sr: fx2lafw: Avoid unnecessary alloc/free combo
In receive_transfer for each completed transfer a new buffer is allocated and
the old one is freed. We can avoid this by simply reusing the buffer for the
next transfer. This is possible if we only resubmit the transfer after all
processing on the data buffer has been done. A new buffer is only allocated if
the size of the old one is not 4096 bytes.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-28 00:40:51 +02:00
Lars-Peter Clausen f855de7575 sr: fx2lafw: Properly free transfer
When freeing a transfer we also have to free the transfer buffer. We also have
to keep track of the number of allocated transfers and if the freed transfer was
the last one stop acquisition. This patch introduces a helper function which
takes care of all of this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-28 00:40:51 +02:00
Lars-Peter Clausen bd47acabe3 sr: fx2lafw: Allocate header and packet struct on the stack
The header and packet struct are only used in the scope of this function and
they are freed at the end of it. Also these structs are rather small, so they
can safely be allocated on the stack. By doing so memory leaks on the error
paths are avoided.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-28 00:40:51 +02:00
Joel Holdsworth 0c156e06c5 fx2lafw: Made libusb_claim_interface error messages more informative 2012-06-28 00:40:48 +02:00
Bert Vermeulen 88a13f30bd hantek-dso: add profiles for all five models in the series
Also cleaned up profile struct, and use the new firmware filenames.
2012-06-27 19:36:30 +02:00
Bert Vermeulen 3b6c19303d fx2lafw: fix broken firmware upload timeout
Also corner case error init.
2012-06-27 01:02:39 +02:00
Bert Vermeulen fc8fe3e314 hantek-dso: get rid of broken GTV_TO_MSEC firmware upload timeout 2012-06-27 01:02:06 +02:00
Bert Vermeulen e749a8cb50 hantek-dso: start sending the frame only from the trigger point
Samples received before the trigger point are stored. From the
trigger point on, every chunk received from the device is sent
up the session bus. After the device has finished sending, the
stored samples are transmitted.
2012-06-26 23:26:55 +02:00
Lars-Peter Clausen fa114e4ab1 sr: fx2lafw: Set correct unitsize for trigger buffer
Commit 88b75eb719 ("fx2lafw: Added device caps and added support for wide
sampling") increased the size of the trigger buffer from 8 to 16 bit, but forgot
to adjust the unitsize logic packet which is used to send the contents of the
trigger buffer. This patch sets the unitsize to sizeof() of the trigger buffer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-25 19:48:21 +02:00
Bert Vermeulen e05a174be2 hantek-dso: fix triggerpoint conversion 2012-06-24 18:57:37 +02:00
Lars-Peter Clausen f3ab43a8fb sr: fx2lafw: Fix multistage trigger
Multistage triggers currently do no work, because there is a return statement
in the middle of the trigger detector which will be hit as soon as the first
stage in a multistage trigger matches. This patch removes the return statement
so that the trigger detector can continue to try to match the next stage. In
order for this to work we also make sure that the trigger stage is only reset
if the current sample does not match.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-24 14:35:26 +02:00
Lars-Peter Clausen eabf24035b sr: fx2lafw: Fix memory leaks in receive_transfer
There are a few memory leaks in the receive_transfer transfer function. The most
serve of them is that a sample buffer is not freed if the triggered has not
matched yet, which causes a sigrok process which is waiting for a trigger to
consume several megabytes of memory within seconds. The other leaks are on the
error paths in that function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-06-22 09:23:30 +02:00
Uwe Hermann 9edfee3ee3 sr: ols: Fix incorrect comment. 2012-06-21 23:59:27 +02:00
Uwe Hermann eb1f1eb407 sr: Unfinished Mastech VA18B (DMM) support. 2012-06-21 23:56:24 +02:00
Uwe Hermann b908f067f2 sr: chronovu-la8: Split code into api.c and driver.c.
We should generally use api.c for API related functions and put the other
functions (mostly hardware-specific low-level code) into other C file(s)
for better readability.
2012-06-21 23:34:38 +02:00
Uwe Hermann 9956f2851f sr: analog: Add MQ and UNIT enums.
MQ is the measured quantity, e.g. voltage, current, temperature.

UNIT is the unit in which these quantities are measured, e.g. volt,
ampere, celsius, kelvin, etc. etc.

The same MQ can be specified in different UNITs by the driver, depending
on what the hardware reports. Conversion is left to the frontends.
2012-06-20 23:55:23 +02:00
Uwe Hermann c13536fa9c sr: backend/zeroplus: Improve debug output. 2012-06-19 23:33:50 +02:00
Bert Vermeulen 6e6eeff47a hantek-dso: capturestate packet also contains the trigger point
Not yet used, but it's the key to knowing where in the frame to
start displaying; the frame is used as a circular buffer, and what
is sent is effectively a snapshot.
2012-06-18 23:09:37 +02:00
Bert Vermeulen a217bcdf10 hantek-dso: relays now set properly
They appear to be arranged to switch on/off a hierarchical series of
devices that attenuate the channel by an order of magnitude.
2012-06-18 23:05:02 +02:00
Uwe Hermann 384c28d9e7 sr: hantek-dso: Use portable g_ntohs() function.
The ntohs() from <arpa/inet.h> is not available on MinGW/Windows. There
are ways to work around this, but as we use glib already, using g_ntohs()
is the best option anyway.
2012-06-14 01:21:00 +02:00
Bert Vermeulen c5841b2809 hantek-dso: calculate voltage based on vdiv setting 2012-06-05 18:18:23 +02:00
Bert Vermeulen a10c805636 hantek-dso: default to DC coupling 2012-06-05 18:18:23 +02:00
Bert Vermeulen 1d97091e71 hantek-dso: fix CH2 vdiv setting 2012-06-05 18:18:23 +02:00
Bert Vermeulen aff5a729ab sr: add unit field to sr_df_analog packet 2012-06-05 18:18:23 +02:00
Uwe Hermann 62bb8840e1 sr: hantek-dso: Consistency renames, constification. 2012-06-01 01:12:09 +02:00
Uwe Hermann 0a88ec3d9c sr: fx2lafw: Use gboolean, cosmetics, fix gcc warning. 2012-05-31 22:48:40 +02:00
Uwe Hermann af36b80969 hantek-dso: Update to constified libsigrok API. 2012-05-31 22:43:12 +02:00
Uwe Hermann 88ff66c2c9 hantek-dso: Quickfix for build issue (will be removed later). 2012-05-31 22:40:41 +02:00
Joel Holdsworth f4575b6549 fx2lafw: Added a check to limit the sample rate during 16-bit sampling 2012-05-31 19:53:36 +01:00
Joel Holdsworth d1ddc7a9a8 fx2lafw: Added device caps and added support for wide sampling 2012-05-31 19:52:32 +01:00
Joel Holdsworth a533743dd1 sr: Made sample rate lists const 2012-05-31 19:51:11 +01:00
Joel Holdsworth 1b79df2f57 sr: Made the dev_config_set parameter a const pointer 2012-05-31 19:51:11 +01:00
Joel Holdsworth b7f578bef5 sr: Made the dev_info_get return value const 2012-05-31 19:51:10 +01:00
Joel Holdsworth 915f7cc87a sr: Made hwcap const 2012-05-31 19:51:09 +01:00
Bert Vermeulen 2715c0b86b hantek-dso: hopefully handle endianness in voltage setting 2012-05-30 23:56:13 +02:00
Bert Vermeulen 4a090d722d hantek-dso: enable SR_HWCAP_COUPLING 2012-05-30 23:56:13 +02:00
Bert Vermeulen b58fbd99c8 hantek-dso: support for SR_HWCAP_COUPLING 2012-05-30 23:56:13 +02:00
Bert Vermeulen 313deed219 hantek-dso: support SR_HWCAP_VDIV 2012-05-30 23:56:12 +02:00
Bert Vermeulen ebb781a69f hantek-dso: support for SR_HWCAP_FILTER 2012-05-30 23:56:12 +02:00
Bert Vermeulen a370ef1916 hantek-dso: support for setting all CMD_SET_TRIGGER_SAMPLERATE params 2012-05-30 23:56:12 +02:00
Bert Vermeulen bc79e906a0 hantek-dso: proper protocol implementation of trigger/samplerate setting 2012-05-30 23:56:12 +02:00
Bert Vermeulen 6e71ef3b6f hantek-dso: fix channel selection 2012-05-30 23:56:12 +02:00
Bert Vermeulen ae88b97ba2 hantek-dso: delimit frames with SR_DF_FRAME_* packets 2012-05-30 23:56:12 +02:00
Bert Vermeulen 3b533202c8 sr: initial support for Hantek 2xxx/5200 USB oscilloscopes 2012-05-30 23:56:12 +02:00
Bert Vermeulen f366e86c68 sr: change all drivers to use SR_DF_META_LOGIC 2012-05-30 23:55:36 +02:00
Uwe Hermann 7e41e319d9 sr: fx2lafw: Forgot to add (C) line to fx2lafw.h in recent commit. 2012-05-30 23:31:03 +02:00
Uwe Hermann 0a8c0c324e sr: fx2lafw: Only check for correct major FW version.
Changes in the minor version number are OK, as those should never
contain any incompatible/API changes.
2012-05-30 23:23:14 +02:00
Uwe Hermann 8fdecced96 sr: Consistently use ZEROPLUS spelling.
This is the version used throughout their website, let's use it.
2012-05-30 23:23:14 +02:00
Uwe Hermann 921634ec10 sr: Fix typos. 2012-05-30 22:42:47 +02:00
Uwe Hermann cf94c8167b sr: fx2lafw: Add (C) line from old saleae driver it's based on. 2012-05-30 22:42:45 +02:00
Uwe Hermann f60fdf6ebe sr: fx2lafw: s/MAX_RENUM_DELAY/MAX_RENUM_DELAY_MS/. 2012-05-30 09:30:50 +02:00
Uwe Hermann e8bd58ffd2 sr: fx2lafw: Fix a firmware upload bug on 32bit systems.
The glib GTimeVal data type (and some functions using it) will be faded
out from glib sooner or later, so it's not a good idea to use them anyway.

In this specific case GTimeVal.tv_sec was overflowing, leading a check in
libsigrok to fail, and thus to FX2 firmware upload errors, i.e.
non-working fx2lafw devices.

  http://thread.gmane.org/gmane.comp.debugging.sigrok.devel/166

The root cause is that GTimeVal.tv_sec is a 'glong' (8 bytes on 64bit
systems, but only 4 on 32bit systems).

We now use an int64_t (and g_get_monotonic_time() instead of the more
problematics g_get_current_time() which uses a GTimeVal).

This has been verified to fix the issue on a 32bit system.

Other uses of GTimeVal in libsigrok will be removed in a later release.

Also, drop unneeded GTV_TO_MSEC.
2012-05-30 09:30:18 +02:00
Uwe Hermann 9f05304e4e sr: ARMFLY AX-Pro is supported by fx2lafw (LA only). 2012-05-29 20:25:08 +02:00
Uwe Hermann 37dc0b16a6 fx2lafw: Cosmetics. 2012-05-11 00:22:30 +02:00
Joel Holdsworth dc68c660d5 fx2lafw: Added a gpif delay debug message 2012-05-10 13:11:07 +01:00
Joel Holdsworth 79dc64985f fx2lafw: Added support for 20kHz and 25kHz sampling 2012-05-10 13:10:59 +01:00
Joel Holdsworth 897c1a2ee5 fx2lafw: Added support for 100kHz and 50kHz sampling 2012-05-10 13:08:09 +01:00
Uwe Hermann 1e94408ae5 sr: fx2lafw: Get/display FX2 REVID. 2012-05-06 19:54:46 +02:00
Uwe Hermann 1663e4706c sr: fx2lafw: Braintechnology USB-LPS support. 2012-05-06 17:24:40 +02:00
Uwe Hermann 6352d030df sr: We support both SIGMA and SIGMA2.
Also, a few minor coding-style fixes etc.
2012-05-03 01:41:02 +02:00
Bert Vermeulen 6b73d9a598 fx2lafw: use iManufacturer/iProduct fields to identify our firmware
It's more deterministic than the endpoint profile check we did before. Which
was also broken.
2012-04-27 01:28:47 +02:00
Uwe Hermann 6752905e6b sr: zeroplus: Fix segfault, add debug output.
There are various ZEROPLUS models with different probe numbers. For now
hardcode to 16 (for the popular LAP-C(16032)). This will need to be
fixed in a dynamic way later.

This fixes a segfault due to only 16 probe-names being defined, but the
drivers returning 32 as probecount.

Also, add some additional debug output.
2012-04-26 23:18:05 +02:00
Bert Vermeulen 993526f824 sr: don't use deprecated glib functions
As of the recent glib 2.32 release, these produce deprecation warnings
at compile time.
2012-04-23 15:31:41 +02:00
Håvard Espeland 42cdeef626 sigma: Fix segfault when no Sigma present. 2012-04-23 13:36:17 +02:00
Håvard Espeland 868501fa46 sigma: Bump copyright notice. 2012-04-22 15:10:46 +02:00
Håvard Espeland e210c6c090 sr: Remove zlib dependency.
No longer needed by Sigma driver.
2012-04-22 14:59:10 +02:00
Håvard Espeland e3fff420da sigma: Add support for SIGMA2 (req. new firmware). 2012-04-22 14:59:10 +02:00
Håvard Espeland 3c36c403fa sigma: Use heap for datafeed packet and header. 2012-04-22 14:59:10 +02:00
Håvard Espeland 805919b042 sigma: Fix bugs in receive_data callback.
- Poll data position on Sigma for every iteration.
- Return TRUE when no data ready.
2012-04-22 14:59:10 +02:00
Uwe Hermann 934cde02b8 fx2lafw: supported_samplerates[] should be 0-terminated. 2012-04-19 00:55:29 +02:00
Joel Holdsworth f488762a17 fx2lafw: Added support for default Cypess FX2 without EEPROM 2012-04-19 00:12:22 +02:00
Joel Holdsworth 824b1a8f5c sr: Deleted the saleae-logic driver, fx2lafw has superceded it. 2012-04-19 00:12:22 +02:00
Joel Holdsworth 9304d57650 fx2lafw: Added slower sample rates 2012-04-18 19:07:39 +01:00
Uwe Hermann 0aeb0ccd55 sr: sr_err() et. al. don't need trailing \n. 2012-04-10 23:25:57 +02:00
Uwe Hermann 44dfd483db sr: fx2lafw: Cosmetics. 2012-04-10 22:32:31 +02:00
Joel Holdsworth 13bf7eccbb fx2lafw: Added command to verify firmware version 2012-04-10 18:27:24 +01:00
Joel Holdsworth 6fbe5e6081 fx2lafw: Safer use of libusb_get_device_list 2012-04-08 17:19:52 +01:00
Uwe Hermann da68656857 sr: fx2lafw: Consistency fixes. 2012-03-31 11:33:43 +02:00
Uwe Hermann 7ae2f9d56f sr: fx2lafw: Cosmetics. 2012-03-28 01:19:28 +02:00
Uwe Hermann b04902b646 sr: fx2lafw: Use SR_PRIV where needed. 2012-03-28 01:19:28 +02:00
Uwe Hermann 30da9658ad sr: fx2lafw: command.h: Add missing include guards. 2012-03-28 01:19:28 +02:00
Uwe Hermann f4a9e5c0aa sr: fx2lafw: Cosmetics. 2012-03-28 01:19:27 +02:00
Joel Holdsworth 94c26b08fd sr: Build ezusb.c for fx2lafw as well as saleae-logic 2012-03-25 19:42:37 +01:00
Joel Holdsworth ec888f62fe salae: Only terminate session after all transfers have been aborted 2012-03-25 19:42:37 +01:00
Joel Holdsworth 3e6292b296 fx2lafw: Made finish_acquisition a static function 2012-03-25 19:42:37 +01:00
Uwe Hermann 590b9f9a91 sr: Fix some samplerate fields. 2012-03-24 22:32:47 +01:00
Joel Holdsworth cb61e9f7c3 fx2lafw: Only terminate session after all transfers have been aborted 2012-03-24 10:09:28 +00:00
Joel Holdsworth 24125e0520 fx2lafw: Removed a line of redundant code 2012-03-24 10:07:58 +00:00
Joel Holdsworth 6c6781b6a7 fx2lafw: Imported software triggering from fx2lafw 2012-03-21 22:47:25 +00:00
Uwe Hermann 2e7cb0040a cli: Fix -V/-h output a bit.
Options and their defaults should not be documented there, but rather in
the manpage or such.
2012-03-21 23:20:09 +01:00
Uwe Hermann eb0a373189 sr/cli: s/patternmode/pattern/ in a few places. 2012-03-21 23:20:07 +01:00
Uwe Hermann ebc3473882 sr: s/err/ret/ for consistency.
We use ret, err, error, and others for return codes of functions.
Standardize on 'ret' for consistency reasons for now.
2012-03-21 23:20:06 +01:00
Bert Vermeulen 21b50ee183 Merge remote-tracking branch 'joel/public' 2012-03-16 00:04:51 +01:00
Joel Holdsworth ecc16ed070 fx2lafw: Upped NUM_SIMUL_TRANSFERS to 32 2012-03-14 22:56:15 +00:00
Uwe Hermann 455b26edba sr: demo: s/struct databag/struct context/. 2012-03-14 22:44:30 +01:00
Uwe Hermann ab331b679c sr: demo: s/mydata/ctx/. 2012-03-14 22:44:29 +01:00
Uwe Hermann 4101f961e8 sr: s/SR_{USB,SERIAL}_INST/SR_INST_{USB,SERIAL}/. 2012-03-14 22:44:29 +01:00
Joel Holdsworth 4502e86921 fx2lafw: Added CWAV USBee SX to the device list 2012-03-12 21:49:34 +00:00
Joel Holdsworth 0ca21631dd fx2lafw: Corrected a comment 2012-03-12 21:47:45 +00:00
Joel Holdsworth 93a9f3daaf fx2lafw: Added Saleae Logic (and clones) to the device list 2012-03-12 21:47:44 +00:00
Joel Holdsworth f8b07fc6c3 fx2lafw: Moved firmware path into fx2lafw_profile 2012-03-12 21:41:28 +00:00
Joel Holdsworth 4679d14db3 fx2lafw: Made fx2lafw profiles const 2012-03-12 21:41:27 +00:00
Joel Holdsworth 6ccfadaf66 fx2lafw: Made string pointers constant 2012-03-12 21:39:02 +00:00
Joel Holdsworth 17b6c75a89 fx2lafw: Added ESLA201A to device list 2012-03-12 21:38:57 +00:00
Joel Holdsworth 017375d17e fx2lafw: Send start command after bulk transfer have been set up 2012-03-11 20:59:39 +00:00
Matt Ranostay 13d0d2698c ols: fixed *ctx null dereferences that would SEGFAULT on probing for a OLS or attempting to read from it.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
2012-03-08 22:27:33 -08:00
Joel Holdsworth 9031ce63f3 fx2lafw: Corrected check_conf_profile checks 2012-03-07 07:52:05 +00:00
Joel Holdsworth dba024420f fx2lafw: Implemented control of sample rates 2012-03-07 07:52:05 +00:00
Joel Holdsworth f92994fd91 fx2lafw: Ensure default sample rate is set 2012-03-07 07:52:05 +00:00
Joel Holdsworth d98c4e35ce fx2lafw: Removed CMD_STOP and renumbered commands 2012-03-07 07:52:05 +00:00
Joel Holdsworth 2e526f4a6a fx2lafw: Moved num_samples into context struct 2012-03-07 07:52:05 +00:00
Joel Holdsworth 266784d594 saleae-logic: Moved num_samples into context struct 2012-03-07 07:52:05 +00:00