Version 3 (modified by 3 years ago) ( diff ) | ,
---|
Linux I2C access
You can not use standard read/write ioctl's on I2C devices because these devices do not pertain to a specific I2C slave device but instead an I2C controller.
The Linux kernel API for i2c devices can be found here:
- https://lxr.missinglinkelectronics.com/linux/include/uapi/linux/i2c-dev.h - ioctl API
- https://www.kernel.org/doc/Documentation/i2c/dev-interface - documentation
For example code take a look at the i2cget source from the i2c-tools package. This source contains a commonly used userspace header file (i2c-dev.h) that provides i2c_smbus_* functions that you can use.
Note:
See TracWiki
for help on using the wiki.