Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fhunleth/intel_hex
Load, modify and save Intel hex files in Elixir
https://github.com/fhunleth/intel_hex
Last synced: 3 months ago
JSON representation
Load, modify and save Intel hex files in Elixir
- Host: GitHub
- URL: https://github.com/fhunleth/intel_hex
- Owner: fhunleth
- License: apache-2.0
- Created: 2018-01-04T22:07:23.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2023-10-05T16:06:47.000Z (over 1 year ago)
- Last Synced: 2024-09-14T09:51:20.495Z (4 months ago)
- Language: Elixir
- Homepage:
- Size: 60.5 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# IntelHex
[![CircleCI](https://circleci.com/gh/fhunleth/intel_hex.svg?style=svg)](https://circleci.com/gh/fhunleth/intel_hex)
[![Hex version](https://img.shields.io/hexpm/v/intel_hex.svg "Hex version")](https://hex.pm/packages/intel_hex)This is a library for loading, modifying and saving [Intel HEX
files](https://en.wikipedia.org/wiki/Intel_HEX). This file format is frequently
used for firmware images on microcontrollers.Here's an example use:
```elixir
# Load a file. Note the little memory map of the file contents
iex> hex = IntelHex.load!("./test/test.hex")
%IntelHex{0x0->26B|0x1B->15B|0x2B->31B}# Take a look at the first two 16-bit integers
iex> <> = IntelHex.get(hex, 0, 4); {x, y}
{6146, 512}# Change them to {1, 2}
iex> hex = IntelHex.set(hex, 0, <<1::little-16, 2::little-16>>)
%IntelHex{0x0->26B|0x1B->15B|0x2B->31B}# Check that it worked.
iex> <> = IntelHex.get(hex, 0, 4); {x,y}
{1, 2}# Save it to a new file
iex> IntelHex.save(hex, "new.hex")
:ok
```## Installation
The package can be installed by adding `intel_hex` to your list of dependencies
in `mix.exs`:```elixir
def deps do
[
{:intel_hex, "~> 0.2.1"}
]
end
```