This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem with Davinci I2C driver

Hello,

after i wrote a small test programm how to use the i2c from user space I observe that the driver do not behave as expeccted.

When i want to do an write/read without an stop between write and read the driver genarate a stop biit after write and realeas the bus.

Here is a snippet of the code.

case POLL_IN:
         j = read(fd_slave, &knx_data[0], DATA_LEN);
     
   
        if (knx_data[0] == 0x3f && knx_data[1] == 0xf0 &&
            knx_data[2] == 0x00 && knx_data[3] == 0x01 &&
            knx_data[4] == 0x00 && knx_data[5] == 0xF4 &&
            knx_data[6] == 0x55)
        {
            s_data[0] = (OWN_ADDR << 1)  | 1 ;
            s_data[1] = knx_data[1];
            s_data[2] = knx_data[2];
            s_data[3] = 0x03;
            s_data[4] = 0x30;
            s_data[5] = 0;
            s_data[6] = 0;
            s_data[7] = 0x79;
            s_data[8] = 0x2B;
               
            msg[0].addr = (knx_data[0] >> 1);
            msg[0].flags = 0;                                    // write message
            msg[0].len = 9;
            msg[0].buf = &s_data[0];

            msg[1].addr = (knx_data[0] >> 1);
            msg[1].flags = I2C_M_RD;                 // read message
            msg[1].len = 1;
            msg[1].buf = &ack_data[0];
       
            msgset.nmsgs = 2;
            msgset.msgs = msg;
           
            ioctl(fd_master, I2C_RDWR, &msgset);
               
            ack++;
        }

        //else
           
    }
        break;

 

Has anybody an idea.

 

Kindly regards

 

Hans