Commit Graph

107 Commits

Author SHA1 Message Date
Uwe Hermann ff08a52a0f Fix two minor compiler warnings. 2013-04-12 17:45:01 +02:00
Bert Vermeulen a9ed6877f7 link-mso19: Adjust to GVariant-based sr_config_* functions 2013-04-11 18:32:07 +02:00
lelazary 365f04d61f mso-19: Initial analog probe support (unfinished).
- Added the analog probe (unfinished).

 - Reset trigger to state to 0 before capture, just incase the scope is in
   the middle of a capture.
2013-03-03 17:59:06 +01:00
lelazary 5952553f56 mso-19: Fixed warning. 2013-03-03 17:58:46 +01:00
Uwe Hermann 3e9b7f9c77 Rename session_dev_id to cb_data everywhere.
We use 'cb_data' in all drivers these days, make the few remaining ones
that use 'session_dev_id' consistent.
2013-02-07 11:26:02 +01:00
Uwe Hermann 4afdfd4628 Add and use std_session_send_df_header().
This is a small helper function which sends the SR_DF_HEADER packet that
drivers usually emit in their hw_dev_acquisition_start() API callback.
It simplifies and shortens the hw_dev_acquisition_start() functions
quite a bit.

It also simplifies the input modules which send an SR_DF_HEADER packet, too.

This patch also automatically removes some unneeded malloc/free in some
drivers for the 'packet' and 'header' structs used for SR_DF_HEADER.
2013-02-07 10:46:28 +01:00
Uwe Hermann 0e94d524c1 Shorten/simplify hw_dev_list() implementations. 2013-02-05 18:27:05 +01:00
Uwe Hermann d3b38ad389 Drivers: Explicitly list sr_samplerates fields.
This makes it a bit easier to understand which value means what, just
from looking at the driver code.
2013-01-29 12:56:02 +01:00
Uwe Hermann 063e7aef6d Factor out common hw_init() driver code.
Most drivers do pretty much the same things in their hw_init()
right now, so factor out that code to std_hw_init() in std.c.
2013-01-29 12:56:02 +01:00
Bert Vermeulen 9a6517d14b Deprecate SR_DI_HWCAPS.
This is replaced by SR_CONF_DEVICE_OPTIONS.
2013-01-25 15:01:49 +01:00
Bert Vermeulen c50277a6ec Deprecate SR_DI_TRIGGER_TYPES.
This is replaced by SR_CONF_TRIGGER_TYPE.
2013-01-25 11:52:27 +01:00
Bert Vermeulen 123e131383 Deprecate SR_DI_CUR_SAMPLERATE.
This is replaced by SR_CONF_SAMPLERATE.
2013-01-25 03:17:36 +01:00
Bert Vermeulen fbec8bd2f3 deprecate SR_DI_SAMPLERATES
This is replaced by a call to config_list() with id SR_CONF_SAMPLERATE.
2013-01-25 02:39:58 +01:00
Bert Vermeulen a1c743fc51 drivers: implement config_list() 2013-01-25 02:37:26 +01:00
Bert Vermeulen 035a1078fd drivers: rename and reorganize config get/set
The driver API calls info_get() and dev_config_set() have been renamed
to config_get() and config_set(), respectively.
2013-01-24 19:19:09 +01:00
Bert Vermeulen 1953564a96 Rename SR_HWOPT_* and SR_HWCAP_* to SR_CONF_* 2013-01-21 23:32:50 +01:00
Bert Vermeulen 1987b8d63e drivers: use new sr_config struct
Sending an SR_DF_META packet at the start of every stream is not
mandatory; the frontend should ask for what it needs, and any extra
information the driver wants to send will come in due time.
2013-01-21 23:32:49 +01:00
Bert Vermeulen 6b8d6f93bb Get rid of obsolete SR_DI_NUM_PROBES and SR_DI_PROBE_NAMES.
Frontends should use the probe list in the device's sr_dev_inst
to get this information.
2013-01-15 17:42:23 +01:00
Uwe Hermann a24e9d0484 link-mso19: Use more portable g_htons().
Not all systems provide <arpa/inet.h> and/or htons(). Use portable and
always available g_htons() from glib instead.
2013-01-08 03:13:45 +01:00
Uwe Hermann 753d722f34 link-mso19: Fix a bunch of compiler warnings. 2013-01-08 03:13:14 +01:00
Uwe Hermann 00b44ccb8b link-mso19: Fix white-space, cosmetics, coding-style.
Fix the bare minumum of whitespace/indentation/coding-style via
automatic 'indent' run, followed by some minor manual fixes.
Some more fixes and cleanups might follow later.
2013-01-08 03:13:08 +01:00
Uwe Hermann f48cef7897 link-mso19: Fix (C) lines.
Bring back the original (C) lines from before the split into api.c
and protocol.[ch].

Add "Copyright (C) 2013 Lior Elazary <lelazary@yahoo.com>" since there
were nontrivial changes to those files.
2013-01-08 02:30:40 +01:00
lelazary eb913174ab Added limit samples Eveything seems to work find up to 1024 samples 2013-01-08 01:00:14 +01:00
lelazary 087a9161ff Rewrote the trigger config. Added trigger position and trigger slope 2013-01-08 01:00:14 +01:00
lelazary 5a24e89ca4 Eveything seems to work now except for triggers. 2013-01-08 01:00:14 +01:00
lelazary 4db2aaffe7 More cleanup. Communication with mso19 is working, but its not triggering. Need to check why. 2013-01-08 01:00:13 +01:00
lelazary 4b719338cc Added missing mso functions 2013-01-08 01:00:13 +01:00
lelazary def5c35c4c Removing the old link-mso19 files and changing makefile 2013-01-08 01:00:13 +01:00
lelazary df92e5cf6b Rewrote the link-mso19.c into api and protocol. Still need to test and cleanup some more 2013-01-08 01:00:13 +01:00
Uwe Hermann 7869340103 Shorten probe_names[] arrays everywhere.
Also, NULL-terminate all of them.
2012-12-26 00:16:07 +01:00
Peter Stuge 34f06b903e Add a struct sr_context * parameter to hw_init() 2012-12-03 12:07:40 +01:00
Uwe Hermann a54dd31e38 serial: Use OS-independent flags for serial port opening.
Add SERIAL_RDWR, SERIAL_RDONLY, and SERIAL_NONBLOCK (for now), which are
mapped to the respective OS-specific mechanism in serial_open().
2012-12-02 12:45:54 +01:00
Uwe Hermann 64d33dc28e All drivers: Drop unneeded comments. 2012-11-11 18:09:11 +01:00
Uwe Hermann 56eb9f95ba link-mso19: Use message logging helpers. 2012-11-10 19:42:37 +01: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
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
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
Uwe Hermann 590b9f9a91 sr: Fix some samplerate fields. 2012-03-24 22:32:47 +01:00
Uwe Hermann 4101f961e8 sr: s/SR_{USB,SERIAL}_INST/SR_INST_{USB,SERIAL}/. 2012-03-14 22:44:29 +01:00
Uwe Hermann 0abee5076f sr: Fix some TODOs, improve comments/docs. 2012-03-04 15:10:12 +01:00
Uwe Hermann 3cd3a20b35 sr: More callback param renames.
Start/stop acquisition callbacks: Consistently name the 'void *' parameter
cb_data for now. The per-device-instance device pointer is called
'session_dev_id' everywhere for now, but this should be renamed to
something more clear.
2012-03-04 15:10:09 +01:00
Uwe Hermann 1f9813eb6c sr: Name all callback data 'cb_data'. 2012-03-02 02:25:42 +01:00
Uwe Hermann 31ccebc492 sr: s/sr_session_bus/sr_session_send/. 2012-03-01 23:49:25 +01:00
Uwe Hermann c09f0b578c sr/cli/gtk/qt/: s/plugin/driver/. 2012-02-28 23:52:30 +01:00
Uwe Hermann d261dbbfcc sr: Fix/document probe names. 2012-02-28 01:09:29 +01:00
Uwe Hermann ea9cfed7a5 sr: Consistent ctx name for per-dev-inst context. 2012-02-18 18:07:42 +01:00