I2C Questions and Errors | Cypress Semiconductor
I2C Questions and Errors
I have been working on interfacing with an Aptina Imager (MT9P031) which uses I2C for configuration. I have the GPIF setup to interface with the imager and GPIOs setup as enables, disables, etc. I have been able to interface I2C with other devices, but I am having issues with the Imager. We have the Imager working with and FX2, so much of the protcol I am using is copied from the FX2 firmware.
1) When using CyU3PI2cWaitForAck() or CyU3PI2cTansmitBytes() to write to the Imager registers, both functions return '74' which is CY_U3P_ERROR_FAILURE. When I check the I2C error code with CyU3PI2cGetErrorCode(), it returns '15' which is not listed in the error code enumeration. Any idea what this means?
status = CyU3PI2cTransmitBytes(&preamble, data, 2, 0);
2) When using CyU3PI2cSendCommand() to write to the Imager registers, it will always return CY_U3P_SUCCESS even if I use the wrong imager address or configure the preamble incorrectly. Any idea why it always returns a success?
status = CyU3PI2cSendCommand(&preamble, 4, CyFalse);
3) As far as I understand, the ctrlMask member of the Preamble sets the start and stop bits AFTER each bit of the preamble. Does the I2C API automatically send a start bit BEFORE the first preamble bit? Does it send a stop bit after the last I2C bit, preamble or otherwise?