pi-lcd-0.1.0.0: Control an Adafruit character LCD and keypad kit on a Raspberry Pi

Copyright© Patrick Pelletier 2017
LicenseBSD3
Maintainercode@funwithsoftware.org
PortabilityLinux
Safe HaskellSafe
LanguageHaskell2010

System.Hardware.PiLcd.I2c

Description

You can use this module to communicate with I2C peripherals on Linux.

Synopsis

Documentation

type I2cHandle = Fd Source #

Represents an I²C bus.

data Segment Source #

Represents an I²C read or write, as part of a larger transaction.

Constructors

Read Int

number of bytes to read

Write [Word8]

bytes to write

i2cOpen Source #

Arguments

:: Int

bus number

-> IO I2cHandle 

Open a handle to an I²C bus.

i2cTransaction Source #

Arguments

:: I2cHandle

handle to an I²C bus

-> Int

address of device on I²C bus

-> [Segment]

list of read/write segments to perform

-> IO [[Word8]]

list of bytes returned for each read segment

Performs an I2C_RDWR transaction.

i2cReadReg Source #

Arguments

:: I2cHandle

handle to an I²C bus

-> Int

address of device on the I²C bus

-> Word8

register number

-> Int

number of bytes to read

-> IO [Word8] 

Writes the register number, and then reads the specified number of bytes.

i2cWriteReg Source #

Arguments

:: I2cHandle

handle to an I²C bus

-> Int

address of device on the I²C bus

-> Word8

register number

-> [Word8]

bytes to write

-> IO () 

Writes the register number, and then writes the specified bytes.

i2cClose :: I2cHandle -> IO () Source #

Close a handle to an I²C bus.