#ifndef EEPROM_H
#define EEPROM_H
#include "main.h"
#include "i2c.h"
#include <String.h>
#define ADDR 0xA0
#define EEPROM_ENERGY_ADDR 0x60 // EEPROM 存储电量存储地址
#define EEPROM_ENERGY_FLAG 0x64  //检验标志地址
#define EEPROM_ENERGY_FLAG_VAL  0xA5  //检验标志值
void Inf_AT24C02_Init(void);
void Inf_AT24C02_WriteByte(uint8_t innerAddr, uint8_t byte);
uint8_t Inf_AT24C02_ReadByte(uint8_t innerAddr);
void Inf_AT24C02_WriteBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len);
void Inf_AT24C02_ReadBytes(uint8_t innerAddr, uint8_t *bytes, uint8_t len);
void Clear_EEPROM_All(void); 


void Save_Float_To_EEPROM(uint8_t addr, float data);

float Read_Float_From_EEPROM(uint8_t addr);

void Save_Energy_To_EEPROM(float energy);

float Load_Energy_From_EEPROM(void);

#endif
