Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

I2C configuration code

$
0
0
Hello,
I tried with the I2C master Apps, to read one register ( 8 bits9, with this code :
Code:


int main(void)
{
  DAVE_STATUS_t status;

uint8_t rx_data;
// Slave address 0x77
uint8_t registerD0 = 0xD0;




  status = DAVE_Init();          /* Initialization of DAVE APPs  */

  while(1U)
  {
          I2C_MASTER_Transmit(&I2C_MASTER_0,true,0x77,&registerD0,1,false);
        while(I2C_MASTER_IsTxBusy(&I2C_MASTER_0));


        I2C_MASTER_Receive(&I2C_MASTER_0,true,0x77,&rx_data,1,true,true);
        while(I2C_MASTER_IsRxBusy(&I2C_MASTER_0));

  }
}

The protocol to read a register is described on this picture :
Attachment 2523

Do you se any mistakes on the code ?
Because I got nothing.


Thank you,
Nicolas
Attached Images

Viewing all articles
Browse latest Browse all 9892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>