I2C bus control using Qt/Qml
I managed to cross compile i2c-tools for my i.mx board. But doesn't have an idea how to control the bus through it.
can anyone please provide qt reference code for i2c.
jazzycamel last edited by jazzycamel
i2c-tools is a set of command line tools for interfacing with I2C bus, not an API. It does however use the i2c-dev.h which has methods for the SMBus protocol and is nicely documented "here":https://xgoat.com/wp/2007/11/11/using-i2c-from-userspace-in-linux/.
However as the I2C bus, like most devices, is mapped into the file system you can actually just read from/write to it using standard (or Qt) file operations. Look in your '/dev/' directory for filenames starting with 'i2c-', for example:
$ ls /dev/ | grep 'i2c-'
Look "here":http://elinux.org/Interfacing_with_I2C_Devices for an example of how to open, gain control, read and write to this 'file'.
Hope this helps ;o)
Hi jazzycamel ,
Perfect, That will help me a lot.
Thanks for your suggestion..