wts_flash.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:6k
- /*****************************************************************************
- 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"
- /* Exported Types ------------------------------------------------------ */
- typedef struct {
- U32 Ident;
- U32 Resvd;
- U32 Size;
- U32 NumPrograms;
- } FlashHeader_t;
- typedef struct {
- U8 Bank; /* Bank number */
- U32 Address; /* Block start address */
- U32 Length; /* Length of block */
- } BlockInfo_t;
- typedef struct {
- U8 Block; /* Block number */
- U32 Address; /* flash address */
- U32 Offset; /* offset into readbuffer */
- U32 Size; /* number of bytes */
- } SectionInfo_t;
- #ifndef ST_5105
- /* Exported Constants -------------------------------------------------- */
- /* Temperorily placed here as missing in Device File*/
- #ifndef PIO_4_BASE_ADDRESS
- #define PIO_4_BASE_ADDRESS ST5100_PIO4_BASE_ADDRESS
- #endif
- #ifndef PIO_5_BASE_ADDRESS
- #define PIO_5_BASE_ADDRESS ST5100_PIO5_BASE_ADDRESS
- #endif
- /* Interrupt numbers */
- #ifndef PIO_4_INTERRUPT
- #define PIO_4_INTERRUPT ST5100_PIO4_INTERRUPT
- #endif
- #ifndef PIO_5_INTERRUPT
- #define PIO_5_INTERRUPT ST5100_PIO5_INTERRUPT
- #endif
- #endif
- /* Exported Variables -------------------------------------------------- */
- extern STFLASH_Handle_t FLASHHndl[2];
- extern ST_DeviceName_t FLASHDeviceName[2];
- /* Exported Macros ----------------------------------------------------- */
- #define BANK0 0
- #ifndef ST_5105
- #define BANK1 1
- #endif
- #define FLASH_IDENT 0x12345678
- #define rayf
- #ifdef rayf
- typedef unsigned char UBYTE; /* Unsigned 8 bit quantity */
- typedef signed char BYTE; /* Signed 8 bit quantity */
- typedef unsigned long int ULONG; /* Unsigned 32 bit quantity */
- typedef signed long int LONG; /* Signed 32 bit quantity */
- typedef unsigned short UINT16; /* Unsigned 16 bit quantity */
- typedef unsigned long int UINT32; /* Unsigned 32 bit quantity */
- /* Type defs for filenames and parameters */
- typedef enum romtool_mode {NULL_MODE, ERROR_MODE, ERASE, PROGRAM, VERIFY, READ, DUMP} ROMTOOL_MODE;
- typedef enum romtool_report {NULL_REPORT, ERROR_REPORT, FULL, REDUCED, NONE} ROMTOOL_REPORT;
- typedef enum romtool_board {MiCo, STB3} ROMTOOL_BOARD;
- typedef enum romtool_image {HexCode, BinCode, LNBList,LogoImage,LanguageImage,CHNList,All} ROMTOOL_IMAGE;
- typedef enum romtool_erase {NULL_ERASE,ERASE_ALL,ERALNB,ERALOGO,ERACODE,ERALANGUAGE}ROMTOOL_ERASE;
- extern BOOL report_verbose ; /* reporting level */
- #define MAX_FILENAME_LENGTH 100
- typedef char FILE_STRING[MAX_FILENAME_LENGTH];
- BOOL binFile;
- #endif
- /* Exported Functions -------------------------------------------------- */
- extern ST_ErrorCode_t wts_FLASH_Close( U8 BankNum );
- extern ST_ErrorCode_t wts_FLASH_GetParams( U8 BankNum, STFLASH_Params_t *FLASHParams_p );
- extern ST_ErrorCode_t wts_FLASH_Init( U8 BankNum );
- extern ST_ErrorCode_t wts_FLASH_Open( U8 BankNum );
- extern ST_ErrorCode_t wts_FLASH_Term( BOOL ForceTerminate, U8 BankNum );
- extern ST_ErrorCode_t wts_FLASH_SetupBlockInfo( void );
- extern U32 wts_FLASH_ReadFile( char *Filename );
- extern BOOL wts_EraseFlash( BOOL EraseAll );
- extern BOOL wts_ProgramFlash( void );
- extern BOOL wts_VerifyFlash( void );
- extern BOOL wts_EraseCodeFlash( BOOL EraseCode );
- extern BOOL wts_EraseLNBFlash( BOOL Erase );
- extern BOOL wts_EraseLogoFlash( BOOL Erase );
- extern BOOL wts_EraseLanguageFlash( BOOL Erase );
- extern BOOL wts_ProgramLNBFlash( void );
- extern BOOL wts_ProgramAllFlash( void );
- extern BOOL wts_ProgramLogoFlash( void );
- extern BOOL wts_ProgramLanguageFlash( char *Filename );
- #if 0
- extern BOOL wts_ProgramLanguageFlash( void );
- #endif
- extern BOOL wts_VerifyLNBFlash( void );
- extern BOOL wts_VerifyAllFlash( void );
- extern BOOL wts_VerifyLogoFlash( void );
- extern BOOL wts_VerifyLanguageFlash( void );
- extern BOOL wts_FLASH_InitCommand( void );
- /* 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 EraseCodeFlash( BOOL EraseAll );
- extern BOOL EraseLNBFlash( BOOL Erasel );
- extern BOOL ProgramFlash( void );
- extern BOOL ProgramLNBFlash( void );
- extern BOOL ProgramAllFlash( void );
- extern BOOL VerifyFlash( void );
- extern BOOL VerifyLNBFlash( void );
- extern BOOL VerifyAllFlash( void );
- extern BOOL FLASH_InitCommand( void );
- extern BOOL ReadProgram(char *Filename ,U32 StartAddress ,U32 Length );
- extern BOOL ProgramLanguageFlash( void );
- extern BOOL ProgramLogoFlash( void );
- extern BOOL EraseLanguageFlash( BOOL Erasel );
- extern BOOL EraseLogoFlash( BOOL Erasel );
- extern BOOL VerifyLogoFlash( void );
- extern BOOL VerifyLanguageFlash( void );
- #endif
- /* EOF --------------------------------------------------------------------- */