srec-0.1.0: Parsing and processing s-records.



Parsing and processing s-records.



newtype SRec Source


SRec [(Int, ByteString)]

Starting address of block and block data.

parseSRec :: String -> SRecSource

Parse an s-record.

printSRec :: SRec -> StringSource

Prints (formats) an s-record file.

mergeBlocks :: Word8 -> [(Int, ByteString)] -> (Int, ByteString)Source

Merge consecutive blocks into one. If blocks are not contiguous, the padding byte is used to fill in the extra space. If the blocks overlap, an error is thrown.

mergeAllBlocks :: Word8 -> SRec -> SRecSource

Merge all blocks in s-record into one.

mergeContiguousBlocks :: [(Int, ByteString)] -> [(Int, ByteString)]Source

Merge contiguous consecutive blocks.

splitBlock :: Int -> (Int, ByteString) -> [(Int, ByteString)]Source

Split a block into sub-blocks given a block length.