📄 nandflash.h
字号:
#ifndef _FLASH_H_
#define _FLASH_H_
#define NandFlash_DEBUG 1
//#define MAX_BLOCKS_NUM 2048 // k9f5608 32MU8 2048
#define MAX_BLOCKS_NUM 1024 // k9f2808 16MU8 1024
#define K9F2808 (0xec73)
#define K9F3208 (0xece3)
#define KM29U128_ID (0xec75) //ID 28f08 0xec73 56f08 0xec75
// assign SMC_nRD = ! ( (!nGCS2) && ( ADDR[22]) && ( ADDR[23]) ) ;
// assign SMC_nWE = ! ( (!nGCS2) && ( ADDR[22]) && ( ADDR[23]) ) ;
//NandFlash.R/B <-----> P018 输入
//NandFlash.CE <-----> P019 输出
//NandFlash.CLE <-----> ADDR1
//NandFlash.ALE <-----> ADDR2
//#define SEL_SMART_MEDIA_CARD
#define NandFlash_DATA 0x820000a0
#define NandFlash_ALE 0x820000a4
#define NandFlash_CLE 0x820000a2
#define NandFlash_Chip_Enable ( IO0CLR = IO0CLR|(1<<19) )
#define NandFlash_Chip_Disable ( IO0SET = IO0SET|(1<<19) )
#define READCMD0 0
#define QUERYCMD 0x70
#define NandFlash_WR_CLE ( *(volatile U8 *)NandFlash_CLE )
#define NandFlash_WR_ALE ( *(volatile U8 *)NandFlash_ALE )
#define NandFlash_WR_DATA ( *(volatile U8 *)NandFlash_DATA )
#define ReadyBusy ( 1<<18 )
#define NandFlash_ReadyBusy (IO0PIN & ReadyBusy) //wait tWB and check R/B pin.
#define NF_WRITE_PAGE_VERIFY (0) //Verifing is enable when writing flash
/*KM29U128函数声明*/
extern void Flash_Reset( void );//flash reset
extern unsigned short Check_Flash_Id( void );
extern unsigned char nfwritepage( unsigned short pageWord , unsigned char* buf );
extern void nfreadpage( unsigned short pageWord , unsigned char* buf );
extern unsigned char nferaseblock( unsigned int cluster );
extern unsigned char NandFlash_Self_Test( void ) ;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -