Parsing and processing s-records.
- newtype SRec = SRec [(Int, ByteString)]
- parseSRec :: String -> SRec
- printSRec :: SRec -> String
- mergeBlocks :: Word8 -> [(Int, ByteString)] -> (Int, ByteString)
- mergeAllBlocks :: Word8 -> SRec -> SRec
- mergeContiguousBlocks :: [(Int, ByteString)] -> [(Int, ByteString)]
- splitBlock :: Int -> (Int, ByteString) -> [(Int, ByteString)]
Documentation
SRec [(Int, ByteString)] | Starting address of block and block data. |
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.