Commit Graph

48 Commits

Author SHA1 Message Date
Bert Vermeulen e9022f596d sr: make struct drv_context global 2012-09-11 21:27:26 +02:00
Bert Vermeulen 19b0cce312 hantek-dso: use default libusb context 2012-09-11 21:16:16 +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 a3508e33f9 hantek-dso: remove sources from session when done 2012-08-03 11:29:01 +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 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 2ce9f04629 hantek-dso: don't use deprecated hwcap_get_all() driver API call 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 0b79bcbb9d hantek-dso: use new driver info_get() API call 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 f8c617cf4c hantek-dso: instance list fix 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 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
Uwe Hermann 99f5d45ecc sr: hantek-dso: Fix copy-paste error. 2012-06-28 01:47:38 +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 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
Bert Vermeulen e05a174be2 hantek-dso: fix triggerpoint conversion 2012-06-24 18:57:37 +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
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 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
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