GithubHelp home page GithubHelp logo

tobiasgehring / electricui-embedded Goto Github PK

View Code? Open in Web Editor NEW

This project forked from electricui/electricui-embedded

0.0 0.0 0.0 691 KB

Add communications functionality to connect your hardware to a local user interface.

Home Page: https://electricui.com

License: MIT License

Shell 1.93% C 97.47% Makefile 0.37% CMake 0.23%

electricui-embedded's Introduction

Electric UI Embedded Library

Provides a default binary serial protocol, and the higher level handling functionality for use on embedded microcontrollers or other C/C++ compatible platforms. Intended for use with a ElectricUI compatible UI or device.

See the website for more information.

Getting Started

Arduino

  1. Ensure the Arduino IDE is installed (version >1.6.X tested ok) and the standard Arduino Blink.ino sketch compiles/flashes to the dev board.

  2. Clone or download the electricui-embedded repo onto your computer. Libraries are typically put in your "/arduino/libraries/electricui" folder or similar.

    If you plan on developing electricui-embedded, read the development section in this readme.

  3. In the Arduino IDE, simply click File > Examples > electricui > Examples > Basics > hello-blink to load an example sketch.

  4. Test building and flashing the firmware to the board, and boot up an interface to play with.

Other Microcontrollers

  1. Just clone the repo and use the electricui files. Import into your project as normal #include "electricui.h" and ensure the minimum setup functions are called.

  2. The library assumes that you will provide a pointer to a function which accepts a byte array, this function should then call your system's putc() or write_bytes() function.

  3. For for more detail, follow the docs or example Arduino code which shows the minimum setup and usage examples.

Developing electricui-embedded

Editing the library

If you are planning on developing electricui-embedded, we generally suggest cloning it somewhere useful and using symlinks into your project or Arduino libraries folder.

Unix (your Arduino sketchbook location may vary by OS/install):

sudo ln -s ~/projects/electricui-embedded/ ~/Arduino/libraries/electricui

Windows/Arduino can demonstrate issues with symbolic links across drives (ExFAT doesn't support them).

Documentation

The library has Doxygen formatted inline comments which provide explanation of both the internal and external API surfaces. This documentation is intended to improve developer experience while using compatible IDE's, and an intermediate is used to provide documentation on the website.

To generate documentation artifacts (html), call doxygen Doxyfile and then open docs/index.html.

Running tests

Testing uses the Ceedling (Ruby/rake) based testing framework.

  1. This project configures Ceedling to use the system's ceedling via gem.
    • If you don't have it installed, gem install --user-install ceedling
  2. Once setup, run ceedling or ceedling test:all.

Coverage Analysis

Run ceedling gcov:all to generate the coverage reports.
Use ceedling utils:gcov to generate a pretty HTML report. It will be located in the /test/build/artifacts/gcov folder.

You need gcovr installed, and on some Linux distros, may also need a gcovr runtime dependancy jinja2.

When attempting to run coverage analysis on OSX, the output results are slightly different due to subtle differences with the clang based toolchain. We test with a gcc+gcov environment running on $LINUX_DISTRO.

Lint Checks

lint_checks.sh provides a minimalist launch process for the oclint static analysis tool.
It will provide a report detailing the occurances of style violations (code smells) with varying severity levels.

Arduino Example Script validation

The arduino-example-test.sh provides automated batch compile validation for the example suite, across a range of devices.
Assumes a *nix shell and arduino-cli is installed.

Fuzzing

Fuzzing is performed using american fuzzy lop (afl-fuzz).

A minimal program accepts bytes from stdin, and a makefile based fuzzing harness provided in test/fuzz which provides helpers to build and start fuzzing.

Uses afl-gcc and afl-fuzz, and looks in the makefile's AFL_ROOT location. You will need to download and make afl, then adjust that path. Some binary formatted test files are included.

From /test/fuzz, run make all and it will build an instrumented test program, and start fuzzing.

Overheads and Benchmarks

The library has a reasonably small footprint, around 280 bytes of RAM and around 2.8k of codespace. Using the tracked variable functionality uses 3 bytes and 2 pointers per tracked variable (so 8 bytes on your Arduino Uno).

These numbers will vary based on your target architecture, word alignment and compiler settings.

Licence

electricui-embedded is MIT licensed.

electricui-embedded's People

Contributors

scottapotamas avatar mike-dax 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.