Git Product home page Git Product logo

libcintelhex's Introduction

cIntelHex - A C library for parsing Intel HEX files

Build status

Authors

Martin Helmich [email protected]
Oliver Erxleben [email protected]

University of Applied Sciences Osnabrück

André Colomb [email protected]

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Synopsis

libcintelhex is a C library for parsing Intel HEX files and mapping their binary contents into application or device memory.

Installation

Requirements

libcintelhex has no requirements besides a halfway recent GCC and a C standard library. Compilation on Windows with MinGW has also reported to be successful, building with Clang is still problematic, though.

When cloning from Git, you will also need autoreconf to generate the build system.

Compilation

Installation as usual:

autoreconf -i
./configure
make
make install

Usage

After installation, include cintelhex.h and add -lcintelhex to your linker flags.

Reading Intel HEX data

This library can parse Intel HEX data either from an input file or directly from a given string:

ihex_recordset_t* r1 = ihex_rs_from_file("my_filename");

char* input = ":1a01000021A4B2Fe...";
ihex_recordset_t* r2 = ihex_rs_from_string(input);

Applying Intel HEX data

Intel HEX data can be copied to any region in memory (either somewhere in RAM, but also to mapped memory regions of hardware devices):

void* dst = malloc(8192); // Allocate target region.
int   r   = ihex_mem_copy(rs, dst, 8192,
    IHEX_WIDTH_32BIT, IHEX_ORDER_BIGENDIAN); // Copy data to target region.

if (r == 0) printf("All is well.\n");
else return r;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.