Trying to find an example of the dual slave I2C capability. I'm wondering if this will allow me to use I2C0 with two slave addresses. If so how do you set it up and how does the interrupt differentiate between the incoming addresses. The documentation I've found just mentions it in passing and I haven't been able to find more.
// Configure and turn on the I2C0 slave interrupt. We are only interrupting when the slave device receives data. I2CSlaveIntEnableEx(I2C0_BASE, I2C_SLAVE_INT_DATA); // Enable the I2C0 slave module. I2CSlaveEnable(I2C0_BASE); // Set the slave address to SLAVE_ADDRESS. I2CSlaveInit(I2C0_BASE, EEPROM_SLAVE_ADDRESS); void irq_I2C0SlaveIntHandler(void) { uiStatus = I2CSlaveStatus(I2C0_BASE); // Clear the I2C0 interrupt flag. I2CSlaveIntClear(I2C0_BASE); ////////////////////////////////////////////////// //DSP Master has requested data // if(uiStatus & I2C_SLAVE_ACT_TREQ) { I2CSlaveDataPut(I2C0_BASE, (uint8_t)oData); } // ////////////////////////////////////////////////// ////////////////////////////////////////////////// //Master has sent data // if(uiStatus &I2C_SLAVE_ACT_RREQ) { // master is pushing data uiData = I2CSlaveDataGet(I2C0_BASE); .... }
This is roughly my current setup. Would like to recognize a second address with it's own operation but not sure how if it is indeed possible. I can't seem to find anything besides a one line reference to I2CSOAR2