ethdown.h

来自「WinCE 3.0 BSP, 包含Inter SA1110, Intel_815」· C头文件 代码 · 共 66 行

H
66
字号
/*

  Copyright(c) 1998,1999 SIC/Hitachi,Ltd.

	Module Name:

		ethdown.h

	Revision History:

		26th April 1999		Released

*/
#ifndef ETHDOWN_H
#define ETHDOWN_H

// In order to parse the BIN file as it is handed to the EthDown() routine, I need a state machine because
//  the record headers can be broken across packets.  The state of the state machine indicates the value
//  that the routine is trying to extract from the packet.
typedef enum {
	BIN_PHYSADDR,	// Record header physical address field
	BIN_PHYSLEN,	// Record header physical length field
	BIN_CHECKSUM,	// Record header checksum field
	BIN_DATA		// Record data
} BINFileParseStates;



// These are the commands that can be sent to the EraseFlash() and WriteFlash() routines.  The EthDown()
//  call back will invoke WriteFlash() for each DWORD that is written to the memory.
typedef enum {
	FLASH_START_ERASE,	// Begin the erase process.
	FLASH_CONT_ERASE	// Continue erasing flash pages from the current position.  If all flash pages have
						//  been erased, just return.
} FlashCommands;



// These are the possible states that a flash block can be in.  The state of a flash block is stored in
//  the global EraseStatus array and can be changed by either FlashErase() or FlashWrite().
typedef enum {
	BLOCK_DIRTY,	// The block contains unknown data and has not been erased
	BLOCK_PENDING,	// An erase command has been issued for the block but it has not yet completed
	BLOCK_ERASED,	// The block has been erased and is ready for programming
	BLOCK_FLASHED	// The block has been programmed and is ready for use
} EraseStatusType;



extern DWORD fWriteToFlash;
extern DWORD dwPhysStart;	// image physical starting address
extern DWORD dwPhysLen;	// image physical length



UINT16 EthDown( char *pszFileName, TFtpdCallBackOps Operation, BYTE *pbData, UINT16 *cwLength, char **ppszErrorMsg );
UINT16 FlashWrite( DWORD dwPhysStart, DWORD dwPhysLen, char **ppszErrorMsg );
UINT16 IsFlash( DWORD dwPhysStart, DWORD dwPhysLen );
UINT16 FlashErase(FlashCommands FlashCommand, DWORD dwPhysStart, DWORD dwPhysLen, char **ppszErrorMsg );
UINT16 FlashError( volatile DWORD *pdwBSR, char **ppszErrorMsg );
UINT16 FlashPageWrite( volatile DWORD *pdwFlash, DWORD *pdwFlashCache, DWORD dwDWORDsLeft, char **ppszErrorMsg );
UINT16 FlashClose( DWORD dwPhysStart, DWORD dwPhysLen, char **ppszErrorMsg );
void UploadDeviceInfo( DWORD dwBank );

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?