Package intelhex :: Class IntelHex16bit
[hide private]
[frames] | no frames]

Class IntelHex16bit

source code

object --+    
         |    
  IntelHex --+
             |
            IntelHex16bit

Access to data as 16-bit words.
Instance Methods [hide private]
 
__init__(self, source)
Construct class from HEX file or from instance of ordinary IntelHex class.
source code
 
__getitem__(self, addr16)
Get 16-bit word from address.
source code
 
__setitem__(self, addr16, word)
Sets the address at addr16 to word assuming Little Endian mode.
source code
 
minaddr(self)
Get minimal address of HEX content in 16-bit mode.
source code
 
maxaddr(self)
Get maximal address of HEX content in 16-bit mode.
source code

Inherited from IntelHex: __delitem__, __len__, addresses, dump, fromdict, fromfile, gets, getsz, loadbin, loadfile, loadhex, merge, puts, putsz, tobinarray, tobinfile, tobinstr, todict, tofile, write_hex_file

Inherited from IntelHex (private): _decode_record, _get_start_end

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, source)
(Constructor)

source code 
Construct class from HEX file or from instance of ordinary IntelHex class. If IntelHex object is passed as source, the original IntelHex object should not be used again because this class will alter it. This class leaves padding alone unless it was precisely 0xFF. In that instance it is sign extended to 0xFFFF.
Parameters:
  • source - file name of HEX file or file object or instance of ordinary IntelHex class. Will also accept dictionary from todict method.
Overrides: object.__init__

__getitem__(self, addr16)
(Indexing operator)

source code 
Get 16-bit word from address. Raise error if only one byte from the pair is set. We assume a Little Endian interpretation of the hex file.
Parameters:
  • addr16 - address of word (addr8 = 2 * addr16).
Returns:
word if bytes exists in HEX file, or self.padding if no data found.
Overrides: IntelHex.__getitem__

__setitem__(self, addr16, word)
(Index assignment operator)

source code 
Sets the address at addr16 to word assuming Little Endian mode.
Overrides: IntelHex.__setitem__

minaddr(self)

source code 
Get minimal address of HEX content in 16-bit mode.
Returns:
minimal address used in this object
Overrides: IntelHex.minaddr

maxaddr(self)

source code 
Get maximal address of HEX content in 16-bit mode.
Returns:
maximal address used in this object
Overrides: IntelHex.maxaddr