码迷,mamicode.com
首页 > 移动开发 > 详细

Android i2c-tools移植

时间:2018-01-29 16:02:40      阅读:232      评论:0      收藏:0      [点我收藏+]

标签: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 := optional
14 LOCAL_SRC_FILES:=tools/i2cdetect.c
15 LOCAL_MODULE:=i2cdetect
16 LOCAL_CPPFLAGS += -DANDROID
17 LOCAL_SHARED_LIBRARIES:=libc
18 LOCAL_STATIC_LIBRARIES := i2c-tools
19 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
20 include $(BUILD_EXECUTABLE)
21 
22 include $(CLEAR_VARS)
23 
24 LOCAL_MODULE_TAGS := optional
25 LOCAL_SRC_FILES:=tools/i2cget.c
26 LOCAL_MODULE:=i2cget
27 LOCAL_CPPFLAGS += -DANDROID
28 LOCAL_SHARED_LIBRARIES:=libc
29 LOCAL_STATIC_LIBRARIES := i2c-tools
30 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
31 include $(BUILD_EXECUTABLE)
32 
33 include $(CLEAR_VARS)
34 
35 LOCAL_MODULE_TAGS := optional
36 LOCAL_SRC_FILES:=tools/i2cset.c
37 LOCAL_MODULE:=i2cset
38 LOCAL_CPPFLAGS += -DANDROID
39 LOCAL_SHARED_LIBRARIES:=libc
40 LOCAL_STATIC_LIBRARIES := i2c-tools
41 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
42 include $(BUILD_EXECUTABLE)
43 
44 include $(CLEAR_VARS)
45 
46 LOCAL_MODULE_TAGS := optional
47 LOCAL_SRC_FILES:=tools/i2cdump.c
48 LOCAL_MODULE:=i2cdump
49 LOCAL_CPPFLAGS += -DANDROID
50 LOCAL_SHARED_LIBRARIES:=libc
51 LOCAL_STATIC_LIBRARIES := i2c-tools
52 LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/$(KERNEL_DIR)/include
53 include $(BUILD_EXECUTABLE)

然后mm命令编译当前目录,生成到:

技术分享图片

make snod编译进板子上的system/bin目录下;

 

 

Android下的i2c-tools使用如链接所示,就不提及了;

http://blog.csdn.net/hui872370036/article/details/50379036

 

Android i2c-tools移植

标签:https   生成   get   命令编译   dump   oca   col   clone   table   

原文地址:https://www.cnblogs.com/linhaostudy/p/8376577.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!