Skip to content

Typeclass for monads that support I2C (and SPI) communication #1

@dmcclean

Description

@dmcclean

Would you support splitting out into a separate package:

class MonadI2C m where
  writeI2C :: Address -> ByteString -> m ()
  readI2C :: Address -> Int -> m ByteString
  writeReadI2C :: Address -> ByteString -> Int -> m ByteString

(Or possibly similar types that provide a bit more feedback in the case of errors?)

If that package existed (I can write it up and put it on hackage) and this package provided an instance of it for raspberry pi, then device drivers for I2C slaves could be written without taking a direct dependency on the HPi package but could still be used with it.

(There could be another similar monad for SPI communications.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions