A Rust library for parsing and generating Intel HEX (or IHEX) objects. This format is commonly used for representing compiled program code and data to be loaded into a microcontroller, flash memory or ROM.
Add the following to your Cargo.toml
:
toml
[dependencies]
ihex = "1.0"
In addition, and this to your crate root:
rust
extern crate ihex;
Here is an example which builds an IHEX object file with test data and prints it:
```rust extern crate ihex;
use ihex::record::Record; use ihex::writer;
fn main() { let records = &[ Record::Data { offset: 0x0010, value: vec![0x48,0x65,0x6C,0x6C,0x6F] }, Record::EndOfFile ];
let result = writer::createobjectfilerepresentation(records); if result.isok() { println!("{}", result.unwrap()); } } ```
ihex
is distributed under the terms of the MIT license.
See LICENSE for details.