flash.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:2k
- /*****************************************************************************
- File Name : tt_flash.h
- Description : FLASH header
-
- Copyright (C) 2004 STMicroelectronics
- *****************************************************************************/
- /* Define to prevent recursive inclusion */
- #ifndef __TT_FLASH_H
- #define __TT_FLASH_H
- /* Includes ------------------------------------------------------------ */
- #include "stflash.h"
- #include "gendef.h"
- /* Exported Types ------------------------------------------------------ */
- typedef struct {
- U32 Ident;
- U32 Resvd;
- U32 Size;
- U32 NumPrograms;
- } FlashHeader_t;
- /* Exported Variables -------------------------------------------------- */
- extern STFLASH_Handle_t FLASHHndl[2];
- extern ST_DeviceName_t FLASHDeviceName[2];
- /* Exported Macros ----------------------------------------------------- */
- #define BANK0 0
- /*#define BANK1 1*/
- #define FLASH_IDENT 0x12345678
- /* Exported Functions -------------------------------------------------- */
- extern ST_ErrorCode_t FLASH_Close( U8 BankNum );
- extern ST_ErrorCode_t FLASH_GetParams( U8 BankNum, STFLASH_Params_t *FLASHParams_p );
- extern ST_ErrorCode_t FLASH_Init( U8 BankNum );
- extern ST_ErrorCode_t FLASH_Open( U8 BankNum );
- extern ST_ErrorCode_t FLASH_Term( BOOL ForceTerminate, U8 BankNum );
- extern ST_ErrorCode_t FLASH_SetupBlockInfo( void );
- extern U32 FLASH_ReadFile( char *Filename );
- extern BOOL EraseFlash( BOOL EraseAll );
- extern BOOL ProgramFlash( void );
- extern BOOL VerifyFlash( void );
- extern BOOL FLASH_InitCommand( void );
- RetValue KB_FLASHInit(void);
- RetValue KB_FlashWrite(UINT32 secID,UINT32 Offset,UINT8 *Buffer,UINT32 NumberToWrite);
- RetValue KB_FlashRead( UINT32 secID,UINT32 Offset,UINT8 *Buffer,UINT32 NumberToRead);
- RetValue KB_FlashErase(UINT32 secID);
- UINT8 *KB_FlashGetSectorAddr(UINT32 secID);
- #endif
- /* EOF --------------------------------------------------------------------- */