I2C in PSoC creator 2.0 | Cypress Semiconductor
I2C in PSoC creator 2.0
I'm trying to communicate with a sensor using I2C interface and I use the I2C Master (UDB) component in the PSoC creator 2.0 to do so.The reset is connected to '0' and the SDA, SCL connected to the sensor (slave) with pull-ups resistors. I used many times before I2C interface so I very familiar with the protocol. the problem is that this time I get a complete module with functions that from the datasheet I just can't understand how to make a simple reading from the slave's registers:
I need to access to the sensor's address and then access its registers using another address and then read the data and save it.
The protocol of the sensor interface is simple and standard:
Master|S|AD+W| |RA| |S|AD+R| | |NACK|P|
Slave | | |ACK| |ACK| | |ACK|DATA| | |
If someone can give me a simple code example for how to use the component's functions to make this all work I'll be very grateful...