bus-pirate-0.2: Haskell interface to the Bus Pirate binary interface

Safe HaskellNone

System.Hardware.BusPirate.I2C

Contents

Synopsis

Primitive operations

i2cMode :: I2cM a -> BusPirateM aSource

Enter I2C mode and run given action

startBit :: I2cM ()Source

Send a start bit

stopBit :: I2cM ()Source

Send a stop bit

readByte :: I2cM Word8Source

Read a byte

ackBit :: I2cM ()Source

Send an ACK

nackBit :: I2cM ()Source

Send a NACK

bulkWrite :: ByteString -> I2cM ()Source

Write some bytes

writeRead :: ByteString -> Int -> I2cM ByteStringSource

Send Start bit, write some bytes, then read some bytes (ACKing each until the last), then send a stop bit

Configuration

data I2cConfig Source

Constructors

I2cConfig 

Instances

setConfig :: I2cConfig -> I2cM ()Source

Set Bus Pirate I2C configuration bits

setSpeed :: I2cSpeed -> I2cM ()Source

Set I2C bus speed