GithubHelp home page GithubHelp logo

richucj / i2c-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from richardtin/i2c-tools

0.0 0.0 0.0 530 KB

Clone of i2c-tools svn repository

Home Page: http://www.lm-sensors.org

License: GNU General Public License v2.0

Makefile 5.29% C 30.81% Groff 5.61% Perl 56.85% C++ 1.20% Python 0.25%

i2c-tools's Introduction

[TOC]

I2C TOOLS FOR LINUX

This package contains an heterogeneous set of I2C tools for the Linux kernel as well as an I2C library. The tools were originally part of the lm-sensors project but were finally split into their own package for convenience. The library is used by some of the tools, but can also be used by third-party applications. The tools and library compile, run and have been tested on GNU/Linux.

The latest version of the code can be downloaded from: https://github.com/groeck/i2c-tools

How to build i2c-tools for Android platform

Download i2c-tools

$ git clone https://github.com/richardtin/i2c-tools {ANDROID_ROOT}/external/i2c-tools

Compile i2c-tools ONLY

$ source build/envsetup.sh
$ lunch $TARGET-$VARIANT (ex: aosp_arm-eng, aosp_hammerhead-eng)
$ cd {ANDROID_ROOT}/external/i2c-tools
$ mm
  • There are 4 binary files - i2cdetect, i2cdump, i2cset, i2cget, and will be installed to {ANDROID_ROOT}/out/target/product/{PRODUCT_NAME}/system/bin folder.

Make new system.img

$ make snod
$ fastboot system system.img

Android.mk

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
LOCAL_SRC_FILES := tools/i2cbusses.c tools/util.c lib/smbus.c
LOCAL_MODULE := i2c-tools
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES := tools/i2cdetect.c lib/smbus.c
LOCAL_MODULE := i2cdetect
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES := libc
LOCAL_STATIC_LIBRARIES := i2c-tools
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES := tools/i2cget.c lib/smbus.c
LOCAL_MODULE := i2cget
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES := libc
LOCAL_STATIC_LIBRARIES := i2c-tools
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES := tools/i2cset.c lib/smbus.c
LOCAL_MODULE := i2cset
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES := libc
LOCAL_STATIC_LIBRARIES := i2c-tools
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES := tools/i2cdump.c lib/smbus.c
LOCAL_MODULE := i2cdump
LOCAL_CPPFLAGS += -DANDROID
LOCAL_SHARED_LIBRARIES := libc
LOCAL_STATIC_LIBRARIES := i2c-tools
LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
include $(BUILD_EXECUTABLE)

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.