module System.Hardware.Serialport.Types where
import Data.Word
data CommSpeed
= CS110
| CS300
| CS600
| CS1200
| CS2400
| CS4800
| CS9600
| CS19200
| CS38400
| CS57600
| CS115200
deriving (Show, Eq, Bounded)
data StopBits = One | Two deriving (Show, Eq, Bounded)
data Parity = Even | Odd | NoParity deriving (Show, Eq)
data FlowControl = Software | NoFlowControl deriving (Show, Eq)
data SerialPortSettings = SerialPortSettings {
commSpeed :: CommSpeed,
bitsPerWord :: Word8,
stopb :: StopBits,
parity :: Parity,
flowControl :: FlowControl,
timeout :: Int
}
defaultSerialSettings :: SerialPortSettings
defaultSerialSettings =
SerialPortSettings CS9600 8 One NoParity NoFlowControl 1