S128 as a I2C slave

I am programming my S128 to be a I2C slave. How can I provide specific data from the buffer using masterReadSlaveWrite when the master sends the register before reading?

  • Just to be more clear:

    The master is sending: ADDRESS + REGISTER + READ

    I am trying to read the first byte (REGISTER)

    status = slave_i2c.p_api->masterWriteSlaveRead(slave_i2c.p_ctrl, i2c_data, 1);

    And then I am trying to read the data

    status = slave_i2c.p_api->masterReadSlaveWrite(slave_i2c.p_ctrl, rx_buffer, 4);

    But... It's not working.

    I don't know how to change the slave to receive the address, register, and according to register, provide a specific buffer.

  • In reply to afigueiredo:


    The below module guide should hopefully help you.