nand_lpc.h

来自「讲述LPC2468在无操作系统条件下使用YAFFS文件系统是如何实现的以及完整的」· C头文件 代码 · 共 42 行

H
42
字号
/*****************************************************************************
 *   nand.h:  definitions for nandflash
 *
 *   Copyright(C) 2007, uCdragon
 *   All rights reserved.
 *
 *   History
 *   2007.03.16  lqm@ucdragon.net
 *
******************************************************************************/
#ifndef _FLASH_H_
#define _FLASH_H_
#include "stdint.h"
#include "LPC24xx.h"

#define	SIZE_16M	0x01000000
#define	SIZE_32M	0x02000000
#define	SIZE_64M	0x04000000
#define	SIZE_128M	0x08000000

#define NAND_SECTOR_SHIFT    9 
#define NAND_SECTOR_LEN      (1 << NAND_SECTOR_SHIFT)
#define NAND_SECTOR_MASK     (~(NAND_SECTOR_LEN -1))//32 sector per block
#define NAND_BLOCK_SHIFT     5
#define NAND_BLOCK_MASK      (~31)//32 sector per block

	#define	NandFlash_DATA  0x81000000
	#define	NandFlash_ALE   0x81400000
	#define	NandFlash_CLE   0x81200000
//	#define	NFChipEn()     (IOCLR0 = (1<<11))
//	#define	NFChipDs()     (IOSET0 = (1<<11))
//	#define	NFIsBusy()     (!(IOPIN0 & (1<<10)))
	#define	NFChipEn()     (FIO0CLR = (1<<11))
	#define	NFChipDs()     
	#define	NFIsBusy()     (!(FIO0PIN & (1<<10)))


uint32_t NFEraseBlock( uint32_t addr );
void NFReadPage( uint32_t addr , uint8_t* buf );
uint32_t NFWritePage( uint32_t addr , uint8_t* buf );
int NandInit( void );
#endif

⌨️ 快捷键说明

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