GithubHelp home page GithubHelp logo

sarathjeeva / bbbandroidhal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ankurayadav/bbbandroidhal

0.0 2.0 0.0 796 KB

This contains native library for devolving java code for BBBAndroid

Shell 0.01% Makefile 0.51% C 95.36% C++ 4.10% M4 0.02%

bbbandroidhal's Introduction

bbbandroidHAL

This contains native library for devoloping java code for BBBAndroid

Base native code has been downloaded from packpub website. This base code was developed by Andrew Henderson.

You can refer wiki for documentation. Or you can also refer to doxygen documentation for more references.

###Simple steps for making Android App using BBBAndroidHAL

  1. Create a new Android project in eclipse.
  2. Create a jni folder in the project directory.
  3. Copy all the files from bbbandroidHAL to you jni folder.
  4. Make proper Android.mk and Application.mk file since the given Android.mk and Application.mk files are configured to generate binary code form C program so that we can test our logic before actually making the Android App. For simplicity I have already created Android.mk and Application.mk files that can be directly used if you do not want to create one by yourself.
  5. Call ndk-build of Android SDK from you jni directory.
  6. Now you will be able use JNI interfaces in your Android java programs.
  7. You can see demo applications for you reference.

Note : If you want to use only few features of BBBAndroidHAL and do not want to compile all the necessary code then you will have to delete those files, and delete there references from Android.mk, bbbandroidHAL.h and jni_wrapper.h

###Some useful commands.

  1. Command to login into bbbandroid shell :

adb shell
  1. Command to send file into bbbandroid :

adb push file /path_in_bbbandroid
  1. Compiling Device Tree Overlay :

dtc -O dtb -o DEVICE-TREE-00A0.dtbo -b 0 -@ DEVICE-TREE-00A0.dts
  1. Installing Device Tree Overlay :

adb push DEVICE-TREE-00A0.dtbo /system/vendor/firmware/
echo DEVICE-TREE > /sys/devices/bone_capemgr.9/slots 

After installing device tree overlay we can export pins and provide proper permissions. 4. Exporting GPIO :


cd /sys/class/gpio/
echo 22 > export
cd gpio22
chmod 0777 value
  1. Exporting PWM :

cd /sys/class/pwm/
echo 0 > export
cd pwm0
chmod 0777 duty_ns period_ns run polarity
  1. Accessing ADC :

cd /sys/bus/iio/devices/iio:device0
cat in_voltage5_raw
chmod 0777 in_voltage5_raw
  1. Accessing I2C :

chmod 0777 /dev/i2c-1
  1. Accessing SPI :

chmod 0777 /dev/spidev1.0
  1. Accessing UART :

chmod 0777 /dev/ttyO4
  1. Accessing CAN : At first we have to install missing kernel modules for CAN.

cd /system/vendor/lib/modules/3.8.13+/kernel/drivers/net/can/
insmod can-dev.ko
insmod c_can/c_can.ko 
insmod c_can/c_can_platform.ko
insmod vcan.ko
cd /system/vendor/lib/modules/3.8.13+/kernel/net/can/
insmod can.ko
insmod can-raw.ko
insmod can-bcm.ko

Then we have to add vcan0 for virtual can.


ip link add dev vcan0 type vcan
ip link set up vcan0
ip link show vcan0
  1. Accessing USB :

cd /dev/bus/usb/
chmod -R 0777 .

###Youtube videos can be found here. bbbandroidHAL

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.