View Source IntelHex (intel_hex v0.2.1)
Manipulate Intel HEX files
This is the main interface for loading, modifying and saving Intel HEX files. In general, you'll want to use methods here for most operations.
Internally, data is stored as lists of IntelHex.Block
structs. See that
module for transformations that aren't possible with the main functions.
Summary
Functions
Only keep data within the specified address range
Get the data at a specified address
Load an Intel Hex-formatted file into memory
Load an Intel Hex-formatted file into memory
Create an empty hex file
Save data to an Intel Hex-formatted file
Set a set of bytes at the specified address
Types
@type t() :: %IntelHex{blocks: [IntelHex.Block.t()], path: String.t()}
Primary type for handling Intel Hex file data
Functions
@spec crop(t(), non_neg_integer(), non_neg_integer()) :: t()
Only keep data within the specified address range
@spec get(t(), non_neg_integer(), non_neg_integer(), [{:fill, 0..255}]) :: binary()
Get the data at a specified address
Options:
:fill
- value to use when none exists (defaults to0
)
Load an Intel Hex-formatted file into memory
Load an Intel Hex-formatted file into memory
Raises File.Error or IntelHex.DecodeError if an error occurs.
@spec new() :: %IntelHex{blocks: [], path: String.t()}
Create an empty hex file
Use IntelHex.set/3
or other functions to populate it.
Save data to an Intel Hex-formatted file
Options:
:block_size
- the max data bytes per record. (defaults to 16)
@spec set(t(), non_neg_integer(), binary()) :: t()
Set a set of bytes at the specified address