The I2C tools
This are stored into the package i2c-tools and they are a set of utility programs we can use to easily manipulate an I2C device in user-space. They rely on the I2C /dev interface driver stored into the file drivers/i2c/i2c-dev.c
in the Linux's sources repository tree.
Note
See the file Documentation/i2c/dev-interface
into the Kernel's repository for further information about this special driver.
If our device is not managed by the kernel, that is, if we have not defined any driver that actually control it we can use the above driver with the followings utilities to get access to its registers.
First of all we can use the i2cdetect
command to get a list of all available I2C buses. For instance on the Wandboard we get the following:
root@wb:~# i2cdetect -l i2c-0 i2c 21a0000.i2c I2C adapter i2c-1 i2c 21a4000.i2c I2C adapter
Then with the same command we can get a list of all connected device with a specified bus....