I2C Scan | Cypress Semiconductor
I'm using the EZ-BLE modules CYBLE-214009-EVAL and CYBLE-014008-EVAL with CY8CKIT-042 PSoC® 4 Pioneer Kits.
I'd like to scan for any/all I2C devices connected to my device, similarly to the Arduino project "i2c_scanner" (http://playground.arduino.cc/Main/I2cScanner).
Each module has identical code (apart from the I2C address) utilising an SCB Multi-Master-Slave component, when one module is triggered it should scan all I2C addresses and note any successful scans.
I've used a modified (with UART printfs for debugging) WriteCommandPacket() function from the SCB_I2cCommMaster code example.
So far my methods have involved looking for error codes from WriteCommandPacket() and I2CMasterWriteBuf(), but I've not been successful
So my problem is that I don't know the best way to test an I2C address with the aim of determining its presence. My ideal function would be something like: uint8 TestI2CAddress( uint8 address ) which would return boolean type values( 0u/1u ).
Can anyone suggest the best way to achieve my objective please?