cancel
Showing results for 
Search instead for 
Did you mean: 

is the i2c init function right?

David.Cheng
Associate II
void sEE_Init(void)
{
    
    //printf("i2c init\n");
  sEE_LowLevel_Init();  // enable clock
 
  /*!< I2C configuration */
  /* sEE_I2C Peripheral Enable */
  I2C_Cmd(sEE_I2C, ENABLE);
  I2C_DeInit(sEE_I2C);
  /* sEE_I2C configuration after enabling it */
  I2C_Init(sEE_I2C, I2C_SPEED, I2C_SLAVE_ADDRESS7, I2C_Mode_I2C, I2C_DutyCycle_2,
           I2C_Ack_Enable, I2C_AcknowledgedAddress_7bit);
 
  /* Enable the sEE_I2C peripheral DMA requests */
  //I2C_DMACmd(sEE_I2C, ENABLE);
 
#if defined (sEE_M24C64_32)
  /*!< Select the EEPROM address according to the state of E0, E1, E2 pins */
  sEEAddress = sEE_HW_ADDRESS;
  
#endif /*!< sEE_M24C64_32 */
}

0 REPLIES 0