/home/dou/a10/a20/A20-420-V12/lichee/out/linux/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-gcc -o i2c_util i2c-util.c
adb shell mkdir /dev/sample
adb push hello /dev/sample/hello
adb push hello /dev/sample/hello
adb shell chmod 777 /dev/sample/hello
先创建 /dev/sample目录,再将编译好的hello上传上去,最后将hello改成可执行的。
再进入命令行模式,进入Android的shell环境:
adb shell
#cd /dev/sample
#./hello
- / # i2c-rw /dev/i2c-2 0x38 0x1 0
- read salve:38 reg:01 value:12
- / #
- / # i2c-rw /dev/i2c-2 0x38 0x2 0
- read salve:38 reg:02 value:81