Copyright | (c) Marc Fontaine 2017 |
---|---|
License | BSD3 |
Maintainer | Marc.Fontaine@gmx.de |
Stability | experimental |
Portability | GHC-only |
Safe Haskell | Safe |
Language | Haskell2010 |
I2C related functions.
- type Device = Fd
- type SynthT env m a = ReaderT (env, Device) m a
- runI2CWith :: FilePath -> Addr -> (Device -> IO a) -> IO a
- deviceIO :: MonadIO m => (Device -> IO a) -> SynthT env m a
- dumpRegisters :: MonadIO m => SynthT env m ()
- writeByteData :: MonadIO m => Command -> Word8 -> SynthT env m ()
- writeI2CBlockData :: MonadIO m => Command -> ByteString -> SynthT env m ()
Documentation
type SynthT env m a = ReaderT (env, Device) m a Source #
Synth a is the monad for Si PPL synthesizers.
runI2CWith :: FilePath -> Addr -> (Device -> IO a) -> IO a Source #
Run an IO action with an I2C device and an I2C address.
deviceIO :: MonadIO m => (Device -> IO a) -> SynthT env m a Source #
Lift an IO action on an I2C device to Synth.
dumpRegisters :: MonadIO m => SynthT env m () Source #
Dump the content of the IC registers. (For testing)
writeI2CBlockData :: MonadIO m => Command -> ByteString -> SynthT env m () Source #