Intel HEX Format Parser/Writer
A robust Rust library for parsing and writing Intel HEX format files. This library provides a safe and efficient way to handle Intel HEX format data, commonly used in embedded systems programming.
Installation
Add this to your Cargo.toml:
[]
= "0.1.1"
Usage
Basic Example
use IntelHex;
// Parse Intel HEX format text
let hex_text = ":10010000214601360121470136007EFE09D2190140\n:00000001FF";
let intel_hex = from_intel_hex_text.unwrap;
// Access memory contents
let memory = intel_hex.memory_cells;
if let Some = memory.get
// Write back to Intel HEX format
let output = intel_hex.to_intel_hex_text.unwrap;
Working with Memory Blocks
use ;
let mut intel_hex = new;
// Add a memory block
let block = MemoryDataBlock ;
intel_hex.add_memory_block.unwrap;
// Get continuous memory blocks
let blocks = intel_hex.memory_blocks;
for block in blocks
File I/O
use File;
use IntelHex;
// Read from file
let file = open.unwrap;
let intel_hex = from_reader.unwrap;
// Write to file
let output = create.unwrap;
intel_hex.to_writer.unwrap; // 16 bytes per data record
Documentation
For detailed API documentation, run:
Testing
Run the test suite with:
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
We welcome contributions to improve the library. Please feel free to submit a Pull Request.