Package intelhex
[hide private]
[frames] | no frames]

Package intelhex

source code

Intel HEX file format reader and converter.


Author: Alexander Belchenko (bialix AT ukr net)

Version: 1.0

Submodules [hide private]

Classes [hide private]
  IntelHex
Intel HEX file reader.
  IntelHex16bit
Access to data as 16-bit words.
  Record
Helper methods to build valid ihex records.
  _BadFileNotation
Special error class to use with _get_file_and_addr_range.
  IntelHexError
Base Exception class for IntelHex module
  _EndOfFile
Used for internal needs only.
  HexReaderError
  AddressOverlapError
  HexRecordError
  RecordLengthError
  RecordTypeError
  RecordChecksumError
  EOFRecordError
  ExtendedAddressRecordError
  ExtendedSegmentAddressRecordError
  ExtendedLinearAddressRecordError
  StartAddressRecordError
  StartSegmentAddressRecordError
  StartLinearAddressRecordError
  DuplicateStartAddressRecordError
  InvalidStartAddressValueError
  NotEnoughDataError
  BadAccess16bit
Functions [hide private]
 
hex2bin(fin, fout, start=None, end=None, size=None, pad=255)
Hex-to-Bin convertor engine.
source code
 
bin2hex(fin, fout, offset=0)
Simple bin-to-hex convertor.
source code
 
_get_file_and_addr_range(s, _support_drive_letter=None)
Special method for hexmerge.py script to split file notation...
source code
Function Details [hide private]

hex2bin(fin, fout, start=None, end=None, size=None, pad=255)

source code 
Hex-to-Bin convertor engine.
Parameters:
  • fin - input hex file (filename or file-like object)
  • fout - output bin file (filename or file-like object)
  • start - start of address range (optional)
  • end - end of address range (optional)
  • size - size of resulting file (in bytes) (optional)
  • pad - padding byte (optional)
Returns:
0 if all OK

bin2hex(fin, fout, offset=0)

source code 
Simple bin-to-hex convertor.
Parameters:
  • fin - input bin file (filename or file-like object)
  • fout - output hex file (filename or file-like object)
  • offset - starting address offset for loading bin
Returns:
0 if all OK

_get_file_and_addr_range(s, _support_drive_letter=None)

source code 
Special method for hexmerge.py script to split file notation into 3 parts: (filename, start, end)
Raises: