System.Hardware.Parport
Contents
Description
Interfacing the parallel port (currently only implemented for linux). This library is supposed to be thread-safe.
Data types
Description of the data-direction for the pins of the data register
Claiming and releasing the parallel port
claim :: String -> IO PPSource
claim "/dev/parport0"
claims the parallel port exclusively and returns a handle.
Input/Output
writePin :: PP -> Int -> Bool -> IO ()Source
writePin pp i b
sets or clears pin i on pp, depending on the value of b.
writePins :: PP -> [(Int, Bool)] -> IO ()Source
writePins pp l
is equal to sequence (map ((i, b) -> writePin pp i b) l)
but it is faster.
readPin :: PP -> Int -> IO BoolSource
readPin pp i
reads the value of pin i on pp and returns it in the IO monad.
readPins :: PP -> [Int] -> IO [Bool]Source
readPins pp l
is equal to sequence (map (readPin pp) l)
but it is faster.
Setup
dataDirection :: PP -> DD -> IO ()Source
Set the data direction of the data pins (pin 2-9). On my system, i get an error "bad address". Please mail your experiences to me.