Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ikskuh/zig-ihex
An intel hex loader written in Zig
https://github.com/ikskuh/zig-ihex
ihex intel-hex zig zig-package ziglang
Last synced: about 1 month ago
JSON representation
An intel hex loader written in Zig
- Host: GitHub
- URL: https://github.com/ikskuh/zig-ihex
- Owner: ikskuh
- License: mit
- Created: 2020-04-18T19:44:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T11:26:17.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T01:25:05.237Z (2 months ago)
- Topics: ihex, intel-hex, zig, zig-package, ziglang
- Language: Zig
- Size: 2.17 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zig Intel Hex parser
A loader for the [Intel Hex](https://en.wikipedia.org/wiki/Intel_HEX) format used in embedded
development.## Features
- Supports all 6 record types
- Raw record parser (`parseRaw`)
- User-friendly preprocessor (`parseData`)
- Pedantic and lax parsing## Example
```zig
fn processData(x: void, offset: u32, data: []const u8) !void {
std.debug.warn("read slice @ 0x{x}: {x}\n", .{ offset, data });
}pub fn main() !void {
var file = try std.fs.cwd().openFile("data/example.ihex", .{ .read = true, .write = false });
defer file.close();var entry_point = try ihex.parseData(file.reader(), ihex.ParseMode{ .pedantic = true }, {}, error{}, processData);
if (entry_point) |ep| {
std.debug.warn("entry point: 0x{x}\n", .{ep});
}
}
```