class documentation

Parser for Intel blocks

The data section of a flash header with binary_flag == $01 is composed of blocks stored in the Intel format. Each block contains some segment of data stored at an address, which may be relative or absolute.

Class Raw Raw bytes container for TIFlashBlock
Method __init__ Creates an empty flash data block
Method address The address of the block
Method block_type The type of the block
Method bytes No summary
Method data The data in the block
Method load_bytes Loads a byte string or bytestream into this block
Instance Variable raw Undocumented
Property checksum The checksum for the flash block
Property size The size of the block data in characters

Inherited from Dock:

Method load Loads data into an instance by delegating to Loader methods based on the input's type
Class Variable loaders Undocumented
def __init__(self, init=None, *, address: bytes = b'0000', block_type: bytes = b'00', data: bytes = b''): (source)

Creates an empty flash data block

Parameters
initValues to initialize this block's data (defaults to None)
address:bytesThe address of this block (defaults to $0000)
block_type:bytesThe type of this block (defaults to $00, data)
data:bytesThis block's data (defaults to empty)
@Section(4, Bytes)
def address(self) -> bytes: (source)

The address of the block

@Section(2, Bytes)
def block_type(self) -> bytes: (source)

The type of the block

def bytes(self) -> bytes: (source)
Returns
bytesThe bytes contained in this block
@Section()
def data(self) -> bytes: (source)

The data in the block

@Loader[bytes, bytearray, BytesIO]
def load_bytes(self, data: bytes | BytesIO): (source)

Loads a byte string or bytestream into this block

Parameters
data:bytes | BytesIOThe bytes to load

Undocumented

The checksum for the flash block

This is equal to the lower byte of the sum of all bytes in the block. The checksum is not present in end blocks.

The size of the block data in characters