Use I2C on Khadas VIM

You can follow below steps to use i2c-tools on Android

###Steps
1). Setup the env and lunch target

$ cd <path-of-your-project>
$ source build/envsetup.sh
$ lunch <your-target>   

2). Download the i2c-tools source code

$ cd <path-of-your-project>
$ cd external
$ git clone https://github.com/terry2droid/i2c-tools -b android

3). Build the i2c-tools

$ cd i2c-tools
$ mm -j8

Notice: The list of target file
1.out/target/product/kvim/system/bin/i2cset
2.out/target/product/kvim/system/bin/i2cdetect
3.out/target/product/kvim/system/bin/i2cget
4.out/target/product/kvim/system/bin/i2cdump

4). Push the target file to your device with adb command

$ adb root
$ adb remount
$ adb push i2cset /system/bin
$ adb push i2cget /system/bin
$ adb push i2cdump /system/bin
$ adb push i2cdetect /system/bin

5). How to use i2c-tools

$ adb shell
$ i2cdetect -y -r 2

About more usage for i2c-tools,You can have a try by yourself.

1 Like