/*
 * eeprom.h
 *
 *  Created on: Aug 8, 2021
 *      Author: wuwenfeng
 */

#ifndef EEPROM_H_
#define EEPROM_H_
#include "main.h"

#define EEPROM_ADDRESS 0xa0

typedef struct eeprom_write_buff
{
	struct eeprom_write_buff *next;
	uint16_t          add;
	char              date;
}eeprom_write_buff;

typedef struct eeprom_write_buff_info
{
	eeprom_write_buff *buff;
	eeprom_write_buff *head;
	eeprom_write_buff *end;
	uint32_t save_time;
	uint8_t save_timeout;
	uint8_t save_busy:1;

}eeprom_write_buff_info;

void EPPROM_SLOWWRITE_INIT();
void EEPROM_SLOWWRITE_SERVER();

void EEPROM_READ_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG);
void EEPROM_WRITE_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG);

#endif /* EEPROM_H_ */
