package intel_hex
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=a83e60c8097122190cab4c8e29514a27
sha512=7f6bad5f52fcb8804a52ca2dd54b00efb82c6e65a3c2cb4c2ed235895430786f8e666c22c298e8275fd7cc9511d9fb1d88da4ec9568c02438e43f9eb4a993c0e
Description
A Intel HEX manipulation library for parsing and generating Intel HEX (also known as IHEX) objects
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_hexYou can also get the latest version of the upstream (developer) branch.
$ opam pin intel_hex.dev https://github.com/dx3mod/intel_hex.gitIf 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
:00000001FFAlso, 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
- https://en.wikipedia.org/wiki/Intel_HEX
- https://www.tasking.com/documentation/smartcode/ctc/reference/objfmt_hex.html
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!