data-svd-0.1.0.0: SVD (System view description) file handling
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.SVD.Util

Synopsis

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 #

mapFields :: (Field -> b) -> Register -> [b] Source #

mapDevFields :: (Field -> b) -> Device -> [b] Source #

getPeriphByGroup :: String -> Device -> Peripheral Source #

Get peripheral by groupName

getPeriph :: String -> Device -> Peripheral Source #

Get peripheral by name

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

getPeriphRegFields Source #

Arguments

:: String

Peripheral name

-> String

Register name

-> Device 
-> Either String [Field] 

Get fields of the specific register of the peripheral with pName

getRegFields Source #

Arguments

:: String

Peripheral name

-> String

Register name

-> Device 
-> [Field] 

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

getProcdFieldValues :: (Bits a, Num a) => a -> Register -> [(a, Field)] Source #

Same as getFieldValues but with processed fields (reserved fields included)

anyReservedSet :: (Eq a, Num a) => [(a, Field)] -> Bool Source #

Check if any reserved field has value other than 0

filterSet :: (Eq a, Num a) => [(a, Field)] -> [(a, Field)] Source #

Filter fields with non zero value

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