This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See crosstool-NG for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Locate libi2c-dev include paths


Michael --

On Tue, Mar 5, 2013 at 10:13 AM, Michael Powell <mwpowellhtx@gmail.com> wrote:
> I have several paths to choose from when I find for the i2c-dev.h
> file. I can make a couple of educated guesses, but if someone had any
> recommendations, that'd be great.

My recollection was that the i2c-tools includes were such a disaster
that I ended up writing my own "raw" i2c and smbus support.  I use the
i2c includes from the linux kernel (for structures and ioctl numbers).

In fact, I install the i2c tools onto my root filesystem (to have the
command-line tools), but then explicitly delete the include files that
are installed as a part of i2c-tools.

>From memory, the issues I ran into were:

1. Wretched variable naming.  "size" actually implied the command
action(!), lots of one-letter variables doing tricky things.

2. Minimal documentation on what was actually going on (and some of it
might have been out of date / wrong / copy-paste fail).

3. i2c-tools included inline functions, and the license was GPL; given
that the application including this file is *not* GPL, this was enough
of a grey area that I felt I had to avoid it.

Re-implementing them is not very difficult; in fact, by doing it all
in a consistent way (and just using I2C_RDWR ioctl for everything),
the code is much cleaner and more straightforward.  IMHO, of course,
and this may not apply to all controllers, but it worked perfectly for
our use case.

Hope this helps,
Tony

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]