#ifndef __FLASHSETUP_H__
#define __FLASHSETUP_H__
/*--------------------------------------------------------------------------------------
*  @file     FlashSetup.h
*  @author   ZhangJing
*  @version  base on stm32f0x   
*  @date     2015.09.11
*  @brief    芯片内部flash驱动
---------------------------------------------------------------------------------------*/
#include "stdint.h"

/*给应用程序分配400Kflash空间 0x08000000~0x08063FFF*/ //0~199页用于存储数据
/*给设置参数数据分配2Kflash空间 0x08064000~0x080647FF*/
#define FLASH_PAGE_SIZE    				((uint16_t)0x800)//定义页的大小，对于大容量器件页的大小为0X800字节
#define PARAMSET_DATA_START_ADDR	((uint32_t)0x08064000)//0x08064000  200页
#define PARAMSET_DATA_END_ADDR		((uint32_t)0x080647FF)//0x080647FF

#define HISTORY_DATA_START_ADDR		((uint32_t)0x08064800)//0x08064800  201页
#define HISTORY_DATA_END_ADDR			((uint32_t)0x08064FFF)//0x08064FFF
#define HISTORY_DATA_SIZE					((uint16_t)0x1000)	//给历史数据分配4096字节大小	

#define HISTORY_RECORDQTY_ADDR		((uint32_t)0x08069800)//历史数据存储数量 211页
#define HISTORY_RECORDQTY_SIZE		6											//历史数据存储数量占2个字节,历史数据存储指针占2个字节

#define HISTORY31256_DATA_InputTotalDose		((uint32_t)0x0806A000)//历史数据存储数量 212页

#define PROGRAM_INFO_ADDR	          ((uint32_t)0x0806A800)//0x0806A800 程序参数信息213页 add by wulianwei
#define PROGRAM_INFO_SIZE   600



void FlashWriteOperate( uint8_t *writeDataBuf,uint16_t writeLen,uint32_t writeAddress);
void FlashReadOperate( uint8_t *readDataBuf,uint16_t readLen,uint32_t readAddress);
#endif
