#ifndef _I2C_EEPROM_H
#define _I2C_EEPROM_H

#include "gw3323_iic.h"

// Software IIC enable: software: 1 hardware: 0
#define SOFT_I2C_ENABLE         0

//是否使用硬件的连续写与读函数-当 SOFT_I2C_ENABLE 为0时有效
//1为使用 0为不使用
#define HARDWARE_COUNTINE   0


// EEPROM address
#define EEPROM_WRITE_ADDR       0xa0    //0xa8
#define EEPROM_READ_ADDR        0xa1    //0xa9

// Power-on detection EEPROM chip reads memory address and value
#define CHECK_FLAG              0xab
#define CHECK_ADDR              127

void hardware_i2c_init(void);
u8 at24c01_read_one_byte(u8 addr);
void at24c01_write_one_byte(u8 addr,u8 data);
void at24c01_write_len_byte(u16 addr,u32 data,u8 len);
u32 at24c01_read_len_byte(u16 addr,u8 len);
void at24c01_write(u16 addr,u8 *p,u16 num);
void at24c01_read(u16 addr,u8 *p,u16 num);
u8 at24c01_check(void);
void IIC_AT24C01_init(void);

void IIC_AT24C01_example(void);

#endif
