package intel_hex

  1. Overview
  2. Docs
Intel HEX manipulation library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.4.tar.gz
md5=122084ceec49cdc51a21f15a606631ad
sha512=3f4ca5acdd06385f5d2d5408c518590c62eb8aa1d8a0797ad537317c3fe5828ea93218288a84898e269724688c3f1bd171a437e3f7600d08e1a140d1ae08a53e

doc/README.html

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!