📄 flash.h
字号:
/**************************************************/
/* Flash ROM Header : flash.h */
/* for Flash ROM Download Program */
/**************************************************/
#ifndef _SST_FLASH_H
#define _SST_FLASH_H
#define EVEN 0
#define ODD 1
#define FALSE 0
#ifndef TRUE
#define TRUE 1
#endif
/**************************************/
/* DOWN LOAD BUFFER AREA */
/**************************************/
//#define EEPROM_BufferArea 0x1200000
//#define EEPROM_WriteArea 0x0000000
#define ByteLane 1
#define ROW_SIZE 128
/********************************/
/* DEFINE BANK 0 DATA BUS WIDTH */
/********************************/
#define B0SIZE_BYTE 0x1
#define B0SIZE_SHORT 0x2
#define B0SIZE_WORD 0x3
#define _B0SIZE B0SIZE_SHORT // Select Bank0 bus width
#if _B0SIZE == B0SIZE_BYTE
typedef unsigned char pB0SIZE;
#elif _B0SIZE == B0SIZE_SHORT
typedef unsigned short pB0SIZE;
#elif _B0SIZE == B0SIZE_WORD
typedef unsigned long pB0SIZE;
#endif
/**************************************/
/* SST EEPROM 29EE512,29EE010,29EE020 */
/**************************************/
#if _B0SIZE == B0SIZE_BYTE
#define SST_29EE512 0x5D
#define SST_29EE010 0x07
#define SST_29EE020 0x10
#define SST_ID 0xBF
#define SST_ALIGN 0
#define ROW_SIZE_29EE 128
#elif _B0SIZE == B0SIZE_SHORT
#define SST_29EE512 0x5D5D
#define SST_29EE010 0x0707
#define SST_29EE020 0x1010
#define SST_ID 0xBFBF
#define SST_ALIGN 1
#define ROW_SIZE_29EE 256
#elif _B0SIZE == B0SIZE_WORD
#define SST_29EE512 0x5D5D5D5D
#define SST_29EE010 0x07070707
#define SST_29EE020 0x10101010
#define SST_ID 0xBFBFBFBF
#define SST_ALIGN 2
#define ROW_SIZE_29EE 512
#endif
/**************************************/
/* SST EEPROM 29EE512,29EE010,29EE020 */
/**************************************/
#define ROW_SIZE_29SF 256
#define SST29SF_SIZE 512000
#if _B0SIZE == B0SIZE_BYTE
#define AUTO_PG_ERASE1 0x20
#define AUTO_PG_ERASE2 0xD0
#define AUTO_CHIP_ERASE 0x30
#define AUTO_PGRM 0x10
#define RESET 0xFF
#define READ_ID 0x90
#define SST_28SF040 0x04
#elif _B0SIZE == B0SIZE_SHORT
#define AUTO_PG_ERASE1 0x2020
#define AUTO_PG_ERASE2 0xD0D0
#define AUTO_CHIP_ERASE 0x3030
#define AUTO_PGRM 0x1010
#define RESET 0xFFFF
#define READ_ID 0x9090
#define SST_28SF040 0x0404
#elif _B0SIZE == B0SIZE_WORD
#define AUTO_PG_ERASE1 0x20202020
#define AUTO_PG_ERASE2 0xD0D0D0D0
#define AUTO_CHIP_ERASE 0x30303030
#define AUTO_PGRM 0x10101010
#define RESET 0xFFFFFFFF
#define READ_ID 0x90909090
#define SST_28SF040 0x04040404
#endif
/*****************************************/
/* Functions for 29EE512,29EE010,29EE020 */
/*****************************************/
extern void Program_SST29EE(void */*Src*/,void */*Dst*/,int/*ReceiveData*/);
extern void SST29EE_DisableProtection(void);
extern void SST29EE_EraseEEPROM(void);
extern void SST29EE_WriteEEPROM(pB0SIZE */*Src*/, pB0SIZE */*Dst*/);
extern void SST29EE_EnableProtection(void);
/*************************/
/* Functions for 29SF040 */
/*************************/
extern void Program_SST29SF(void */*Src*/,void */*Dst*/,int/*ReceiveData*/);
extern void SST29SF_DisableProtection(void);
extern int SST29SF_EraseEEPROM(pB0SIZE */*dest*/);
extern int SST29SF_WriteEEPROM(pB0SIZE */*Src*/,pB0SIZE */*Dst*/,int/*RcvData*/);
extern void SST29SF_EnableProtection(void);
extern int Check_SST_28SF040(void);
/*****************************************/
/* SST EEPROM COMMON FUNCTIONS */
/*****************************************/
extern void Check_Toggle_Ready(pB0SIZE */*Dst*/);
extern void Check_Data_Polling(pB0SIZE */*Dst*/, pB0SIZE /*TrueData*/);
extern void Delay_Milli_Second(int /*count*/);
#endif /* _FLASH_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -