Coder Social home page Coder Social logo

bbb's Introduction

##BeagleBone Black BBB C++ API

The code was forked from [a more generic API project] (https://github.com/piranha32/IOoo) and modifed to run exclusively on BeagleBone Black, resulting in a high performance, memory mapped C++ API. [BoneScript] (http://beagleboard.org/Support/BoneScript) and [Adafruit-BeagleBone-IO-Python] (https://github.com/adafruit/adafruit-beaglebone-io-python) are very useful libraries that let developers write applications quickly and efficiently. One less than ideal feature of those libraries is the manner in which they handle GPIO - using the /sys directory. This means that GPIO operations are executed via the Linux file system, which greatly limits the speed of GPIO operations. The BBB C++ API uses the Linux mmap function to execute GPIO operations, where values are read and written directly from system memory. The result is in some cases a thousand-fold increase in performance. Applications that require high frequency GPIO operations will benefit greatly from using the BBB C++ library.

###Setup

The following setup applies to the Angstrom Distribution. Setup on other Linux distributions would be very similar.

#####Setup Environment Variables. On your Linux system, two environment variables require setup and configuration to support the device tree overlay, which handles pin multiplexing. This can be accomplished by executing the following commands in the shell:

export SLOTS=/sys/devices/bone_capemgr.8/slots

export PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins

Placing the above lines in the .profile file in your home directory will execute them automatically upon login.

Double check that these directories exist. You may have to make changes to the capemgr version you are running. Use the directories you find on your system.

#####Device Tree Overlay The DTS file needs to be complied and placed into

/lib/firmware

For details on device tree overlays, see the great tutorial on the site listed below.

#####Running the Setup Script Once your environment variable are setup, device tree overlay compiled, running the setup script will enable the GPIO configuration and you're ready to execute code.

###Development

Developing high performance analong input is the highest priority, but also the most challenging to tackle, because of ongoing changes to the Linux kernel wrt ARM and how analog input is processed. I will probably wait until the dust settles before investing time in a solid analog API for the onboard ADCs. Development plans are as follows

  • Analog input using memory maped I/O
  • Integrate SPI and I2C functionality
  • More documentation and example code

###Useful Links

  1. https://github.com/piranha32/IOoo

  2. http://derekmolloy.ie/tag/beaglebone-black

bbb's People

Contributors

petermancuso avatar

Watchers

Mohsen Majnoon 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.