ftdi-0.3.0.2: A thin layer over USB to communicate with FTDI chips
Safe HaskellNone
LanguageHaskell2010

System.FTDI.MPSSE

Synopsis

Documentation

data Command a Source #

Instances

Instances details
Functor Command Source # 
Instance details

Defined in System.FTDI.MPSSE

Methods

fmap :: (a -> b) -> Command a -> Command b #

(<$) :: a -> Command b -> Command a #

Applicative Command Source # 
Instance details

Defined in System.FTDI.MPSSE

Methods

pure :: a -> Command a #

(<*>) :: Command (a -> b) -> Command a -> Command b #

liftA2 :: (a -> b -> c) -> Command a -> Command b -> Command c #

(*>) :: Command a -> Command b -> Command b #

(<*) :: Command a -> Command b -> Command a #

run :: forall a. InterfaceHandle -> Command a -> IO (Either Failure a) Source #

Assumes that the interface has already been placed in BitMode_MPSSE using setBitMode.

data Failure Source #

Constructors

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 

Instances

Instances details
Show Failure Source # 
Instance details

Defined in System.FTDI.MPSSE

Clock divisor

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

Data transfer

data BitOrder Source #

Constructors

MsbFirst 
LsbFirst 

data ClockEdge Source #

Constructors

Rising 
Falling 

flush :: Command () Source #

This will make the chip flush its buffer back to the PC.

Pausing

Byte-wise

readWriteBytes Source #

Arguments

:: ClockEdge

which edge to clock *out* data on

-> BitOrder 
-> ByteString 
-> Command ByteString 

GPIO

data Gpios a Source #

Constructors

Gpios 

Fields

Instances

Instances details
Functor Gpios Source # 
Instance details

Defined in System.FTDI.MPSSE

Methods

fmap :: (a -> b) -> Gpios a -> Gpios b #

(<$) :: a -> Gpios b -> Gpios a #

Foldable Gpios Source # 
Instance details

Defined in System.FTDI.MPSSE

Methods

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 #

toList :: Gpios a -> [a] #

null :: Gpios a -> Bool #

length :: Gpios a -> Int #

elem :: Eq a => a -> Gpios a -> Bool #

maximum :: Ord a => Gpios a -> a #

minimum :: Ord a => Gpios a -> a #

sum :: Num a => Gpios a -> a #

product :: Num a => Gpios a -> a #

Traversable Gpios Source # 
Instance details

Defined in System.FTDI.MPSSE

Methods

traverse :: Applicative f => (a -> f b) -> Gpios a -> f (Gpios b) #

sequenceA :: Applicative f => Gpios (f a) -> f (Gpios a) #

mapM :: Monad m => (a -> m b) -> Gpios a -> m (Gpios b) #

sequence :: Monad m => Gpios (m a) -> m (Gpios a) #

data Direction i o Source #

Constructors

Input i 
Output o 

data GpioBank Source #

Constructors

BankL 
BankH 

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