Hi All,
I am trying to implement I2C Slave functionality on NRF52832, So NRF52832 will act as a I2C slave.
So i found there is an example TWIS Slave and TWI Master Mode Drivers Example (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.2.0%2Ftwi_master_with_twis_slave_example.html).
This is geed example to start.
But i have a doubt, i am not sure how to receive data/command from I2C master and I2C slave device should respond against that data.
in the example there is twis_event_handler() callback function which handles read/write operation on I2C slave device, So whenever master has to read data it just send a request to the i2c slave and twis_event_handler() callback function will get triggered, we get p_event->type and p_event->data.buf_req. So in response to this I2C slave send the data to the master.
But suppose i have to send following command/data from master to request some data from i2c slave
1). 0xA1 0xA2 0x1 0x2
2) 0xA4 0xA5
So, how and where i2c slave will receive this command, so that according to received data/command, i2c slave can respond to the master. It would be great help if i can get some example.
Thanks & Regards
Pradeep