Question
How to read and storage data on an I2C eeprom using an stm32f100 series board.
Hello, I' m working in team on a project using stm32 f100 series board. I should use an eeprom to storage and read some data, the eeprom is the following: CAT24C512WI-GT3 and I also have the init code for this I2C eeprom:
void io_ee_scl(char s)
{
if(s)
GPIOB->BSRR=GPIO_PIN_6;
else
GPIOB->BRR=GPIO_PIN_6;
}
void io_ee_sda(char s)
{
if(s)
GPIOB->BSRR=GPIO_PIN_7;
else
GPIOB->BRR=GPIO_PIN_7;
}
void io_ee_wp(char s)
{
if(s)
GPIOB->BSRR=GPIO_PIN_5;
else
GPIOB->BRR=GPIO_PIN_5;
}
char read_eeprom() //read eeprom function
{
return ( (GPIOB->IDR&GPIO_PIN_7) ? 1 : 0 );
}so I know the pins conected to my eeprom.
Considering I'm new in stm32 I need your help to understand how I can read and write datas on my eeprom....
Thank you
