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:

Get GNU/Linux Rapid Embedded Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.