package intel_hex

  1. Overview
  2. Docs
Intel HEX manipulation library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.4.1.tar.gz
md5=a83e60c8097122190cab4c8e29514a27
sha512=7f6bad5f52fcb8804a52ca2dd54b00efb82c6e65a3c2cb4c2ed235895430786f8e666c22c298e8275fd7cc9511d9fb1d88da4ec9568c02438e43f9eb4a993c0e

Description

A Intel HEX manipulation library for parsing and generating Intel HEX (also known as IHEX) objects

Tags

ihex intelhex embedded bytes hex

Added to opam-repository:

README

Intel_hex

A Intel HEX manipulation library for parsing and generating Intel HEX (also known as IHEX) objects. This format is commonly used to represent compiled program code and data that is loaded into a microcontroller, flash memory, or ROM in embedded systems programming.

Quick start

You can install the intel_hex library using the OPAM package manager or any other method you prefer.

$ opam install intel_hex

You can also get the latest version of the upstream (developer) branch.

$ opam pin intel_hex.dev https://github.com/dx3mod/intel_hex.git

If you are using Dune, please add the intel_hex library to your dependencies.

In use

Here is an example of how to create an Intel HEX file with test data and print it:

Intel_hex.Record.
[
  Extended_linear_address 0x0F;
  Data (0x0000, "Hello ");
  Data (0x0007, "World!");
  End_of_file;
]
|> Intel_hex.Encode.into_string 
|> print_endline
:02000004000FEB
:0600000048656C6C6F20E6
:06000700576F726C6421CA
:00000001FF

Also, you can read Intel HEX objects from any source, of course.

In_channel.with_open_text "data.hex" Intel_hex.Decode.from_channel
- : Intel_hex.Object.t =
[Intel_hex.Record.Extended_linear_address(0x000F);
 Intel_hex.Record.Data(0x0000, "Hello ");
 Intel_hex.Record.Data(0x0007, "World!");
 Intel_hex.Record.End_of_file]

For more details, see API references and examples/ directory.

References

Format description

Reference implementations

License

The project is licensed under the MIT License, which allows for all permissions. Just use it and enjoy yourself without fear. We are always open to pull requests!

Dependencies (3)

  1. ohex
  2. ocaml >= "4.14"
  3. dune >= "3.6"

Dev Dependencies (2)

  1. odoc with-doc
  2. alcotest with-test

Used by

None

Conflicts

None