河北水利局项目

This commit is contained in:
2025-12-15 16:07:49 +08:00
commit f11a7c2b95
1146 changed files with 452892 additions and 0 deletions

43
APP/Flash.h Normal file
View File

@@ -0,0 +1,43 @@
/*——————————————————————————
* 文 件 名Flash.h
* 作 者:于涛
* 日 期2014-01-15
* 文件说明内部FLASH头文件
*——————————————————————————*/
#ifndef _FLASH_H
#define _FLASH_H
#include "Basedefine.h"
//#include "Sys.h"
#ifdef STM32F10X_HD
#define PAGE_SIZE (0x800)
#else
#define PAGE_SIZE (0x400)
#endif
#define FLASH_ID_IDDR 0x1FFFF7E8
#define FLASH_KEY_ADDRESS 0x08003800
typedef enum
{
FLH_SUCCESS = 0, //返回成功
FLH_ERASE_ERR,
FLH_WRITE_ERR,
FLH_WADDR_ERR,
FLH_RADDR_ERR,
FLH_NOSPACE_ERR,
FLH_NOVAILD_ERR,
FLH_NOFIELD_ERR,
}eFlashRet;
u8 STM32_FlashPageErase(u32 pageAddr);
u8 STM32_FlashWrite(u32 programAddr, u8* pBuffer, u16 size);
u8 STM32_FlashWriteZero(u32 programAddr, u16 size);
bool read_unique_id(u8 * id);
#endif