Difference between revisions of "Libsigrok"

From sigrok
Jump to navigation Jump to search
(collectd)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:libsigrok}}
{{DISPLAYTITLE:libsigrok}}
'''libsigrok''' is a shared library written in C, which provides the basic hardware access drivers for logic analyzers and other supported devices, as well as input/output file format support.
'''libsigrok''' (sometimes abbreviated as "sr") is a shared library written in C, which provides the basic hardware access drivers for logic analyzers and other [[Supported_hardware|supported devices]], as well as [[Input_output_formats|input/output file format]] support.
 
It is licensed under the terms of the '''GNU GPL, version 3 or later'''.


== Getting the code ==
== Getting the code ==
Line 14: Line 16:
== Building from source ==
== Building from source ==


See the respective OS-specific page, e.g. [[Linux]], [[Windows]], [[Mac OS X]], or [[FreeBSD]].
See [[Building]].
 
== Running the unit tests ==
 
$ '''make check'''
 
(check >= 0.9.4 must be installed)


== Language bindings ==
== Language bindings ==
libsigrok ships with a framework for different language bindings based on SWIG and Doxygen. Currently supported languages include C++, Python, Java, and Ruby (others can be added).
=== C++ ===
See the [http://sigrok.org/api/libsigrok/unstable/bindings/cxx/index.html C++ bindings API documentation] for details on how to use the bindings.
The [http://sigrok.org/gitweb/?p=libsigrok.git;a=tree;f=bindings/cxx C++ bindings] are used by [[PulseView]], for example.


=== Python ===
=== Python ===


There are experimental (still work in progress) [http://sigrok.org/gitweb/?p=libsigrok.git;a=tree;f=bindings/python Python bindings] for libsigrok in git.
See the [http://sigrok.org/api/libsigrok/unstable/bindings/python/index.html Python bindings API documentation] for details on how to use the bindings.


A few items that still need to be done:
The [http://sigrok.org/gitweb/?p=libsigrok.git;a=tree;f=bindings/python Python bindings] are used by [[sigrok-meter]], for example.


* probes (this needs the probe_groups branch to get merged in; Python bindings for that API is ready)
=== Java ===
* input/output formats
 
* triggers
See the [http://sigrok.org/api/libsigrok/unstable/bindings/java/index.html Java bindings API documentation] for details on how to use the bindings.
* session load/save
 
The [http://sigrok.org/gitweb/?p=libsigrok.git;a=tree;f=bindings/java Java bindings] are not yet used by any project hosted at sigrok.org. Please let us know if you're using the Java bindings in any of your own projects!
 
=== Ruby ===
 
The [http://sigrok.org/gitweb/?p=libsigrok.git;a=tree;f=bindings/ruby Ruby bindings] are not yet used by any project hosted at sigrok.org. Please let us know if you're using the Ruby bindings in any of your own projects!


== collectd plugin ==
== collectd plugin ==
Line 55: Line 76:
  </Plugin>
  </Plugin>
</small>
</small>
== Firmware ==
Some devices supported by libsigrok need a firmware to be uploaded before the device can be used.
See [[Firmware]] for details on how to get them and where to place them.


== Resources ==
== Resources ==

Latest revision as of 15:40, 28 April 2018

libsigrok (sometimes abbreviated as "sr") is a shared library written in C, which provides the basic hardware access drivers for logic analyzers and other supported devices, as well as input/output file format support.

It is licensed under the terms of the GNU GPL, version 3 or later.

Getting the code

$ git clone git://sigrok.org/libsigrok

You can also browse the source code via gitweb.

Distribution packages

See Downloads.

Building from source

See Building.

Running the unit tests

$ make check

(check >= 0.9.4 must be installed)

Language bindings

libsigrok ships with a framework for different language bindings based on SWIG and Doxygen. Currently supported languages include C++, Python, Java, and Ruby (others can be added).

C++

See the C++ bindings API documentation for details on how to use the bindings.

The C++ bindings are used by PulseView, for example.

Python

See the Python bindings API documentation for details on how to use the bindings.

The Python bindings are used by sigrok-meter, for example.

Java

See the Java bindings API documentation for details on how to use the bindings.

The Java bindings are not yet used by any project hosted at sigrok.org. Please let us know if you're using the Java bindings in any of your own projects!

Ruby

The Ruby bindings are not yet used by any project hosted at sigrok.org. Please let us know if you're using the Ruby bindings in any of your own projects!

collectd plugin

collectd graph

There is a plugin for the collectd system statistics collecting daemon.

See this blogpost or the collectd wiki page for details.

An example config file snippet for collectd and libsigrok usage could look e.g. like this:

LoadPlugin "sigrok"
<Plugin "sigrok">
   LogLevel 3
   <Device "Sound level">
       Driver "cem-dt-885x"
       conn "/dev/ttyUSB3"
       MinimumInterval 1
   </Device>
   <Device "Temperature">
       Driver "uni-t-ut32x"
       conn "1a86.e008"
       MinimumInterval 1
   </Device>
</Plugin>

Firmware

Some devices supported by libsigrok need a firmware to be uploaded before the device can be used.

See Firmware for details on how to get them and where to place them.

Resources