typedef unsigned char BYTE; // BYTE is 8-bit in length
//typedef unsigned int WORD; // WORD is 16-bit in length
typedef unsigned short WORD; // WORD is 16-bit in length, ARM
//typedef unsigned long int Uint32; // Uint32 is 32-bit in length
typedef unsigned int Uint32; // Uint32 is 32-bit in length, ARM
//Uint32 system_base = 0x4000000; // 4GByte System Memory Address.
#define system_base 0x4000000
// This sample code uses 0x4000000 as the system_base address in ARM system.
// The user should modify this address accordingly.
//#define sysAddress(offset) ((volatile WORD *)(system_base + offset))
#define sysAddress(offset) ((volatile WORD *)(system_base + (((WORD)offset)<<1))) //For ARM CPU
#define MAX_TIMEOUT 0x07FFFFFF // A ceiling constant used by Check_Toggle_
// Ready() and Check_Data_Polling().
// The user should modify this constant accordingly.
int Check_SST_39VF640XB(void);
void CFI_Query(WORD*);
void SecID_Query(WORD*, WORD*);
int Erase_One_Sector(Uint32);
int Erase_One_Block (Uint32);
int Erase_Entire_Chip(void);
int Program_One_Word (WORD*, Uint32);
int Program_One_Sector (WORD*, Uint32);
int Program_One_Block (WORD *Src, Uint32 Dst);
int SecID_Lock_Status(void);
int User_SecID_Word_Program (WORD*, WORD*, int);
void User_SecID_Lock_Out (void);
void Erase_Suspend (void);
void Erase_Resume (void);
int Check_Toggle_Ready (Uint32);
int Check_Data_Polling (Uint32, WORD);