Commit Graph

3544 Commits

Author SHA1 Message Date
Martin Ling 472bef3990 ut372: Implement initial protocol parser.
For now this only works correctly if the device is in the default
state showing current RPM. The flags are not checked.
2015-03-01 22:36:52 +00:00
Martin Ling f3cde30904 ut372: Initial sub-driver skeleton. 2015-03-01 22:30:57 +00:00
Baruch Even 2cb63065f5 serial-dmm: Add MASTECH MS8250B as a supported DMM.
It is an alias and uses the FS9721 driver.
2015-02-27 15:10:19 +01:00
Uwe Hermann 2560941223 configure.ac: Two more fixes for the baylibre-acme detection. 2015-02-26 18:55:17 +01:00
Uwe Hermann d9c3331d12 asix-sigma: Use the more portable g_usleep(). 2015-02-26 11:15:02 +01:00
Vladislav Ivanov f80b3fe234 configure.ac: Fix baylibre-acme OS check. 2015-02-26 11:14:55 +01:00
Bartosz Golaszewski 380ee96fdf baylibre-acme: don't report ACME as detected if no probes are present
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-20 11:22:26 +01:00
Bartosz Golaszewski b1e034f758 Doxyfile: Make exclude patterns more specific.
Current exclude patterns lead to unwanted exclusion of all paths
containing common directory names like output, bindings etc. even
if those names occur higher in the directory structure.

Make exclude patterns more specific by prefixing them with src/.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-20 11:12:31 +01:00
Uwe Hermann 3d14ce49e4 baylibre-acme: Fix vendor/device name. 2015-02-17 17:03:41 +01:00
Uwe Hermann e00b3f5897 Various Doxygen updates. 2015-02-17 15:57:21 +01:00
Uwe Hermann 02a2bf688f unit tests: Drop unneeded check_ filename prefix. 2015-02-17 15:24:28 +01:00
Uwe Hermann d258022db0 baylibre-acme: Drop unneeded comment.
There's indeed no g_fclose() unfortunately. The g_*() wrappers for file
handling are mainly there to deal with portability issues in file names
(encoding, character sets, etc) on different platforms.
2015-02-16 01:57:35 +01:00
Uwe Hermann 3452785431 baylibre-acme: Fix a compiler warning.
Use PRIu64 to avoid the following compiler warning:

    CC       src/hardware/baylibre-acme/gpio.lo
  protocol.c: In function 'bl_acme_set_shunt':
  protocol.c:341:2: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
    g_fprintf(fd, "%llu\n", MOHM_TO_UOHM(shunt));
    ^
2015-02-16 01:57:35 +01:00
Uwe Hermann 391e23a97f baylibre-acme: Minor coding-style, cosmetics. 2015-02-16 01:57:35 +01:00
Bartosz Golaszewski 740ad48ac8 baylibre-acme: Add support for SR_CONF_POWER_OFF.
Allow to remotely cut the power at ACME probe level.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:08 +01:00
Bartosz Golaszewski 289eebd7ca baylibre-acme: Add Linux-specific GPIO helpers.
These functions allow to export, read and set GPIOs using Linux
sysfs interface.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:08 +01:00
Bartosz Golaszewski 61f2b7f74c baylibre-acme: Add support for probe factor setting.
Implement support for SR_CONF_PROBE_FACTOR setting in BayLibre ACME
driver. Given the channel-group parameter this allows to set the
shunt resistance for each probe.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:08 +01:00
Bartosz Golaszewski d3c81725ae SR_CONF_PROBE_FACTOR: New option.
Add new configuration option allowing to modify the probe factor
for oscilloscopes and power-monitors.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:07 +01:00
Bartosz Golaszewski a0b277ba67 configure.ac: Compile baylibre-acme driver for Linux only.
The driver for BayLibre ACME depends on Linux-specific sysfs
interfaces to ina226 and tmp435 devices. Exclude it for different
targets.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:07 +01:00
Bartosz Golaszewski 6b80b80dcf baylibre-acme: Driver implementation.
Implement basic functionalities for baylibre-acme. Add support
for common config options, device detection and sample reading.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:07 +01:00
Bartosz Golaszewski dfaee1de17 baylibre-acme: Initial driver skeleton.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:07 +01:00
Aurelien Jacobs 96cb7faac3 rigol-ds: fix the smallest supported vdiv for the DS2000 series. 2015-02-15 21:15:27 +01:00
Aurelien Jacobs 81b85663f3 rigol-ds: return the actual hardware num_vdiv and vdiv list. 2015-02-15 21:15:21 +01:00
Aurelien Jacobs c33ff3771b rigol-ds: fix search for the closest vdiv.
We try to find the smallest diff by comparing each diff with
the previously known smallest diff, so initially, this smallest diff
should be INFINITY so that we are sure to find a smaller one.

This fixes the following exception:
sr: rigol-ds: Negative vdiv index: -1.
Caught exception: not applicable
2015-02-15 21:15:04 +01:00
Uwe Hermann f44f7e61a3 rigol-ds: Add missing "break" statements. 2015-02-14 19:32:25 +01:00
Uwe Hermann d50725e012 rigol-ds: Add missing 20/50/100V vdiv entries.
These are available on e.g. Rigol DS1102E (or "upgraded" DS1052E).

Without this, if one of the channels happens to have been set to
one of the missing vdiv settings frontends (e.g. PulseView) will
have some trouble using the scope:

  sr: hwdriver: sr_config_get(): key 30012 (vdiv) sdi 0x11bcb70 cg CH1
  sr: rigol-ds: Negative vdiv index: -1.
  std::exception
2015-02-14 19:32:15 +01:00
Uwe Hermann e1b5b7e735 rigol-ds: Add more debug output. 2015-02-14 18:34:04 +01:00
Aurelien Jacobs d5c4144e2c rigol-ds: handle full word trigger slope in config_get().
Some scope can return POSITIVE/NEGATIVE instead of POS/NEG,
so accept this as well.

This closes bug #558.
2015-02-13 16:37:24 +01:00
Aurelien Jacobs b0c9d1d1c2 rigol-ds: SR_CONF_TRIGGER_SLOPE is actually listable. 2015-02-12 17:58:32 +01:00
Aurelien Jacobs 73931b7cc7 input/vcd: fix parse_header() return value check.
Mixing tests for both a boolean and an SR_ERR at the same time is not
really a good idea.
parse_header() actually returns a boolean so only check if it returns FALSE.

This fixes the following gcc-5 warning:

src/input/vcd.c: In function 'receive':
src/input/vcd.c:506:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
   if (!parse_header(in, in->buf) != SR_OK)
                                  ^
2015-02-12 17:58:06 +01:00
Aurelien Jacobs 2617c81a4b Remove the inline qualification from sr_rational_set().
Inlining can only happen in the same compilation unit where the
function was defined, so there is no sense declaring an inline
function in a header if this function is not defined in this
same header.

This fixes the following gcc-5 warning:

In file included from include/libsigrok/libsigrok.h:1066:0,
                 from src/version.c:21:
include/libsigrok/proto.h:36:20: warning: inline function 'sr_rational_set' declared but never defined
 SR_API inline void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q);
                    ^
2015-02-12 11:24:11 +01:00
Aurelien Jacobs ee29d92e14 Correctly copy sr_datafeed_meta in sr_packet_copy().
Commit 5801d558 replaced g_slist_copy_deep() by some incorrect code
that actually leaks the newly allocated memory, instead of doing
a deep copy.

This new version should be more correct, more concise, and it fixes
the following warning:

src/session.c: In function 'sr_packet_copy':
src/session.c:1025:38: warning: passing argument 2 of 'g_slist_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
   g_slist_foreach(meta_copy->config, (GCopyFunc)copy_src, NULL);
                                         ^
In file included from /usr/include/glib-2.0/glib/gmain.h:26:0,
                 from /usr/include/glib-2.0/glib/giochannel.h:33,
                 from /usr/include/glib-2.0/glib.h:54,
                 from src/session.c:24:
/usr/include/glib-2.0/glib/gslist.h:125:10: note: expected 'GFunc {aka void (*)(void *, void *)}' but argument is of type 'void * (*)(const void *, void *)'
void     g_slist_foreach                 (GSList           *list,
         ^
2015-02-12 11:14:37 +01:00
Uwe Hermann c4f9582714 sr_strerror_name(): Add missing SR_ERR_IO entry. 2015-02-11 16:26:12 +01:00
Bartosz Golaszewski 3c5582595a SR_ERR_IO: new error code
Add new error code which can be used to notify the user about
general input/output errors.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-11 16:25:30 +01:00
Bartosz Golaszewski 3cdff6cd2d configure.ac: Add AC_CANONICAL_SYSTEM macro.
In order to determine the target OS when cross-compiling libsigrok
we need autotools to set the 'target_os' variable. This macro
determines the system type and sets output variables to the names
of the canonical system types.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-11 16:22:56 +01:00
Uwe Hermann 187cfc604e backend: Add basic transform module sanity checks. 2015-02-11 15:24:38 +01:00
Uwe Hermann 8677e4e7be transform: Add a few basic unit tests. 2015-02-11 15:24:38 +01:00
Uwe Hermann d74d30bb14 transform: Add an "invert" transform module.
This inverts the data values:

 - An analog value of x becomes 1/x.

 - A digital value of 0 becomes 1 (and vice versa).
2015-02-11 15:24:34 +01:00
Uwe Hermann 43caa46623 transform: Add a "scale" transform module. 2015-02-11 15:24:30 +01:00
Uwe Hermann 39f1752eff transform: Add a "nop" transform module.
This doesn't do anything, just passes input packets on unmodified.
2015-02-11 12:23:02 +01:00
Uwe Hermann c0a1e532f5 transform: Hook up transforms. 2015-02-11 12:23:02 +01:00
Uwe Hermann 988357ca2f transform: Add a basic set of API calls. 2015-02-11 12:23:02 +01:00
Uwe Hermann 790320f605 transform: Add struct sr_transform and struct sr_transform_module. 2015-02-11 12:23:02 +01:00
Uffe Jakobsen b595a45876 Fix problem building with BSD make
This fixes bug #556:

Bug 556 - libsigrok fails to build with BSD Make
2015-02-10 15:14:08 +01:00
Uwe Hermann d378f10099 Makefile.am: Add NEED_SERIAL condition. 2015-01-31 22:42:32 +01:00
Uwe Hermann 2182e77511 Makefile.am: Unconditionally build src/lcr/es51919.c.
We do the same with DMM parsers currently, and this change also
fixes an issue in sigrok-util's 'new-driver' script.

This fixes bug #545.
2015-01-31 22:29:07 +01:00
Daniel Elstner 479b7e469a Update list of files ignored by git 2015-01-31 21:09:01 +01:00
Daniel Elstner 1f501d72ef configure: Avoid bashism breaking the C++ bindings 2015-01-31 21:09:01 +01:00
Daniel Elstner 57ba5f3d56 sysclk-lwla: Widen constant to 64 bit before shifting
(lwla_convert_trigger): Fix trigger mask computation bug introduced
by recent change:  Widen constant to 64 bit before shifting so that
channel nunmbers beyond 32 are processed correctly.
2015-01-31 21:09:01 +01:00
Uwe Hermann 5801d558e7 Lower dependency to glib 2.32.
By avoiding g_slist_copy_deep() for now, we can easily allow libsigrok
to build against glib 2.32 (less hassle for users of stable/older
distros or OSes).
2015-01-29 13:55:55 +01:00