I need a simple C script to read sensor data from a INA219 chip via I2C ( http://www.ti.com/lit/ds/symlink/ina219.pdf ).
Everything is already written and documented for the 3.x kernel module ( http://lxr.free-electrons.com/source/drivers/hwmon/ina2xx.c )
I use 2.6.32-5-486 Kernel and dont need a kernel module, simple c code that uses the #include and reads the data is enough.
I am currently stuck because all examples and kernel modules i found use i2c_read functions but due to kernel and smbus in i2c-dev.h I have to use i2c_smbus_read_i2c functions.
I am not a C programmer - I can already read registers but it seems that I mismatch datatypes, bits and bytes.
Additional Project Description:
07/24/2013 at 20:06 CEST
#include linux/i2c-dev.h should be used fpr i2c access.
I can send you a tiny C script i already use to read and write data to different sensors in the same bus...