Skip to content

sstallion/libi2cd

Repository files navigation

libi2cd

libi2cd provides a simple and straightforward API for accessing I2C devices from userspace. It relies on the i2c-dev Linux kernel module and is intended to complement existing tools and libraries, such as those provided by i2c-tools. The design for libi2cd was inspired by libgpiod; it provides both high- and low-level access to the underlying ioctl requests and has no dependencies apart from the standard C library.

libi2cd documentation is hosted on GitHub Pages. A code coverage report is also available.

Installation

Note: These instructions assume you are installing from a source distribution and have a working Linux installation (most distributions are supported) with GCC and GNU Autotools installed. If installing from source control, see HACKING.md.

cmocka is required for building tests and should be installed using the system package manager (eg. libcmocka-dev on Debian-based distributions via apt-get).

If you wish to build without tests, the --disable-tests option may be passed to configure:

$ ./configure --disable-tests

To build and install, issue the following:

$ ./configure
$ make all
$ make check
$ make install

By default, make install will install files in /usr/local, which may require superuser privileges.

Hacking

Pull requests are welcome! See HACKING.md for more details.

License

libi2cd is distributed under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or any later version. See COPYING for more details.