You can refer to the code example in Psoc Creator : SCB_I2cCommSlave .
I did manage to get my slave to communicate back to the master. In the process, I discovered a new problem:
Since my PSOC4 slave spends most of its time capturing and processing information off the A to D sensors, some commands I issue from the master do not get through to the slave. This mainly occurs when I send two commands sequentially from the master.
This happens because I have my program listening for commands then updating the sensors (or taking CPU time to execute the command). When the second command reaches the slave, the slave PSOC4 is busy and therefore cannot execute it.
What would be very helpful is if I had an interrupt that fires on a valid address receipt. Upon arrival of the address, I would invoke the command sent in the I2C data stream.
I do know that the I2C object has an interrupt, but this manages the transfer of data. I may be wrong, but the interrupt does not seem capable of performing what I need.
Is there a way of tapping into the interrupt or do I have to rely on polling? Is there a way, perhaps I can signal that the slave is busy? Any other suggestions you folks have?