欢迎来到天天文库
浏览记录
ID:35478343
大小:75.92 KB
页数:18页
时间:2019-03-25
《stm32_flash_eeprom_断电保护_数值存储程序》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、/************eeprom.***********************************************************************************************@fileEEPROM_Emulation/inc/eeprom.h*@authorMCDApplicationTeam*(AversionV3.1.0*@date07/27/2009*@briefThisfilecontainsallthefunctionsprototypesfortheEEPROM*emulationfirmwarelibr
2、ary.*******************************************************************************@copy**THEPRESENTFIRMWAREWHICHISFORGUIDANCEONLYAIMSATPROVIDINGCUSTOMERS*WITHCODINGINFORMATIONREGARDINGTHEIRPRODUCTSINORDERFORTHEMTOSAVE*TIME.ASARESULT;STMICROELECTRONICSSHALLNOTBEHELDLIABLEFORANY*DIRECT,IND
3、IRECTORCONSEQUENTIALDAMAGESWITHRESPECTTOANYCLAIMSARISING*FROMTHECONTENTOFSUCHFIRMWAREAND/ORTHEUSEMADEBYCUSTOMERSOFTHE*CODINGINFORMATIONCONTAINEDHEREININCONNECTIONWITHTHEIRPRODUCTS.**©COPYRIGHT2009STMicroelectronics/*Definetopreventrecursiveinclusion#ifndef_EEP
4、ROM_H#defineEEPROMH/*Includes#includeMstm32fl0x.hH/*Exportedconstants*//*DefinetheSTM32F10XxxFlashpagesizedependingontheusedSTM32device*/#ifdefined(STM32F10X_LD)11defined(STM32F10X_MD)#definePAGE_SIZE(uintl6_t)0x400/*Pagesize=1KByte*/#elifdefined(STM32F10X_HD)11defined(STM32F10X_CL)#defin
5、ePAGE_SIZE(uintl6_t)0x800/*Pagesize=2KByte*/#endif((uint32_t)0x08010000)/*EEPROMemulationstart/*EEPROMstartaddressinFlash*/#defineEEPROM_START_ADDRESSaddress:after64KByteofusedFlashmemory*/#definePAGEO_BASE_ADDRESS#definePAGEO_END_ADDRESS((uint32_t)(EEPROM_START_ADDRESS+0x000))((uint32_t)
6、(EEPROM_START_ADDRESS+(PAGE_SIZE-1)))#definePAGE1_BASE_ADDRESS#definePAGE1_END_ADDRESS1)))((uint32_t)(EEPROM_START_ADDRESS+PAGE_SIZE))((uint32_t)(EEPROM_START_ADDRESS+(2*PAGE_SIZE・/*Pages0and1baseandendaddresses*//*UsedFlashpagesforEEPROMemulation*/#definePAGEO#definePAGEl((uintl6_t)0x000
7、0)((uintl6_t)0x0001)/*Novalidpagedefine*/#defineNO_VALID_PAGE((uintl6_t)0x00AB)/*Pagestatusdefinitions*/#defineERASED#defineRECEIVE_DATA*/#defineVALID_PAGE((uintl6_t)0xFFFF)((uintl6_t)0xEEEE)((uintl6_t)0x0000)/*PAGEisempty*//*PAGEismarkedtoreceivedata/*PAGEcontainin
此文档下载收益归作者所有