erlang interface to linux spidev
Erlang C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
c_src
ebin
include
priv
src
.gitignore
README.md
rebar.config

README.md

spi

spi is a device driver application for SPI (Synchronous Peripheral Interface) written in erlang and C.

Dependencies

To build spi you will need a working installation of Erlang R15B (or later).
Information on building and installing Erlang/OTP can be found here (more info).

spi is built using rebar that can be found here, with building instructions here. rebar's dynamic configuration mechanism, described here, is used so the environment variable REBAR_DEPS should be set to the directory where your erlang applications are located.

Download

Clone the repository in a suitable location:

$ git clone git://github.com/tonyrog/spi.git

Build

Rebar will compile all needed dependencies.
Compile:

$ cd spi
$ rebar compile
...
==> spi (compile)

Run

spi is started in a standard erlang fashion:

$ erl
(node@host) 1> application:start(spi).

API

The following interface functions exist:

  • open
  • close
  • transfer
  • get_mode
  • get_bits_per_word/li>
  • get_speed

For details see the source code.