www.pudn.com > flashfat16.rar > FLASH.H


#include "44b.h" 
#include "def.h" 
 
 
#define Nand_RB	(0x01) 
#define Nand_CE	(0x02) 
#define Nand_CLE	(0x04) 
#define Nand_ALE	(0x08)	 
#define Nand_IO	   (*(volatile unsigned char *)0x02000000)	//bank1               
 
#define FC_CMD		{rPDATC |= Nand_CLE;	rPDATC &= ~(Nand_ALE|Nand_CE);} 
#define FC_ADDR		{rPDATC |= Nand_ALE;	rPDATC&=~(Nand_CLE|Nand_CE);} 
#define FC_DATA        {rPDATC &= ~(Nand_ALE|Nand_CLE|Nand_CE); } 
#define FC_INACTIVE	{rPDATA |= Nand_CE;	rPDATC&=~(Nand_ALE|Nand_CLE);}        
#define WAITRB		while(!(rPDATC & Nand_RB))  //wait tWB and check R/B pin.    
#define KM29U128_ID    0xec73 
#define K9F5608U0A_ID  0xec75 
#define WRITEVERIFY  (1)  //Verifing is enable when writing flash 
 
void Flash_Reset(void);//flash reset 
unsigned int Check_Flash_Id(void); 
unsigned char Erase_Cluster(unsigned int cluster); 
void ReadPage(unsigned int block,unsigned int page,unsigned char *pPage); 
int  WritePage(unsigned int block,unsigned int page,U8 *pPage); 
void Flash_Tools(void);