package gpiod

  1. Overview
  2. Docs
A wrapper around the C libgpiod library for GPIO on recent (>4.8) Linux kernels

Install

Dune Dependency

Authors

Maintainers

Sources

v0.7.tar.gz
md5=5c7cc97227025d483b181a22dc22481f
sha512=4a12ef0e1b53adcf5e61495df1b27e0800da035eb21716b757199a852d94502de1d31cb401e4bb39662b7ac33cea7e88971bcfc86d8620d44c03e6593d13d168

Description

Published: 16 Jun 2021

README

libGpiod Ocaml Bindings

A direct (1-1) wrapper to libgpiod from ocaml. This unlocks access to the new GPIO interface on Linux, instead of the error-prone and sluggish sysfs approach. Bindings are systematically generated from the libgpiod header file on the system. Memory management and reference counting are not taken care of by the bindings, so the corresponding reference decrement or free methods will still need to be called.

The bindings in this package are primitive, but unlock access to GPIO ports on all kernels with gpiod support. I welcome improvements or full replacement with a pure Ocaml version (Implementation of this would require communication of precisely packed structures to the kernel through ioctl calls).

Usage

An example of usage on a Raspberry Pi can be seen in examples.

Dependencies

Requires libgpiod to be installed (link).

TODO
  • Synthesize bindings for methods that take a timespec like the gpiod_wait methods.

  • Generate useful bindings for the methods that take mutable integer arrays.

Dependencies (7)

  1. ocaml >= "4.08.0"
  2. conf-gpiod
  3. ctypes-foreign >= "0.18.0"
  4. ctypes >= "0.17.1"
  5. core >= "v0.14.1"
  6. re >= "1.9.0"
  7. dune >= "2.8"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.