using i2c

Hello !

I’m currently working with an i2c driver. But i don’t know how using devctl control command for sending/receiving data :

i2c_send_t send;

send.slave.addr = …;
send.slave.fmt = …;
send.len = …;
send.stop = …;

if (error = devctl (fd, DCMD_I2C_SEND, &send, sizeof(send), NULL))
{

The devctl command always sends me an invalid argument error :cry: .

Thanks for your help

Richard

You seems to be handling the devctl call properly. It could be one of the argument of send.* that is wrong. Check the doc of the driver (assuming there is some).

hello richard ,

i am have an i2c driver for a board . but finding erors when i built the application like incomplete data send , receive buffer is too short etc , i have tried every sort to remove these bugs …but coulnt succeed …so can u plz send me u r application code . any help would be appreciated.

regards