How to use I2C receive continue in Zephyr without restarting the transaction (without another start bit)?

I was trying to receive some data using "i2c_transfer" then continue the receiving without starting a new transaction. 

Stop bit was sent if I configured to use it or not. and if I try to continue the receiving the start bit and slave address will be sent again and start a new transaction.

Is there any API I can use to continue the receiving without starting a new transaction?

Parents Reply Children
  • There is my implementation
                    gsi2c_msg.buf = (char *)pu8_buf;
                    gsi2c_msg.len = (uint32_t) u16_len;
                    gsi2c_msg.flags = I2C_MSG_WRITE | (b_stop ? I2C_MSG_STOP : 0);
                    printf("I2C Sending to 0x%X: ", u16_addr);
                    for (uint16_t i = 0; i < u16_len; i++)
                    {
                        printf("0x%02X ", pu8_buf[i]);
                    }
                    printf("\n");
                    s32_retval = i2c_transfer(gpstr_internal_i2c_dev , &gsi2c_msg , 1 , u16_addr);
    b_stop is used for choosing to send stop bit or not.
    I sent the first byte with b_stop = 0
    then the second byte with b_stop = 1
    after the first byte the transaction stop:
    Is that mean "i2c_transfer" will always stop the transaction?
    Is there any API I can use to continue the receiving without starting a new transaction?
  • Hi,

    My understanding is that if you don't define I2C_MSG_STOP , then between the bytes it will not generate STOP but at the last byte it will generate a STOP. I think it's mandated by the I2C Spec: 

    https://www.nxp.com/docs/en/user-guide/UM10204.pdf




    There is some ongoing discussion here, not 100% sure if it's relevant to what you want to do though: 
    github.com/.../76660

Related