npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

efm8load

v1.0.0

Published

EFM8 bootloader download library

Downloads

8

Readme

node-efm8load

Installation

npm install efm8load --save

How to Use

Load the module

var efm8load = require('efm8load');

Get a list of all EFM8 USB devices in bootloader mode

var devices = efm8load.devices();

devices will contain an array of objects, one for each EFM8 device available. Most important are family, the device family as identified by the productId, and loader, a function that returns an EFM8Loader instance for the device.

Here is some sample output:

[ { vendorId: 4292,
    productId: 60105,
    path: '0002:0023:00',
    release: 256,
    interface: 0,
    family: 'EFM8UB1',
    loader: [Function] } ]

Open a device

A device can be opened either by calling the loader function from the device list or by creating an EFM8Loader:

var loader = new efm8load.EFM8Loader(device);

If no device is given, the first EFM8 USB device is opened.

EFM8Loader

The EFM8Loader gives you access to all bootloader functions documented by SiLabs:

  • bootloaderVersion(callback)
  • identify(id, callback)
  • setup(callback)
  • erase(addr, data, callback)
  • write(addr, data, callback)
  • verify(addr, data, callback)
  • lock(signature, lock, callback)
  • runApp(callback)

The function provided as callback is always called with the arguments error, response.

Possible values of id can be found in efm8load.id, e.g. efm8load.id.EFM8UB10F8G_QFN20.

data should be an array of bytes.

Full example

Here is a exmple of how to determine the type of EFM8UB1:

var efm8load = require('efm8load');
var async = require('async');

// Open the first EFM8
var loader = new EFM8Loader();
// Find the first matching id
async.detectSeries(efm8load.id, function(id, cb){
  loader.identify(id, function(err, response){
    cb(null, !err && response.equals(efm8load.response.Ack));
  });
}, function(err, result){
  // determine the key of result
  for(var key in efm8load.id){
    if(efm8load.id[key] === result){
      // log the device id
      console.log(key + ' (0x' + result[0].toString(16) + ', 0x' + result[1].toString(16) + ')');
    }
  }
  // close the device
  loader.close();
});