Files
HBshuiwuConcentrator/APP/Flash.h
2025-12-15 16:07:49 +08:00

43 lines
869 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*——————————————————————————
* 文 件 名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