2010-01-28 03:11:06 Writing I2C in userspace
Patrick Hotz (GERMANY)
i want to write a programm in eclipse which is using i2c-0 char-device....
This is a code-snippet:
/* Open I2C Device */
file = open_i2c_dev(1, "/dev/i2c-", 0);
if (file < 0 || set_slave_addr(file, 0x48, 0))
My problem is that i can´t compile my programm in eclipse brcause the function "open_i2c_dev", "i2c_smbus_write_byte" and the other i2c-functions aren´t known.....
If i compile the programm as a part of the userspace programms, there is no problem.....
Is there a howto or a example how can i use eclipse to develop the programm?
2010-01-28 03:33:04 Re: Writing I2C in userspace
Mike Frysinger (UNITED STATES)
the uclinux-dist build process shows you the exact compile commands it runs. figure out what -I paths are being used there and add them to your eclipse setup.
you can run specific subdirs by doing:
2010-01-29 06:50:08 Re: Writing I2C in userspace
Rob Maris (GERMANY)
I got it compiled outside of the linux build environment without errors via this include:
while having copied the .h file from the distribution to the project local directory.