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 __str__ Undocumented
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 dict No summary
Method json No summary
Method load_bytes Loads a byte string or bytestream into this block
Method load_dict Loads this block from a JSON dictionary representation
Method load_json Loads this component from a JSON dictionary representation
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)
def __str__(self) -> str: (source)

Undocumented

def address(self) -> bytes: (source)

The address of the block

def block_type(self) -> bytes: (source)

The type of the block

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

The data in the block

def dict(self, **kwargs) -> dict: (source)
Returns
dictA JSON dictionary representation of this block
def json(self, **kwargs) -> dict: (source)
Returns
dictA JSON dictionary representation of this block
def load_bytes(self, data: bytes | BytesIO): (source)

Loads a byte string or bytestream into this block

Parameters
data:bytes | BytesIOThe bytes to load
def load_dict(self, dct: dict, **kwargs): (source)

Loads this block from a JSON dictionary representation

Parameters
dct:dictThe dict to load
**kwargsUndocumented
def load_json(self, dct: dict, **kwargs): (source)

Loads this component from a JSON dictionary representation

Parameters
dct:dictThe dict to load
**kwargsUndocumented

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