I2cTools移植

解压放到external目录下

#i2c tools
PRODUCT_PACKAGES += \
    libi2c-tools \
i2cdetect \
i2cget \
i2cset \
i2cdump \
i2ctransfer

把这些代码放到device/rockchip/common/device.mk里面  编译个萤火虫的镜像,我拿板子下来你烧录下
@Howard备注,需要放到/device/rockchip/rk3399/device.mk里面,否则不会编进系统

模块编译
mmm external/i2c-tools-4.3/


C:\Users\Administrator>adb -s RKDEV2016081618429 push C:\Users\Administrator\Desktop\i2c\i2cdetect /system/bin
C:\Users\Administrator\Desktop\i2c\i2cdetect: 1 file pushed, 0 skipped. 2.4 MB/s (18632 bytes in 0.007s)

C:\Users\Administrator>adb -s RKDEV2016081618429 push C:\Users\Administrator\Desktop\i2c\i2cdump /system/bin
C:\Users\Administrator\Desktop\i2c\i2cdump: 1 file pushed, 0 skipped. 19.4 MB/s (22720 bytes in 0.001s)

C:\Users\Administrator>adb -s RKDEV2016081618429 push C:\Users\Administrator\Desktop\i2c\i2cget /system/bin
C:\Users\Administrator\Desktop\i2c\i2cget: 1 file pushed, 0 skipped. 17.0 MB/s (18624 bytes in 0.001s)

C:\Users\Administrator>adb -s RKDEV2016081618429 push C:\Users\Administrator\Desktop\i2c\i2cset /system/bin
C:\Users\Administrator\Desktop\i2c\i2cset: 1 file pushed, 0 skipped. 29.6 MB/s (22720 bytes in 0.001s)

C:\Users\Administrator>adb -s RKDEV2016081618429 push C:\Users\Administrator\Desktop\i2c\i2ctransfer /system/bin
C:\Users\Administrator\Desktop\i2c\i2ctransfer: 1 file pushed, 0 skipped. 23.5 MB/s (18632 bytes in 0.001s)

C:\Users\Administrator>adb -s RKDEV2016081618429 reboot

C:\Users\Administrator>adb -s RKDEV2016081618429 shell
nct_box:/ $
nct_box:/ $
nct_box:/ $
nct_box:/ $ i2
i2cdetect    i2cdump      i2cget       i2cset       i2ctransfer
nct_box:/ $ i2cdump -y -f 0 0x1b
No size specified (using byte-data access)
Error: Could not open file `/dev/i2c-0': Permission denied
Run as root?
1|nct_box:/ $ su
nct_box:/ # i2cdump  -y -f 0 0x1b
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 50 07 09 21 01 13 01 00 00 00 00 01 01 00 00 00    P??!???....??...
10: 80 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ??..............
20: 01 17 00 6f ff 00 00 00 10 00 ff 0f ff 02 19 0f    ??.o....?..?.???
30: 00 00 19 07 00 00 02 03 00 00 09 00 00 0a 00 0a    ..??..??..?..?.?
40: 00 0c 00 0c 00 07 00 01 00 0c 00 00 00 5f 00 03    .?.?.?.?.?..._.?
50: 06 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ??..............
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 cf 03 00 28 00 0c 1c 80 19 00 34 12 00 71 00    .??.(.????.4?.q.
80: 10 50 1f ac 00 40 10 01 00 00 00 04 00 00 00 00    ?P??.@??...?....
90: 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    U...............
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
nct_box:/ #

i2cdetect -l
i2cdetect -y -r 1
i2cdump -f -y 1 0x18
i2cset -f -y 1 0x18 0xB3 0x01
i2cget -f -y 1 0x18 0xB3

ts
i2cdump -f -y 4 0x14

I2Ctools源码文件-Android文档类资源-CSDN下载

你可能感兴趣的:(RK3399开发笔记,android)