Giter VIP home page Giter VIP logo

jvintelhex's Introduction

JVIntelHEX

A javascript Intel HEX format writer (lightweight implementation)

Version 1.0 Created by Julian Vidal

What does it do?

Takes some arbitrary data and wraps it in the Intel HEX protocol. Note that this is not a full implementation and all the record types are not defined. It is up to you to fork this and implement them if you ever need them.

Installation

You only need to copy jvintelhex.js to your project.

Usage

// The data needs to be an array of bytes, so values over 255 won't work in this implementation.
data = new Array(4, 5);

// How many bytes per HEX record. Usually 16 or 32 but can take arbitrary numbers.
byteCount = 16;

// Your record's start address (you might not even need this so 0 is a good option if you don't know what this is)
startAddress = 0;

// Wether to prepend all records with ':' like in the official Intel HEX specs. 
useRecordHeader = true;

intelHEX = new JVIntelHEX(data, byteCount, startAddress, useRecordHeader);

// Crunch the data
intelHEX.createRecords();

console.debug('HEX file', intelHEX.getHEXFile());
console.debug('HEX as byte array', intelHEX.getHEXAsByteArray());
console.debug('HEX as binary string', intelHEX.getHEXAsBinaryString());

Examples

You will find a fully working example in the examples directory.

License

JVIntelHEX is released under the Apache 2.0 license. See the included LICENSE file.

VERSION HISTORY

2013-07-19 First version

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.