hsI2C-0.1.2: I2C access for Haskell and Linux

Copyright(c) Marc Fontaine 2017
LicenseBSD3
MaintainerMarc.Fontaine@gmx.de
Stabilityexperimental
PortabilityGHC-only
Safe HaskellSafe
LanguageHaskell98

System.Hardware.LinuxDevI2C

Description

This module provides an I2C interface based Linux /devi2c-xxx

Synopsis

Documentation

type Device = Fd Source #

withDevice :: FilePath -> (Device -> IO a) -> IO a Source #

Open an I2C device run, an IO action and close the device again. A device file on Linux could be for example /dev/i2c-7.

openDevice :: FilePath -> IO Device Source #

Open an I2C Device.

closeDevice :: Device -> IO () Source #

Close an I2C Device.

setSlaveAddr :: HasCallStack => Device -> Addr -> IO () Source #

Set the address of the I2C Slave