⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flash.h

📁 MPC8241:本程序是freescale的824*系列的BSP源程序
💻 H
字号:
/************************************************************************
ccm_flash.h
Copyright 1999 by cdma 		all right reserved
Author:            chenhong
Date:              1999.9.13
Description:       the head file of flash driver for CHM module 
Note:              
*************************************************************************/

#ifndef _FLASH_H
#define _FLASH_H



/**************************<< Common Defination >>***********************/

#define FLASH_UNIT_BYTE 		128*1024		/*128*2*1024    	 28F640J5 */ 
/*#define FLASH_UNIT_WORD 		128*2*1024/4  	 28F640J5 */
#define FLASH_UNIT_UBYTE		128*1024
#define FLASH_MASK 				0xfffe0000		/*0xfffc0000    	 mask 128k*2 byte block */
#define FLASH_DRV_SIZE 				64*128*1024		/*64*128*2*1024  	 28F640J5 */ 
/*#define BUFFER_WORD_NUM 		16	*/			/* the word number in 
												   write buffer mode*//*16 ULONG*/
#define BUFFER_UBYTE_NUM 		16				/* the word number in 
												   write buffer mode*//*16 USHORT*/
#ifndef NULL 
#define NULL 					0
#endif

#ifndef ULONG
#define ULONG unsigned long
#endif

#ifndef USHORT
#define USHORT unsigned short
#endif 

#ifndef UCHAR
#define UCHAR unsigned char
#endif 


					
#define FLASH_BASE	/*0xFF000000*/0x70000000
#define FLASH_OK	0
#define FLASH_FAIL	-1

/*The maximum time for wait SR.7 to 1(Ready)*/
#define FLASH_ERASE_CHIP_LOOP		0X4000000
#define FLASH_ERASE_SECTOR_LOOP		0X4000000	
#define FLASH_WRITE_LOOP			0X4000000


/****************<< function prototypes >>******************************/
extern void FlashInit(void);
extern int FlashEraseSector(ULONG Offset);

extern int	FlashWrite(ULONG Offset, ULONG DataLen, UCHAR *BufAddr);
extern int	FlashRead(ULONG Offset, ULONG DataLen, UCHAR *BufAddr);

#endif

⌨️ 快捷键说明

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