標籤:https 產生 get 命令編譯 dump oca col clone table
一、下載I2C-tools工具:
最近在移植i2c-tools工具,:https://i2c.wiki.kernel.org/index.php/I2C_Tools;百度到了wiki中的git地址;
1 git clone git://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git -b i2c-tools-3.1
二、將git下載到external目錄下,編寫Android.mk,將其打包system.img:
Android.mk內容如下:
1 LOCAL_PATH:= $(call my-dir) 2 3 include $(CLEAR_VARS) 4 5 LOCAL_MODULE_TAGS := optional 6 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include 7 LOCAL_SRC_FILES := tools/i2cbusses.c tools/util.c 8 LOCAL_MODULE := i2c-tools 9 include $(BUILD_STATIC_LIBRARY)10 11 include $(CLEAR_VARS)12 13 LOCAL_MODULE_TAGS := optional14 LOCAL_SRC_FILES:=tools/i2cdetect.c15 LOCAL_MODULE:=i2cdetect16 LOCAL_CPPFLAGS += -DANDROID17 LOCAL_SHARED_LIBRARIES:=libc18 LOCAL_STATIC_LIBRARIES := i2c-tools19 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include20 include $(BUILD_EXECUTABLE)21 22 include $(CLEAR_VARS)23 24 LOCAL_MODULE_TAGS := optional25 LOCAL_SRC_FILES:=tools/i2cget.c26 LOCAL_MODULE:=i2cget27 LOCAL_CPPFLAGS += -DANDROID28 LOCAL_SHARED_LIBRARIES:=libc29 LOCAL_STATIC_LIBRARIES := i2c-tools30 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include31 include $(BUILD_EXECUTABLE)32 33 include $(CLEAR_VARS)34 35 LOCAL_MODULE_TAGS := optional36 LOCAL_SRC_FILES:=tools/i2cset.c37 LOCAL_MODULE:=i2cset38 LOCAL_CPPFLAGS += -DANDROID39 LOCAL_SHARED_LIBRARIES:=libc40 LOCAL_STATIC_LIBRARIES := i2c-tools41 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include42 include $(BUILD_EXECUTABLE)43 44 include $(CLEAR_VARS)45 46 LOCAL_MODULE_TAGS := optional47 LOCAL_SRC_FILES:=tools/i2cdump.c48 LOCAL_MODULE:=i2cdump49 LOCAL_CPPFLAGS += -DANDROID50 LOCAL_SHARED_LIBRARIES:=libc51 LOCAL_STATIC_LIBRARIES := i2c-tools52 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include53 include $(BUILD_EXECUTABLE)
然後mm命令編譯目前的目錄,產生到:
make snod編譯進板子上的system/bin目錄下;
Android下的i2c-tools使用如連結所示,就不提及了;
http://blog.csdn.net/hui872370036/article/details/50379036
Android i2c-tools移植