O'Reilly logo

GNU/Linux Rapid Embedded Programming by Rodolfo Giometti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required