I am interfacing CC2543 with LIS2DE12TR using I2C according to example code.
But unable to read particular register using register address. because I don't understand how to send the register address and what is the Status of I2CSTAT after sending the register address.
I have also read the User's Guide 20.1.4.2 Master Mode for The knowing about Status of I2CSTAT Register..
So Please Help me if any one know about it.....
Thanks
CC2543 working as a master
#pragma vector = I2C_VECTOR __interrupt void I2C_ISR(void) { // Clear I2C CPU interrupt flag. I2CIF = 0; // If a Start or Restart condition has been transmitted ... if (I2CSTAT == 0x08 || I2CSTAT == 0x10) { // Send Slave address and R/W access. I2CDATA = (SLAVE_ADDRESS << 1) | READ_FROM_SLAVE; // End Start condition. I2CCFG &= ~I2CCFG_STA; } // If a Data byte has been received and acknowledge has been returned... else if (I2CSTAT == 0x50) { // Read Data byte. buffer[bufferIndex++] = I2CDATA; } // If finished receiving... if (bufferIndex >= BUFFER_SIZE ) { // Generate Stop condition. I2CCFG |= I2CCFG_STO; // Disable interrupt from I2C by setting [IEN2.I2CIE = 0]. IEN2 &= ~IEN2_I2CIE; }