sigrok:sigrok.git
5 years agogenericdmm: use new scan API
Bert Vermeulen [Sun, 8 Jul 2012 21:49:04 +0000 (23:49 +0200)]
genericdmm: use new scan API

5 years agogenericdmm: more flexible device discovery
Bert Vermeulen [Sun, 8 Jul 2012 21:48:04 +0000 (23:48 +0200)]
genericdmm: more flexible device discovery

5 years agogenericdmm: use driver struct-based device instance list
Bert Vermeulen [Sun, 8 Jul 2012 21:33:48 +0000 (23:33 +0200)]
genericdmm: use driver struct-based device instance list

5 years agofx2lafw: use driver struct-based device instance list
Bert Vermeulen [Sun, 8 Jul 2012 17:07:38 +0000 (19:07 +0200)]
fx2lafw: use driver struct-based device instance list

5 years agofx2lafw: use new instance-based probe list
Bert Vermeulen [Sun, 8 Jul 2012 17:06:23 +0000 (19:06 +0200)]
fx2lafw: use new instance-based probe list

5 years agofx2lafw: use new init/scan API
Bert Vermeulen [Sun, 8 Jul 2012 17:03:36 +0000 (19:03 +0200)]
fx2lafw: use new init/scan API

5 years agosr: add GSList of instances to the driver struct
Bert Vermeulen [Sun, 8 Jul 2012 14:40:54 +0000 (16:40 +0200)]
sr: add GSList of instances to the driver struct

This gives the driver a private place to keep its instances, without
polluting the global namespace.

5 years agosr: add probe list to device instance
Bert Vermeulen [Sun, 8 Jul 2012 14:37:39 +0000 (16:37 +0200)]
sr: add probe list to device instance

There is no point in libsigrok copying probe lists around. The driver now
builds a list of probes according to the model device it found, and will
make that available to a frontend. The frontend thus has a reference of
what the driver has, including default names, and doesn't need libsigrok
to provide an unnecessary level of abstraction.

The sr_probe_new() library-private function is a helper for drivers.

5 years agosr: split driver init into init() and scan()
Bert Vermeulen [Sun, 8 Jul 2012 14:25:23 +0000 (16:25 +0200)]
sr: split driver init into init() and scan()

init() now only does whatever administrative stuff it needs (typically not
much), and returns an error code.

scan() can be called multiple times during the life of an application, and
returns a GSList of struct sr_dev_inst * of devices found during that scan.
The instances are a copy of the ones stored in the driver's own instance
list, to be freed by the caller with g_slist_free() only.

The scan() call can be passed a GSList of struct sr_hwopt *, to direct the
scanning.

5 years agosr: move SR_HWOPT into its own enum, and create struct sr_hwopt
Bert Vermeulen [Sun, 8 Jul 2012 12:56:54 +0000 (14:56 +0200)]
sr: move SR_HWOPT into its own enum, and create struct sr_hwopt

SR_HWOPT_* entries are driver options, not device instance parameters, so
they will never be mixed together.

Also, driver options are always passed in a GSList, where the data field
is a struct sr_hwopt.

5 years agogenericdmm: better subdriver API arguments
Bert Vermeulen [Sun, 8 Jul 2012 02:17:56 +0000 (04:17 +0200)]
genericdmm: better subdriver API arguments

5 years agogenericdmm/fs9922: no initialization needed
Bert Vermeulen [Sun, 8 Jul 2012 02:15:51 +0000 (04:15 +0200)]
genericdmm/fs9922: no initialization needed

5 years agogenericdmm: allow for default options in DMM profiles
Bert Vermeulen [Sun, 8 Jul 2012 02:09:55 +0000 (04:09 +0200)]
genericdmm: allow for default options in DMM profiles

Much better than the special-cased USB vid.pid

5 years agogenericdmm: use vid.pid as USB conn spec
Bert Vermeulen [Sun, 8 Jul 2012 02:01:04 +0000 (04:01 +0200)]
genericdmm: use vid.pid as USB conn spec

: is just too hard for the CLI

5 years agogenericdmm: fix header guard
Bert Vermeulen [Sun, 8 Jul 2012 01:59:58 +0000 (03:59 +0200)]
genericdmm: fix header guard

5 years agosr: add new driver API call: scan()
Bert Vermeulen [Thu, 5 Jul 2012 09:27:48 +0000 (11:27 +0200)]
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.

5 years agosr: remove unused argument from hardware driver function init()
Bert Vermeulen [Tue, 3 Jul 2012 10:55:46 +0000 (12:55 +0200)]
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.

5 years agosr: fix gnuplot script for USBee DX and clones
Ivan Fedorov [Thu, 2 Aug 2012 21:31:36 +0000 (01:31 +0400)]
sr: fix gnuplot script for USBee DX and clones

 - Now channels order is right
 - Added 16bit version

5 years agosr: fx2lafw: Add 16bit support for USBee DX and clones
Ivan Fedorov [Thu, 2 Aug 2012 19:49:00 +0000 (23:49 +0400)]
sr: fx2lafw: Add 16bit support for USBee DX and clones

gnuplot script support only 8 channels

5 years agosr: add gnuplot script for USBee DX and clones
Ivan Fedorov [Tue, 31 Jul 2012 20:11:40 +0000 (00:11 +0400)]
sr: add gnuplot script for USBee DX and clones

5 years agosr: fx2lafw: Add basic support for USBee DX and clones
Ivan Fedorov [Tue, 31 Jul 2012 20:11:33 +0000 (00:11 +0400)]
sr: fx2lafw: Add basic support for USBee DX and clones

5 years agosr: always use uint64_t for samplerate
Bert Vermeulen [Sun, 29 Jul 2012 00:45:40 +0000 (02:45 +0200)]
sr: always use uint64_t for samplerate

5 years agosr: extra checks for properly handling driverless devices
Bert Vermeulen [Sun, 29 Jul 2012 00:15:34 +0000 (02:15 +0200)]
sr: extra checks for properly handling driverless devices

5 years agosr: fix struct sr_input for parameter passing
Bert Vermeulen [Sun, 29 Jul 2012 00:13:22 +0000 (02:13 +0200)]
sr: fix struct sr_input for parameter passing

5 years agoAllow setting samplerate when reading binary files
Tomaž Šolc [Wed, 4 Jul 2012 14:29:13 +0000 (16:29 +0200)]
Allow setting samplerate when reading binary files

I had a binary file that I needed to decode using UART decoder. UART
decoder needs to know the sample rate for the data, but currently it's
not possible to pass parameters to input formats and so the "binary"
file format always sets the samplerate to 0.

This patch adds the possibility to append a colon-separated list of
key=value options to the -I argument, in the same way -d supports it.
Also, it makes the "binary" format support the "samplerate" option.

I included the GHashTable containing input format options directly in
the sr_input struct. I'm not sure if that's the right way to do it. I
saw that -d uses a much more elaborate system with device capabilities
and typed options, but that seemed like an overkill for input formats.

5 years agosrd: lm75: s/degrees Kelvin/Kelvin/.
Uwe Hermann [Sat, 28 Jul 2012 16:14:21 +0000 (18:14 +0200)]
srd: lm75: s/degrees Kelvin/Kelvin/.

The temperature unit is nowadays called just "Kelvin", not
"degrees Kelvin" (even though this was not always the case).

5 years agosrd: avr_isp: Improve Chip Erase handling.
Uwe Hermann [Sat, 28 Jul 2012 15:39:38 +0000 (17:39 +0200)]
srd: avr_isp: Improve Chip Erase handling.

5 years agosrd: avr_isp: Factor out part numbers/names to part.py.
Uwe Hermann [Sat, 28 Jul 2012 08:51:32 +0000 (10:51 +0200)]
srd: avr_isp: Factor out part numbers/names to part.py.

5 years agosrd: Initial decoder for AVR ISP protocol.
Uwe Hermann [Thu, 26 Jul 2012 16:55:02 +0000 (18:55 +0200)]
srd: Initial decoder for AVR ISP protocol.

5 years agosr: chronovu-la8: fix segfault on discovery
Bert Vermeulen [Mon, 23 Jul 2012 22:50:02 +0000 (00:50 +0200)]
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.

5 years agosrd: onewire_link: Annotations shouldn't be ALLCAPS.
Uwe Hermann [Sat, 21 Jul 2012 19:58:20 +0000 (21:58 +0200)]
srd: onewire_link: Annotations shouldn't be ALLCAPS.

While states in the PD should be ALLCAPS per guidelines (for
consistency), the annotations that a PD outputs (and are shown in a
console via sigrok-cli or in a GUI) should be "normal" human-readable
text/formatting usually, i.e. not ALLCAPS.

5 years agosrd: maxim_ds28ea00: Factor out putx(), small fixes.
Uwe Hermann [Sat, 21 Jul 2012 19:31:04 +0000 (21:31 +0200)]
srd: maxim_ds28ea00: Factor out putx(), small fixes.

5 years agosrd: maxim_ds28ea00: Cosmetics, cleanups.
Uwe Hermann [Sat, 21 Jul 2012 19:21:51 +0000 (21:21 +0200)]
srd: maxim_ds28ea00: Cosmetics, cleanups.

5 years agosrd: maxim_ds28ea00: Fix to only handle DS28EA00.
Uwe Hermann [Sat, 21 Jul 2012 19:04:20 +0000 (21:04 +0200)]
srd: maxim_ds28ea00: Fix to only handle DS28EA00.

5 years agosrd: Rename onewire_transport to maxim_ds28ea00.
Uwe Hermann [Sat, 21 Jul 2012 18:37:41 +0000 (20:37 +0200)]
srd: Rename onewire_transport to maxim_ds28ea00.

It doesn't make sense to have one "generic" onewire_transport PD, as
this layer is very much device-specific and such a generic PD would
have to contain an accumulation of all possible features and commands
and handling code of all existing (now and in the future) 1-Wire
devices, which is neither possible nor useful nor elegant.

There are (for example) 1-Wire thermometers, RTCs, EEPROMs,
special-purpose security chips with passwords/keys, battery monitoring
chips, and many many others. They all have a different set of features,
commands and command codes, RAM areas/sizes/partitioning/contents,
protocols, and so on.

Thus, the layering for 1-Wire PD stacks should look like this:

 onewire_link -> onewire_network -> <specificdevice>

Examples:

 onewire_link -> onewire_network -> maxim_ds28ea00 (special thermometer)
 onewire_link -> onewire_network -> maxim_ds2431 (1kbit EEPROM)
 onewire_link -> onewire_network -> maxim_ds2417 (RTC)
 onewire_link -> onewire_network -> maxim_ds2762 (battery monitor)
 onewire_link -> onewire_network -> maxim_ds1961s (SHA-1 eCash iButton)
 and so on...

So, renaming onewire_transport to maxim_ds28ea00. The non-DS28EA00
specific code will be dropped and/or moved to other PDs on top of
onewire_network later.

5 years agosrd: onewire_network: Fix typo, command is 0x69.
Uwe Hermann [Sat, 21 Jul 2012 18:36:07 +0000 (20:36 +0200)]
srd: onewire_network: Fix typo, command is 0x69.

The 'Overdrive match ROM' command is 0x69, not 0x6d. Verified in various
datasheets and the original 1-Wire/iButton spec.

5 years agosrd: onewire_link/network: Fix annotations, small cleanups.
Uwe Hermann [Sat, 21 Jul 2012 17:16:16 +0000 (19:16 +0200)]
srd: onewire_link/network: Fix annotations, small cleanups.

The annotation types are 'Text' and 'Warnings', not 'Link' etc. as the
annotations of the onewire_link PD (for example) are already clearly
from the link layer. The annotation types should be different things/formats
of a specific PD's annotation output instead (like "Celsius" / "Kelvin"
for some temperature sensor, for example).

5 years agosrd: onewire_link/network: Reduce nesting level.
Uwe Hermann [Thu, 19 Jul 2012 19:40:40 +0000 (21:40 +0200)]
srd: onewire_link/network: Reduce nesting level.

Also, some additional cleanups.

5 years agosrd: onewire_network: Cosmetics, simplifications, doc fixes.
Uwe Hermann [Thu, 19 Jul 2012 19:26:50 +0000 (21:26 +0200)]
srd: onewire_network: Cosmetics, simplifications, doc fixes.

5 years agosrd: onewire_link: Cosmetics, simplifications, doc fixes.
Uwe Hermann [Wed, 18 Jul 2012 20:16:19 +0000 (22:16 +0200)]
srd: onewire_link: Cosmetics, simplifications, doc fixes.

5 years agoonewire: fixed an issue caused by renaming a transport layer command
Iztok Jeras [Tue, 17 Jul 2012 19:50:08 +0000 (21:50 +0200)]
onewire: fixed an issue caused by renaming a transport layer command

5 years agoonewire: added new transport layer commands
Iztok Jeras [Tue, 17 Jul 2012 19:42:53 +0000 (21:42 +0200)]
onewire: added new transport layer commands

5 years agoonewire: updated documentation
Iztok Jeras [Tue, 17 Jul 2012 17:33:44 +0000 (19:33 +0200)]
onewire: updated documentation

6 years agoonewire: added transport layer decoder, it does not do much for now
Iztok Jeras [Sun, 15 Jul 2012 15:46:20 +0000 (17:46 +0200)]
onewire: added transport layer decoder, it does not do much for now

6 years agoonewire: updates to link layer timing
Iztok Jeras [Fri, 13 Jul 2012 21:55:44 +0000 (23:55 +0200)]
onewire: updates to link layer timing

6 years agoonewire: combined reset and presence detect events, avoid unneeded overdrive exit...
Iztok Jeras [Fri, 13 Jul 2012 20:59:12 +0000 (22:59 +0200)]
onewire: combined reset and presence detect events, avoid unneeded overdrive exit message

6 years agoonewire: the split of the protocol into layers works now
Iztok Jeras [Tue, 10 Jul 2012 21:14:35 +0000 (23:14 +0200)]
onewire: the split of the protocol into layers works now

6 years agoonewire: placing protocol layers into separate directories
Iztok Jeras [Tue, 10 Jul 2012 20:06:58 +0000 (22:06 +0200)]
onewire: placing protocol layers into separate directories

6 years agoonewire: preparations for protocol separation between link and network layers
Iztok Jeras [Mon, 9 Jul 2012 21:29:34 +0000 (23:29 +0200)]
onewire: preparations for protocol separation between link and network layers

6 years agosr: la8: Support for newer USB VID/PID of the device.
Uwe Hermann [Sat, 14 Jul 2012 22:34:27 +0000 (00:34 +0200)]
sr: la8: Support for newer USB VID/PID of the device.

Thanks to Jerry Jacobs for the patch!

6 years agoqt: Partial fix for sample acquisition and display.
Uwe Hermann [Thu, 12 Jul 2012 14:51:18 +0000 (16:51 +0200)]
qt: Partial fix for sample acquisition and display.

6 years agoqt: Fix a segfault.
Uwe Hermann [Thu, 12 Jul 2012 22:00:47 +0000 (00:00 +0200)]
qt: Fix a segfault.

Add missing 'static' for the header field to fix a segfault.

6 years agosr: la8: Drop useless cast.
Uwe Hermann [Thu, 12 Jul 2012 19:39:18 +0000 (21:39 +0200)]
sr: la8: Drop useless cast.

6 years agosr: Add sr_strerror() and sr_strerror_name().
Uwe Hermann [Thu, 12 Jul 2012 19:30:49 +0000 (21:30 +0200)]
sr: Add sr_strerror() and sr_strerror_name().

6 years agoqt: Use sr_session_stop() instead of sr_session_halt()
Lars-Peter Clausen [Thu, 5 Jul 2012 19:15:12 +0000 (21:15 +0200)]
qt: Use sr_session_stop() instead of sr_session_halt()

Use sr_session_stop() instead of the deprecated sr_session_halt().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agogtk: Use sr_session_stop() instead of sr_session_halt()
Lars-Peter Clausen [Thu, 5 Jul 2012 19:15:11 +0000 (21:15 +0200)]
gtk: Use sr_session_stop() instead of sr_session_halt()

Use sr_session_stop() instead of the deprecated sr_session_halt().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agocli: Use sr_session_stop() instead of sr_session_halt()
Lars-Peter Clausen [Thu, 5 Jul 2012 19:15:10 +0000 (21:15 +0200)]
cli: Use sr_session_stop() instead of sr_session_halt()

Use sr_session_stop() instead of the deprecated sr_session_halt().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agosr: session: Deprecate sr_session_halt()
Lars-Peter Clausen [Thu, 5 Jul 2012 19:15:09 +0000 (21:15 +0200)]
sr: session: Deprecate sr_session_halt()

sr_session_halt() in its current state is kind of useless and even dangerous.
All it will do is mark the session as not running, but wont signal the devices
to stop to capture data. This is not so much of a problem with the blocking
sr_session_run(), but once there is support for asynchronous data acquisition by
attaching the session sources to the applications mainloop sr_session_halt()
basically becomes a no-op. sr_session_stop() already does what needs to be done,
marking the session as not running and signal the devices to stop acquisition,
so make sr_session_halt() an alias for sr_session_stop() and deprecate its
usage.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agosr: session: Do not cleanup the driver state in sr_session_stop()
Lars-Peter Clausen [Thu, 5 Jul 2012 19:15:08 +0000 (21:15 +0200)]
sr: session: Do not cleanup the driver state in sr_session_stop()

By cleaning up the driver state all devices will become inaccessible, which
means that is neither possible to query any information from it (like sample
rate) and it is also not possible to restart data acquisition.

sr_session_save() tries to query the sample rate from the device, as a result
calling sr_session_save() after calling sr_session_stop() - which is for example
done by sigrok-cli - will cause a segfault. This patch resolves the issue.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agosr: session: Close a device when it is removed from a session
Lars-Peter Clausen [Thu, 5 Jul 2012 19:15:07 +0000 (21:15 +0200)]
sr: session: Close a device when it is removed from a session

A device is opened when it is added to a session, in the same fashion it should
be closed again when it is removed from a session.

Also remove all still attached devices from a session when the session is
destroyed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agosrd: Drop 'usb' PD, replaced by two others.
Uwe Hermann [Wed, 11 Jul 2012 20:27:07 +0000 (22:27 +0200)]
srd: Drop 'usb' PD, replaced by two others.

The new 'usb_signalling' and the 'usb_protocol' PD which stacks on top
of it, replace the old 'usb' decoder.

6 years agosrd: Performance improvements for various PDs.
Uwe Hermann [Wed, 11 Jul 2012 20:19:31 +0000 (22:19 +0200)]
srd: Performance improvements for various PDs.

Ignore/skip identical samples in most (low-level) PDs, as we're usually
(but not necessarily always) only interested in pin changes.

This yields a significant performance improvement for the PDs.

The mechanism was already used in the 'i2s', 'jtag', and 'lpc' PDs, but not
yet in all supported low-level decoders. The following PDs now also use
this mechanism: 'dcf77', 'i2c', 'spi', 'uart', and 'usb_signalling'.

Thanks Lars-Peter Clausen <lars@metafoo.de> for bringing this to our
attention.

6 years agosr: Drop mastech-va18b, code will be in genericdmm.
Uwe Hermann [Wed, 11 Jul 2012 10:57:15 +0000 (12:57 +0200)]
sr: Drop mastech-va18b, code will be in genericdmm.

6 years agosr: fix conditional build for ezusb and serial helpers
Bert Vermeulen [Wed, 11 Jul 2012 10:36:13 +0000 (12:36 +0200)]
sr: fix conditional build for ezusb and serial helpers

6 years agosr: session: Moves sources to session struct
Lars-Peter Clausen [Fri, 6 Jul 2012 21:23:31 +0000 (23:23 +0200)]
sr: session: Moves sources to session struct

The sources really belong to the session, so move them into the session struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agosr: demodevice: Make read channel non-blocking
Lars-Peter Clausen [Fri, 6 Jul 2012 21:23:30 +0000 (23:23 +0200)]
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>
6 years agosr: session: Realloc correct array for pollfds in _sr_session_source_remove
Lars-Peter Clausen [Fri, 6 Jul 2012 21:23:29 +0000 (23:23 +0200)]
sr: session: Realloc correct array for pollfds in _sr_session_source_remove

Commit 7149ad7c ("sr: session: Keep a global pollfd array") contained a small
copy paste error. This patch fixes it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agosr: fx2lafw: Free transfers in reverse order
Lars-Peter Clausen [Thu, 5 Jul 2012 19:38:36 +0000 (21:38 +0200)]
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>
6 years agosrd: lm75: Output min/max/avg temperature in report().
Uwe Hermann [Wed, 4 Jul 2012 20:03:34 +0000 (22:03 +0200)]
srd: lm75: Output min/max/avg temperature in report().

This is just a preparation for later, the report() is not hooked up
anywhere, yet.

6 years agosrd: lm75: Warn about temperature reg. being read-only.
Uwe Hermann [Wed, 4 Jul 2012 17:52:29 +0000 (19:52 +0200)]
srd: lm75: Warn about temperature reg. being read-only.

6 years agosrd: lm75: Generic handling of register reads/writes.
Uwe Hermann [Wed, 4 Jul 2012 17:35:59 +0000 (19:35 +0200)]
srd: lm75: Generic handling of register reads/writes.

6 years agosr: Minor cosmetics.
Uwe Hermann [Wed, 4 Jul 2012 23:47:44 +0000 (01:47 +0200)]
sr: Minor cosmetics.

6 years agosr: session/demo: Remove Windows specific hack
Lars-Peter Clausen [Sat, 30 Jun 2012 18:54:45 +0000 (20:54 +0200)]
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>
6 years agosr: session: Add support for GPollFD or GIOChannel based sources
Lars-Peter Clausen [Sat, 30 Jun 2012 18:54:44 +0000 (20:54 +0200)]
sr: session: Add support for GPollFD or GIOChannel based sources

A raw file descriptor to poll on is not always available, this patch adds
support for adding a source for a GIOChannel or GPollFD.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agosr: session: Keep a global pollfd array
Lars-Peter Clausen [Sat, 30 Jun 2012 18:54:43 +0000 (20:54 +0200)]
sr: session: Keep a global pollfd array

Currently we keep a file descriptor for each source and construct a pollfd array
from these during each loop iteration in sr_session_run(). This patch modifies
the code to keep a global pollfd array which is only modified when a source is
added or removed. On one hand this gets rid of the constant constructing and
subsequent freeing of the pollfd array in sr_session_run(), on the other hand it
will allow us to implement support for non-fd based pollfds.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agosr: session: Use realloc to resize source array
Lars-Peter Clausen [Sat, 30 Jun 2012 18:54:42 +0000 (20:54 +0200)]
sr: session: Use realloc to resize source array

Use realloc to resize the source array when adding or removing a source. This
makes the code a bit smaller. In the remove function we now check whether the fd
is valid before doing anything else and if it is not simply do nothing. If it is
valid use memove to move the elements following the source one element down in
the array. Only after that has been done the array is re-allocated.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
6 years agoqt: switch to new <libsigrok/libsigrok.h>
Bert Vermeulen [Wed, 4 Jul 2012 23:17:04 +0000 (01:17 +0200)]
qt: switch to new <libsigrok/libsigrok.h>

6 years agogtk: switch to new <libsigrok/libsigrok.h>
Bert Vermeulen [Wed, 4 Jul 2012 23:12:07 +0000 (01:12 +0200)]
gtk: switch to new <libsigrok/libsigrok.h>

6 years agocli: switch to new <libsigrok/libsigrok.h>
Bert Vermeulen [Wed, 4 Jul 2012 23:06:28 +0000 (01:06 +0200)]
cli: switch to new <libsigrok/libsigrok.h>

6 years agosr: moved sigrok.h so libsigrok/libsigrok.h
Bert Vermeulen [Wed, 4 Jul 2012 22:55:07 +0000 (00:55 +0200)]
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.

6 years agosrd: onewire: Fix copyright line, and PD name/description.
Uwe Hermann [Tue, 3 Jul 2012 23:58:46 +0000 (01:58 +0200)]
srd: onewire: Fix copyright line, and PD name/description.

6 years agosome white space changes, changed handling of normal/overdrive timing, annotations...
Iztok Jeras [Mon, 2 Jul 2012 21:54:52 +0000 (23:54 +0200)]
some white space changes, changed handling of normal/overdrive timing, annotations now show duration

6 years agoadded some ducumentation, shortened the ROM command decoder code
Iztok Jeras [Sun, 1 Jul 2012 16:35:43 +0000 (18:35 +0200)]
added some ducumentation, shortened the ROM command decoder code

6 years agoadded some untested overdrive functionality, added some comments, modified timing...
Iztok Jeras [Sat, 30 Jun 2012 20:09:47 +0000 (22:09 +0200)]
added some untested overdrive functionality, added some comments, modified timing values in annotations

6 years agocommented out most of the TRANSPORT layer code, added some code for an improved timin...
Iztok Jeras [Thu, 28 Jun 2012 21:07:16 +0000 (23:07 +0200)]
commented out most of the TRANSPORT layer code, added some code for an improved timing calculation

6 years agodecoder onewire: added conditional network commands, some fixex to the transport...
Iztok Jeras [Mon, 25 Jun 2012 22:42:03 +0000 (00:42 +0200)]
decoder onewire: added conditional network commands, some fixex to the transport layer

6 years agodecoder onewire: separated transport layer code from network layer
Iztok Jeras [Mon, 25 Jun 2012 20:03:37 +0000 (22:03 +0200)]
decoder onewire: separated transport layer code from network layer

6 years agodecoder onewire: some annotation cleanup
Iztok Jeras [Mon, 25 Jun 2012 19:27:02 +0000 (21:27 +0200)]
decoder onewire: some annotation cleanup

6 years agoonewire decoder: removed some debug code, preparations for the next protocol layer
Iztok Jeras [Sat, 23 Jun 2012 20:06:47 +0000 (22:06 +0200)]
onewire decoder: removed some debug code, preparations for the next protocol layer

6 years agoonewire decoder: added search support
Iztok Jeras [Sat, 23 Jun 2012 19:29:03 +0000 (21:29 +0200)]
onewire decoder: added search support

6 years agoonewire decoder: added some byte related code
Iztok Jeras [Sat, 23 Jun 2012 16:06:09 +0000 (18:06 +0200)]
onewire decoder: added some byte related code

6 years agosome fixex to the link layer, not final
Iztok Jeras [Sat, 2 Jun 2012 18:06:45 +0000 (20:06 +0200)]
some fixex to the link layer, not final

6 years agounfinished update to onewire protocol decoder
Uwe Hermann [Tue, 3 Jul 2012 23:19:35 +0000 (01:19 +0200)]
unfinished update to onewire protocol decoder

6 years agosr: demodevice: Reset sample limit when setting time limit and vice versa
Lars-Peter Clausen [Tue, 3 Jul 2012 21:59:12 +0000 (23:59 +0200)]
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>
6 years agosr: fx2lafw: Fix potential leaks in acquisition_start error paths
Lars-Peter Clausen [Tue, 3 Jul 2012 21:58:40 +0000 (23:58 +0200)]
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>
6 years agosr: fx2lafw: Do not start a new acquisition if the old is still running
Lars-Peter Clausen [Tue, 3 Jul 2012 21:58:39 +0000 (23:58 +0200)]
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>
6 years agosr: fx2lafw: Abort pending transfers when sampling is stopped
Lars-Peter Clausen [Tue, 3 Jul 2012 21:58:38 +0000 (23:58 +0200)]
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>
6 years agosrd: i2cfilter: Output actual I2C packets.
Uwe Hermann [Thu, 28 Jun 2012 19:43:12 +0000 (21:43 +0200)]
srd: i2cfilter: Output actual I2C packets.

Change this PD from an I2C->databytes converter/filter to an actual
pure I2C filter in the sense that both input and output is a valid I2C
protocol stream.

Also, change the EDID decoder accordingly, to use the new i2cfilter
output.

6 years agosr: add genericdmm driver
Bert Vermeulen [Sun, 1 Jul 2012 20:37:15 +0000 (22:37 +0200)]
sr: add genericdmm driver

6 years agosr: add HWCAP type SR_T_KEYVALUE (char **)
Bert Vermeulen [Sun, 1 Jul 2012 20:33:57 +0000 (22:33 +0200)]
sr: add HWCAP type SR_T_KEYVALUE (char **)