Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- addReservedFields :: Device -> Device
- procFields :: Register -> [Field]
- continuityCheck :: Register -> Bool
- checkDeviceRegisterContinuity :: Device -> Either String Device
- mapPeriphs :: (Peripheral -> b) -> Device -> [b]
- mapRegs :: (Register -> b) -> Peripheral -> [b]
- mapFields :: (Field -> b) -> Register -> [b]
- mapDevFields :: (Field -> b) -> Device -> [b]
- getPeriphByGroup :: String -> Device -> Peripheral
- getPeriph :: String -> Device -> Peripheral
- getPeriphMay :: String -> Device -> Maybe Peripheral
- getPeriphRegMay :: String -> Peripheral -> Maybe Register
- getPeriphFollow :: String -> Device -> Either String Peripheral
- getPeriphRegs :: String -> Device -> Either String [Register]
- getPeriphReg :: String -> String -> Device -> Either String Register
- getPeriphRegAddr :: String -> String -> Device -> Either String Int
- getPeriphRegFields :: String -> String -> Device -> Either String [Field]
- getRegFields :: String -> String -> Device -> [Field]
- getFieldVal :: (Bits a, Num a) => a -> Field -> a
- getFieldValues :: (Bits a, Num a) => a -> [Field] -> [(a, Field)]
- anyReservedSet :: (Eq a, Num a) => [(a, Field)] -> Bool
- getDevMemMap :: Device -> [(String, String)]
- registerNames :: String -> Device -> [String]
- fieldNames :: String -> String -> Device -> [String]
- sortDeviceByAddresses :: Device -> Device
- sortDeviceByNames :: Device -> Device
- fillMissingInterrupts :: [Interrupt] -> [Interrupt]
Documentation
addReservedFields :: Device -> Device Source #
Fill in reserved fields for whole Device
procFields :: Register -> [Field] Source #
Find holes in registers and create corresponding reserved fields for these
First finds missing bits and then merges them to single reserved field
continuityCheck :: Register -> Bool Source #
Walk processed register fields top to bottom checking that the register is exactly n bits long
checkDeviceRegisterContinuity :: Device -> Either String Device Source #
Check all devices registers for continuity
mapPeriphs :: (Peripheral -> b) -> Device -> [b] Source #
mapRegs :: (Register -> b) -> Peripheral -> [b] Source #
mapDevFields :: (Field -> b) -> Device -> [b] Source #
getPeriphByGroup :: String -> Device -> Peripheral Source #
Get peripheral by groupName
getPeriphMay :: String -> Device -> Maybe Peripheral Source #
Get peripheral by name iff found, Nothing otherwise
getPeriphRegMay :: String -> Peripheral -> Maybe Register Source #
Get register of the peripheral by their names iff found, Nothing otherwise
getPeriphFollow :: String -> Device -> Either String Peripheral Source #
Get peripheral by name or its parent peripheral if it's a derived peripheral (for example USART2 is typically derived from USART1)
getPeriphRegs :: String -> Device -> Either String [Register] Source #
Get registers of the peripheral
getPeriphReg :: String -> String -> Device -> Either String Register Source #
Get specific register of the peripheral Follows derived from.
getPeriphRegAddr :: String -> String -> Device -> Either String Int Source #
Get address of the specific register of the peripheral with pName
Get fields of the specific register of the peripheral with pName
getFieldVal :: (Bits a, Num a) => a -> Field -> a Source #
Get value of specific Field
according to input x
getFieldValues :: (Bits a, Num a) => a -> [Field] -> [(a, Field)] Source #
Decode integer x
according to Fields fs
anyReservedSet :: (Eq a, Num a) => [(a, Field)] -> Bool Source #
Check if any reserved field has value other than 0
getDevMemMap :: Device -> [(String, String)] Source #
Get memory map of the device according to its perhiperal addresses
Sorting
sortDeviceByAddresses :: Device -> Device Source #
Sort everything by memory address
sortDeviceByNames :: Device -> Device Source #
Sort everything by name
Interrupts
fillMissingInterrupts :: [Interrupt] -> [Interrupt] Source #