--- In [email protected], "Stéphane Herraiz"
<[EMAIL PROTECTED]> wrote:
>
> Hello,
> To use high level I2C function ( writeread() ) do I need to add in
my source
> directory the new i2c.h
> or it's is include somewhere in the devboard directory?
> Thanks
> BR
> 
> -- 
> Stéphane Herraiz
>

Hi Stephane,

No, this is not necessary.  In fact, if you would look to the file
i2c.h in ./devboard-R2_01/os/linux/arch/cris/arch/drivers, then you
will see it hasn't changed because of the new functionality I've added.

The "trick" lies in the ioctl items I've added, but that's in the file
./devboard-R2_01/os/linux/include/asm/etraxi2c.h.

There, you will definitely see changes compared to the original
version.  One of the things added, is:

#define I2C_WRITE       0x3                 /* writes to I2C device */
#define I2C_READ        0x4                 /* reads from I2C device */
#define I2C_WRITEREAD   0x5                     /* writes to I2C device
where to start reading */
#define I2C_SENSE       0x6                 /* senses the presence of
an I2C device */

Those are the items who make it possible to do a write, read or
writeread (and in the new version also sense) using the ioctl() calls.
 Using this mechanism, you don't have to worry about the "low level
dirty stuff" that's going on.

So, the only thing which must be available to compile your testapp, is
the file etraxi2c.h

But be careful that you're placing this header file in the correct
location.  See the other mail I posted today.

PS.  For those interested, I'm busy making an OO version of the I2C
driver.  If interested, let me know (not finished yet, though...).

Best rgds,

--Geert

Reply via email to