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

📄 flash.h

📁 基于dsp的flash驱动程序
💻 H
字号:
#ifndef _flash
#define _flash

/*********************************************************************************
*********************************************************************************
*																				*
* 函数定义:unsigned int _flash_erase(unsigned int addr, unsigned int type)		   						*
* 功    能:Flash扇区/块/整片擦除操作											*
*																				*
* 入口参数:A	  ---- 地址addr													*
*		       扇区擦除:Amsb~A11,每个扇区2K   								*
*		       块擦除  :Amsb~A15,每个块32K									*
*		       整片擦除:5555H													*
*		       Amsb:	A16,Flash用SST39VF200时								*
*		       			A17,Flash用SST39VF400时(缺省)						*
*		      			A18,Flash用SST39VF800时								*
*		       Flash定位在程序储存空间0x4000000~401FFFFH                       *
*											   ~403FFFFH(缺省)   				*
*											   ~407FFFFH		                *
*		       地址addr为从0开始的偏移地址,而非Flash的绝对地址					*
*          	   (SP+n) ---- 操作类型type,如果是.far_mode模式则n为2,否则n为1	*
*		       扇区擦除:30H													*
*		       块擦除:  50H													*
*		       整片擦除:10H													*
* 出口参数:A	  ---- 擦除标志													*
*		       未擦干净:00H													*
*		       已擦干净:01H													*
* 资源使用:B,AR0																*
*																				*
*********************************************************************************/
unsigned int flash_erase(unsigned int addr, unsigned int type);

/*********************************************************************************
*										*
* 函数定义:unsigned int _flash_writes(unsigned long addr, unsigned int data)		   		*
* 功    能:将数据data写入addr所指定的Flash单元					*
*										*
* 入口参数:A	  ---- 地址addr,Amsb~A0					*
*		       Amsb:	A16,Flash用SST39VF200时				*
*		       		A17,Flash用SST39VF400时(缺省)			*
*		      		A18,Flash用SST39VF800时				*
*		       Flash定位在程序储存空间80000H~9FFFFH/BFFFFH(缺省)/FFFFFH	*
*		       地址addr为从0开始的偏移地址,而非Flash的绝对地址		*
*          (SP+n) ---- 数据data,如果是.far_mode模式则n为2,否则n为1		*
* 出口参数:A	  ---- 写入标志							*
*		       未写入:00H						*
*		       已写入:01H						*
* 资源使用:B									*
*										*
*********************************************************************************/
unsigned int flash_writes(unsigned long addr, unsigned int data);

/*********************************************************************************
*										*
* 函数定义:unsigned int _flash_writem(unsigned long addr,unsigned int ptr, unsigned int length)   		*
* 功    能:将ptr所指向的数据缓冲区中的length个数据写入addr所指定的Flash单元	*
*										*
* 入口参数:A	  ---- 地址addr,Amsb~A0					*
*		       Amsb:	A16,Flash用SST39VF200时				*
*		       		A17,Flash用SST39VF400时(缺省)			*
*		      		A18,Flash用SST39VF800时				*
*		       Flash定位在程序储存空间80000H~9FFFFH/BFFFFH(缺省)/FFFFFH	*
*		       地址addr为从0开始的偏移地址,而非Flash的绝对地址		*
*          (SP+n) ---- 数据缓冲区起始地址ptr,如果是.far_mode模式则n为2,否则n为1	*
*          (SP+m) ---- 数据长度lrngth,如果是.far_mode模式则m为3,否则m为2	*
* 出口参数:A	  ---- 写入标志							*
*		       未写入:00H						*
*		       已写入:01H						*
* 资源使用:B,AR0								*
*										*
*********************************************************************************/
unsigned int flash_writem(unsigned long addr, unsigned int ptr, unsigned int length);

/*********************************************************************************
*										*
* 函数定义:unsigned int flash_reads(unsigned long addr)			   		*
* 功    能:从addr指定的Flash单元中读出一个数据					*
*										*
* 入口参数:A	  ---- 地址addr,Amsb~A0					*
*		       Amsb:	A16,Flash用SST39VF200时				*
*		       		A17,Flash用SST39VF400时(缺省)			*
*		      		A18,Flash用SST39VF800时				*
*		       Flash定位在程序储存空间80000H~9FFFFH/BFFFFH(缺省)/FFFFFH	*
*		       地址addr为从0开始的偏移地址,而非Flash的绝对地址		*
* 出口参数:A	  ---- 读出数据							*
* 资源使用:A									*
*										*
*********************************************************************************/
unsigned int flash_reads(unsigned long addr);

/*********************************************************************************
*										*
* 函数定义:void flash_readm(unsigned long addr, unsigned int ptr, unsigned int length)   		*
* 功    能:从addr指定的Flash单元中读出length数据到ptr所指向的数据缓冲区中		*
*										*
* 入口参数:A	  ---- 地址addr,Amsb~A0					*
*		       Amsb:	A16,Flash用SST39VF200时				*
*		       		A17,Flash用SST39VF400时(缺省)			*
*		      		A18,Flash用SST39VF800时				*
*		       Flash定位在程序储存空间80000H~9FFFFH/BFFFFH(缺省)/FFFFFH	*
*		       地址addr为从0开始的偏移地址,而非Flash的绝对地址		*
*          (SP+n) ---- 数据缓冲区起始地址ptr,如果是.far_mode模式则n为2,否则n为1	*
*          (SP+m) ---- 数据长度length,如果是.far_mode模式则m为3,否则m为2	*
* 出口参数:A	  ---- 读出数据							*
* 资源使用:B,AR0								*
*										*
*********************************************************************************/
void flash_readm(unsigned long addr, unsigned int ptr, unsigned int length);

#endif

⌨️ 快捷键说明

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