I use the fixed function I2C with the exI2C component regularly with good success. I currently have a project where I need a second I2C slave.
Since the PSoC5LP I am using has only one fixed function I2C block, I need to use a UDB equivalent of the ezI2C slave.
It appears that the register addressing needs to be manually implemented for the UDB I2C slave in order to make it function like the ezI2C block? My main loop has a lot of work going on, so I need to have the register addressing handled in an interrupt like the ezI2C. Any ideas before I completely rewrite the ISR for the I2C slave 😉
The ezI2C is easy, I'll give you that. I need to emulate a typical I2C device where the master sends a register address and the next read or write begins at that address. I have tweaked the interrupt routine to use the first byte of a write sequence as the register address, but I was hoping there was a cleaner way of doing this. I don't want to have to process in the main loop.
The attached file (rename to I2C_INT.c) is the modified version that supports ezI2C style functionality for my project. I only did mods for the specific component configuration I am using, but one should easily see what I did. It seems to work quite reliably. I did an A/B test with the FF based ezI2C component and it appears to operate the same. I need to do some more cleanup before it goes to production. Let me know if there is a better way 😉