Since the master initiates the read and the write command, an interrupt is not required. You could have a timer interrupt that periodically calls the read and write commands. But the slave will not write to the master's Tx buffer unless the communication is initiated by the master.
So the implementation is that you read the packet by calling the I2CMasterReadBuf API and transfer to the buffer directly. The API takes the buffer as a parameter.
Thanks for your reply.
Except for the a/b situation I mentioned, are there any other examples using interrupt?
There is something I want to test by referring to an I2C interrupt example.
Thanks and Regards,
These interrupts are handled internally and you don't have to process in your application. You can, however, have your custom function if required by defining the variable I2C_SCB_IRQ_INTERRUPT_INTERRUPT_CALLBACK in cyapicallbacks.h and defining the function I2C_SCB_IRQ_Interrupt_InterruptCallback(). Please see the ISR present in I2C_SCB_IRQ.c file.