#include "EEPROM.h"
#include "stdio.h"
void Inf_AT24C02_Init(void)
{
    HAL_I2C_Init(&hi2c2);
}

void Inf_AT24C02_WriteByte(uint8_t innerAddr, uint8_t byte)
{
    HAL_I2C_Mem_Write(&hi2c2,ADDR,innerAddr,I2C_MEMADD_SIZE_8BIT,&byte,1,2000);

    HAL_Delay(5);
    
}

uint8_t Inf_AT24C02_ReadByte(uint8_t innerAddr)
{
    uint8_t byte;
    HAL_I2C_Mem_Read(&hi2c2,ADDR+1,innerAddr,I2C_MEMADD_SIZE_8BIT,&byte,1,2000);
    return byte;
}
void Inf_AT24C02_WriteBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len)
{
    HAL_I2C_Mem_Write(&hi2c2,ADDR,innerAddr,I2C_MEMADD_SIZE_8BIT,bytes,len,2000);
    HAL_Delay(5);
}
void Inf_AT24C02_ReadBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len)
{
    HAL_I2C_Mem_Read(&hi2c2,ADDR+1,innerAddr,I2C_MEMADD_SIZE_8BIT,bytes,len,2000);

}



