ethdown.h

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

H
68
字号
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-2000 Microsoft Corporation.  All rights reserved.

Module Name:  

  ethdown.h

Abstract:  

  This contains the ethdown.c specific data structure declarations.
  
Functions:

  
Notes:


Revision History:

--*/
#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 dwPhysStart;   // image physical starting address
extern DWORD dwPhysLen; // image physical length



UINT16 EthDown( char *pszFileName, TFtpdCallBackOps Operation, BYTE *pbData, UINT16 *cwLength, char **ppszErrorMsg );
#endif

⌨️ 快捷键说明

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