Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Command a
- run :: forall a. InterfaceHandle -> Command a -> IO (Either Failure a)
- data Failure
- setClockDivisor :: Word16 -> Command ()
- enableClkDivBy5 :: Command ()
- disableClkDivBy5 :: Command ()
- enable3PhaseClocking :: Command ()
- disable3PhaseClocking :: Command ()
- enableLoopback :: Command ()
- disableLoopback :: Command ()
- data BitOrder
- data ClockEdge
- flush :: Command ()
- waitOnHigh :: Command ()
- waitOnLow :: Command ()
- readBytes :: ClockEdge -> BitOrder -> Int -> Command ByteString
- writeBytes :: ClockEdge -> BitOrder -> ByteString -> Command ()
- readWriteBytes :: ClockEdge -> BitOrder -> ByteString -> Command ByteString
- data Gpios a = Gpios {}
- allInputs :: Gpios (Direction () Bool)
- data Direction i o
- data GpioBank
- setGpioDirValue :: GpioBank -> Gpios (Direction () Bool) -> Command ()
- getGpioValue :: GpioBank -> Command ByteString
Documentation
run :: forall a. InterfaceHandle -> Command a -> IO (Either Failure a) Source #
Assumes that the interface has already been placed in BitMode_MPSSE
using setBitMode
.
WriteTimedOut ByteString Int | content to be written and number of bytes actually written. |
ReadTimedOut ByteString Int ByteString | data written, expected returned bytes, and data actually read. |
ReadTooLong Int ByteString | bytes expected and content actually read. |
BadStatus ByteString |
Clock divisor
setClockDivisor :: Word16 -> Command () Source #
FT232H divide-by-5
enableClkDivBy5 :: Command () Source #
Enable clock divide by 5 to allow for backward compatibility with FT2232D.
disableClkDivBy5 :: Command () Source #
The FT232H, FT2232H, and FT4232H can achieve higher data rates if the clock divider is disabled.
enable3PhaseClocking :: Command () Source #
Enables 3 phase data clocking. Used by I2C interfaces to allow data on both clock edges.
disable3PhaseClocking :: Command () Source #
Disables 3 phase data clocking.
Loopback
enableLoopback :: Command () Source #
disableLoopback :: Command () Source #
Data transfer
Pausing
waitOnHigh :: Command () Source #
Byte-wise
writeBytes :: ClockEdge -> BitOrder -> ByteString -> Command () Source #
:: ClockEdge | which edge to clock *out* data on |
-> BitOrder | |
-> ByteString | |
-> Command ByteString |
GPIO
Instances
Functor Gpios Source # | |
Foldable Gpios Source # | |
Defined in System.FTDI.MPSSE fold :: Monoid m => Gpios m -> m # foldMap :: Monoid m => (a -> m) -> Gpios a -> m # foldMap' :: Monoid m => (a -> m) -> Gpios a -> m # foldr :: (a -> b -> b) -> b -> Gpios a -> b # foldr' :: (a -> b -> b) -> b -> Gpios a -> b # foldl :: (b -> a -> b) -> b -> Gpios a -> b # foldl' :: (b -> a -> b) -> b -> Gpios a -> b # foldr1 :: (a -> a -> a) -> Gpios a -> a # foldl1 :: (a -> a -> a) -> Gpios a -> a # elem :: Eq a => a -> Gpios a -> Bool # maximum :: Ord a => Gpios a -> a # minimum :: Ord a => Gpios a -> a # | |
Traversable Gpios Source # | |
setGpioDirValue :: GpioBank -> Gpios (Direction () Bool) -> Command () Source #
Set the direction and logic state of the pins
getGpioValue :: GpioBank -> Command ByteString Source #
Read the current state of the pins in the bank and send back 1 byte