h2c: Bindings to Linux I2C with support for repeated-start transactions.

[ library, mit, system ] [ Propose Tags ]

H2C is a high-level binding to the Linux I2C subsystem with support for repeated-start transactions, not just individual reads and writes.

[Skip to Readme]


  • System
    • IO
      • System.IO.I2C


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 1.0.0
Dependencies base (>=4.7 && <5), bytestring, mtl, resourcet [details]
License MIT
Copyright 2017 Edward Amsden
Author Edward Amsden
Maintainer edwardamsden@gmail.com
Category System
Home page https://bitbucket.org/fmapE/h2c
Bug tracker https://bitbucket.org/fmapE/h2c/issues
Source repo head: git clone https://bitbucket.org/fmapE/h2c.git
Uploaded by eamsden at 2017-07-08T15:36:51Z
Reverse Dependencies 1 direct, 1 indirect [details]
Downloads 980 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2017-07-08 [all 3 reports]

Readme for h2c-1.0.0

[back to package description]

h2c: Haskell bindings to Linux I2C API

H2C is a binding to the Linux i2c-tools/i2c-dev API. It uses the I2C_RDWR ioctl for repeated-start communications between master and slave.


  • You'll probably have to run as root. Getting regular users direct access to i2c busses on Linux is tricky.
  • The Linux i2c-stub driver that you might think would be useful for testing doesn't support the I2C_RDWR ioctl. This is why, if you try to use it, you'll get the "invalid argument" error.


$ stack haddock --open, find module System.IO.I2C

BE CAREFUL WITH I2C. It can be used to poke at things like your graphics card, fans, &c.

See my library bno055-haskell for examples of h2c in use.