how to read values from 24c16 EEPROM IC
Hi, I am new to stm32 I am not getting how to read the values what I write to the 24c16 EEPROM IC .Plz help me how to read the values by generating the read function in stm32 f103.
void write_eeprom_reg(uint16_t reg_addr, uint8_t value)
{
//uint8_t d[3];
d[0]=(reg_addr>>8) & 0xFF;
d[1]=(reg_addr) & 0xFF;
d[2]=value;
while(HAL_I2C_IsDeviceReady(&hi2c1,(uint16_t)(0x50<<1),3,100)!=HAL_OK)
{
}
if(HAL_I2C_Master_Transmit(&hi2c1,(uint16_t)(0x50<<1),(uint8_t*)d,sizeof(d),1000)!=HAL_OK)
{
Error_Handler();
}
else
{
printf("Master transmitt Successfull\r\n");
}
}
this is the code I have written for write operation but I dont know how to do code for read operation. Plz help me how to do.
Thank you
