GithubHelp home page GithubHelp logo

nscooling / peripheral-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jumperr-labs/peripheral-template

0.0 3.0 0.0 70 KB

Template repo for creating new peripherals for Jumper Virtual Lab

License: Apache License 2.0

Python 10.49% C++ 85.21% C 1.48% Makefile 2.82%

peripheral-template's Introduction

Jumper Virtual Lab Peripheral Model Template

This repo contains a template for creating a new peripheral to use with Jumper Virtual Lab.

For more information, visit the docs.

Prerequisites

or

  • Jumper's Docker image, pull it with - docker pull jumperio/jumper-vlab

First step

  • Fork this repository on GitHub and clone the new repository onto your Linux machine.

  • Make sure you have the build prerequisites by running the following (either from Ubuntu 16.04 or Jumper's Docker image):

    cd /PATH/TO/YOUR/NEW/REPO
    python create_peripheral.py
  • After entering your peripheral name and choosing your peripheral's serial interface type, you should see the following files in your local library:

  1. Makefile
  2. board.json
  3. YOUR_PERIPHERAL_NAME.cpp
  4. YOUR_PERIPHERAL_NAME.h
  5. YOUR_PERIPHERAL_NAME.so in the _build folder.

Peripheral pinout and configuration template

  • You can find your peripheral component template in the board.json file with the following key fields:
  1. id - needs to be a unique number across all the peripherals in the board.json.
  2. type - no need to change this one.
  3. file - this tells the Virtual Lab where to find the shared object file for the peripheral. The default points to the YOUR_PERIPHERAL_NAME.so file in the _build folder.
  4. config: pins - this is where you can add pins. To add pins according to the peripheral's data sheet, just add pins to this list with the field name as the pin name and the value as the board's wire number.
{
  "name": "YOUR_PERIPHERAL_NAME",
  "id": 1,
  "type": "Peripheral",
  "file": "_build/YOUR_PERIPHERAL_NAME.so",
  "config": {
  	"pins": {
  	}
  }
}

Usage

  • Add the device logic to the Main() function in the YOUR_PERIPHERAL_NAME.cpp. You can also add more methods, members and global variables as needed.

  • When you want to run Jumper Virtual Lab with your peripheral:

  1. Run make
  2. Copy the .so file from the "_build/" directory to your Jumper Virtual Lab working directory. (same one as the "board.json" file)
  3. Add the component to your "board.json" file.
  4. Run Jumper Virtual Lab, for more information head to the https://docs.jumper.io/

License

Licensed under the Apache License, Version 2.0. See the LICENSE file for more information

peripheral-template's People

Contributors

inbarmoskovich avatar seryoni avatar yanivnis avatar

Watchers

James Cloos avatar Niall Cooling avatar  avatar

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.