1. For Ubuntu, the i2c-test tool can install directly,
sudo apt-get install python-smbus
sudo apt-get install i2c-tools
2. For other linux platform, suchas Android, it may need download source and re-compile, the source as below,
https://github.com/groeck/i2c-tools
For How-to build in Android, can refer below link,
http://stackoverflow.com/questions/19763831/building-i2c-tools-on-android
3. How to use the i2c-test tools,
i2c-tools中含有四個執行檔
a. i2cdetect – 用來列舉I2C bus和上面所有的裝置, for more information please check below link,
https://linux.die.net/man/8/i2cdetect
b. i2cdump – 顯示裝置上所有register的值, for more information please check below link,
https://linux.die.net/man/8/i2cdump
c. i2cget – 讀取裝置上某個register的值, for more information please check below link,
https://linux.die.net/man/8/i2cget
d. i2cset – 寫入裝置上某個register
https://linux.die.net/man/8/i2cset