⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spansion29lv320d_2x16.h

📁 EP9315的wince下载程序。download.exe
💻 H
字号:
//**********************************************************************
//                                                                      
// Filename: Spansion_1x16.h
//                                                                      
// Description: Flashing program for Spansion Flash. 
//
// 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.
//
// Use of this source code is subject to the terms of the Cirrus end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to 
// use this source code. For a copy of the EULA, please see the 
// EULA.RTF on your install media.
//
// Copyright(c) Cirrus Logic Corporation 2005, All Rights Reserved                       
//                                                                      
//**********************************************************************
#ifndef _H_SPANSION29LV32D_2X16
#define _H_SPANSION29LV32D_2X16


//*****************************************************************************
//
// Flash Erase Block Information declareation 
// Only for Boot block
//
//*****************************************************************************
typedef struct EraseBlockInfo {
    unsigned long               blocks;
    unsigned long               block_size;
} EraseBlockInfo_t;

//****************************************************************************
// 16-bit bus command set
//****************************************************************************
#define AMD_SETUP_ADDR1                         (0x555)
#define AMD_SETUP_ADDR2                         (0x2AA)
#define AMD_VENDORID_ADDR                       (0)
#define AMD_DEVICEID_ADDR1                      (1)
#define AMD_DEVICEID_ADDR2                      (0x0e)
#define AMD_DEVICEID_ADDR3                      (0x0f)
#define AMD_QUERY_ADDR                          (0x55)

#define AMD_SETUP_CODE1                         (0xAA)
#define AMD_SETUP_CODE2                         (0x55)
#define AMD_SETUP_ERASE                         (0x80)

#define AMD_READ_ID                             (0x90)
#define AMD_READ_QUERY                          (0x98)
#define AMD_WP_STATE                            (0x90)
#define AMD_RESET                               (0xF0)
#define AMD_PROGRAM                             (0xA0)
#define AMD_BLOCK_ERASE                         (0x30)

#define AMD_SECTOR_ERASE_TIMER                  (0x08)

#define FLASH_ERR_OK              0x00  // No error - operation complete
#define FLASH_ERR_INVALID         0x01  // Invalid FLASH address
#define FLASH_ERR_ERASE           0x02  // Error trying to erase
#define FLASH_ERR_LOCK            0x03  // Error trying to lock/unlock
#define FLASH_ERR_PROGRAM         0x04  // Error trying to program
#define FLASH_ERR_PROTOCOL        0x05  // Generic error
#define FLASH_ERR_PROTECT         0x06  // Device/region is write-protected
#define FLASH_ERR_NOT_INIT        0x07  // FLASH info not yet initialized
#define FLASH_ERR_HWR             0x08  // Hardware (configuration?) problem
#define FLASH_ERR_ERASE_SUSPEND   0x09  // Device is in erase suspend mode
#define FLASH_ERR_PROGRAM_SUSPEND 0x0a  // Device is in in program suspend mode
#define FLASH_ERR_DRV_VERIFY      0x0b  // Driver failed to verify data
#define FLASH_ERR_DRV_TIMEOUT     0x0c  // Driver timed out waiting for device
#define FLASH_ERR_DRV_WRONG_PART  0x0d  // Driver does not support device
#define FLASH_ERR_LOW_VOLTAGE     0x0e  // Not enough juice to complete job


void AmdFlashSpansion29LV320D_2x16(void);
BOOL    StartEraseSpansion29LV320D_2x16(DWORD dwStartAddr, DWORD dwLength);
void    ContinueEraseSpansion29LV320D_2x16 (void);
BOOL    FinishEraseSpansion29LV320D_2x16 (void);
BOOL    WriteSpansion29LV320D_2x16(DWORD dwDest, DWORD dwSource, DWORD dwLength);

#endif // _H_SPANSION_1X16

⌨️ 快捷键说明

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