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 Raw I2C Bus

Now, as done for USB bus we should take a look at how we can get direct access to the I2C bus. In the same manner as for USB devices when one of them hasn't a dedicated driver it can be managed directly from the user space. The only problem may arise if the I2C device can generate interrupts, in this case we cannot manage these signals from the user-space and a kernel driver must be used. However this is a rare case and the presented technique can be used in most cases.

Writing data in C

As first example we're going to write some data to the DAC chip named TC1321 which is mounted on the development board we used above connected to the BeagleBone Black board.

Note

The datasheet is available at the URL: http://ww1.microchip.com/downloads/en/DeviceDoc/21387C.pdf ...

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