亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sst25lf080a.txt

?? 對于Flash存儲器的驅動
?? TXT
?? 第 1 頁 / 共 2 頁
字號:
Software Driver

SST25LF080A 2 Mbit(1M x 8) Serial Flash Memory

February 25th, 2004, Rev. 1.0

ABOUT THE SOFTWARE
This application note provides software driver examples for 25LF080A,
Serial Flash. Extensive comments are included in each routine to describe 
the function of each routine.  The interface coding uses polling method 
rather than the SPI protocol to interface with these serial devices.  The
functions are differentiated below in terms of the communication protocols
(uses Mode 0) and specific device operation instructions. This code has been 
designed to compile using the Keil compiler.


ABOUT THE 25LF080A

Companion product datasheets for the 25LF080A should be reviewed in 
conjunction with this application note for a complete understanding 
of the device.


Device Communication Protocol(pinout related) functions:

Functions                    		Function
------------------------------------------------------------------
init					Initializes clock to set up mode 0.
Send_Byte				Sends one byte using SI pin to send and 
					shift out 1-bit per clock rising edge
Get_Byte				Receives one byte using SO pin to receive and shift 
					in 1-bit per clock falling edge
CE_High					Sets Chip Enable pin of the serial flash to high
CE_Low					Clears Chip Enable of the serial flash to low
Hold_Low				Clears Hold pin to make serial flash hold
Unhold					Unholds the serial flash
WP_Low					Clears WP pin to make serial flash write protected
UnWP					Disables write protection pin

Note:  The pin names of the 25LF080A are used in this application note. The associated test code
will not compile unless these pinouts (SCK, SI, SO, SO, CE, WP, Hold) are pre-defined on your
software which should reflect your hardware interfaced. 	 


Device Operation Instruction functions:

Functions                    		Function
------------------------------------------------------------------
Read_Status_Register			Reads the status register of the serial flash
EWSR					Enables the Write Status Register
WRSR					Performs a write to the status register
WREN					Write enables the serial flash
WRDI					Write disables the serial flash
Read_ID					Reads the manufacturer ID and device ID
Read					Reads one byte from the serial flash and returns byte(max of 20 MHz CLK frequency)
Read_Cont				Reads multiple bytes(max of 20 MHz CLK frequency)
HighSpeed_Read				Reads one byte from the serial flash and returns byte(max of 33 MHz CLK frequency)
HighSpeed_Read_Cont			Reads multiple bytes(max of 33 MHz CLK frequency)
Byte_Program				Program one byte to the serial flash
Auto_Add_IncA				Initial Auto Address Increment process
Auto_Add_IncB				Successive Auto_Address_Increment process after AAI initiation
Chip_Erase				Erases entire serial flash
Sector_Erase				Erases one sector (4 KB) of the serial flash
Block_Erase				Erases one block (32 KB) of the serial flash
Wait_Busy				Polls status register until busy bit is low
Wait_Busy_AAI				Polls status register until busy bit is low for AAI programming
WREN_Check				Checks to see if WEL is set
WREN_AAI_Check				Checks to see if WEL and AAI mode is set


                                                                     
"C" LANGUAGE DRIVERS */

/********************************************************************/
/* Copyright Silicon Storage Technology, Inc. (SST), 1994-2004	    */
/* Example "C" language Driver of 25LF080A Serial Flash		    */
/* Conrado Canio, Silicon Storage Technology, Inc.                  */
/*                                                                  */
/* Revision 1.0, February 25th, 2004			  	    */   
/*                                                                  */
/*								    */
/********************************************************************/

#include <stdio.h>
#include <stdlib.h>


/* Function Prototypes */

void init();
void Send_Byte(unsigned char out);
unsigned char Get_Byte();
void CE_High();
void CE_Low();
void Hold_Low();
void Unhold();
void WP_Low();
void UnWP();
unsigned char Read_Status_Register();
void EWSR();
void WRSR(byte);
void WREN();
void WRDI();
unsigned char Read_ID(ID_addr);
unsigned char Read(unsigned long Dst);
void Read_Cont(unsigned long Dst, unsigned long no_bytes);
unsigned char HighSpeed_Read(unsigned long Dst); 
void HighSpeed_Read_Cont(unsigned long Dst, unsigned long no_bytes);
void Byte_Program(unsigned long Dst, unsigned char byte);
void Auto_Add_IncA(unsigned long Dst, unsigned char byte);
void Auto_Add_IncB(unsigned char byte);
void Chip_Erase();
void Sector_Erase(unsigned long Dst);
void Block_Erase(unsigned long Dst);
void Wait_Busy();
void Wait_Busy_AAI();
void WREN_Check();
void WREN_AAI_Check();

void Verify(unsigned char byte, unsigned char cor_byte);


unsigned char idata upper_128[128];	/* global array to store read data */
					/* to upper RAM area from 80H - FFH */

/************************************************************************/
/* PROCEDURE: init							*/
/*									*/
/* This procedure initializes the SCK to low. Must be called prior to 	*/
/* setting up mode 0.							*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Output:								*/
/*		SCK							*/
/************************************************************************/
void init()
{
	SCK = 0;	/* set clock to low initial state */
}

/************************************************************************/
/* PROCEDURE: Send_Byte							*/
/*									*/
/* This procedure outputs a byte shifting out 1-bit per clock rising	*/
/* edge on the the SI pin(LSB 1st).					*/
/*									*/
/* Input:								*/
/*		out							*/
/*									*/
/* Output:								*/
/*		SI							*/
/************************************************************************/
void Send_Byte(unsigned char out)
{
	
	unsigned char i = 0;
	for (i = 0; i < 8; i++)
	{
		
		if ((out & 0x80) == 0x80)	/* check if MSB is high */
			SI = 1;
		else
			SI = 0;			/* if not, set to low */
		SCK = 1;			/* toggle clock high */
		out = (out << 1);		/* shift 1 place for next bit */
		SCK = 0;			/* toggle clock low */
	}


}

/************************************************************************/
/* PROCEDURE: Get_Byte							*/
/*									*/
/* This procedure inputs a byte shifting in 1-bit per clock falling	*/
/* edge on the SO pin(LSB 1st).						*/
/*									*/
/* Input:								*/
/*		SO							*/
/*									*/
/* Output:								*/
/*		None							*/
/************************************************************************/
unsigned char Get_Byte()
{
	unsigned char i = 0, in = 0, temp = 0;
	for (i = 0; i < 8; i++)
	{
		in = (in << 1);		/* shift 1 place to the left or shift in 0 */
		temp = SO;		/* save input */
		SCK = 1;		/* toggle clock high */
	if (temp == 1)			/* check to see if bit is high */
		in = in | 0x01;		/* if high, make bit high */

		SCK = 0;		/* toggle clock low */

	}
	return in;
}

/************************************************************************/
/* PROCEDURE: CE_High							*/
/*									*/
/* This procedure set CE = High.					*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Output:								*/
/*		CE							*/
/*									*/
/************************************************************************/
void CE_High() 
{
	CE = 1;				/* set CE high */
}


/************************************************************************/
/* PROCEDURE: CE_Low							*/
/*									*/
/* This procedure drives the CE of the device to low.  			*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Output:								*/
/*		CE							*/
/*									*/
/************************************************************************/
void CE_Low() 
{	
	CE = 0;				/* clear CE low */
}



/************************************************************************/
/* PROCEDURE: Hold()							*/
/*									*/
/* This procedure clears the Hold pin to low.				*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Output:								*/
/*		Hold							*/
/************************************************************************/
void Hold_Low()
{
	Hold = 0;			/* clear Hold pin */
}

/************************************************************************/
/* PROCEDURE: Unhold()							*/
/*									*/
/* This procedure sets the Hold pin to high.				*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Output:								*/
/*		Hold							*/
/************************************************************************/
void Unhold()
{
	Hold = 1;			/* set Hold pin */
}

/************************************************************************/
/* PROCEDURE: WP()							*/
/*									*/
/* This procedure clears the WP pin to low.				*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Output:								*/
/*		WP							*/
/************************************************************************/
void WP_Low()
{
	WP = 0;				/* clear WP pin */
}

/************************************************************************/
/* PROCEDURE: UnWP()							*/
/*									*/
/* This procedure sets the WP pin to high.				*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Output:								*/
/*		WP							*/
/************************************************************************/
void UnWP()
{
	WP = 1;				/* set WP pin */
}

/************************************************************************/
/* PROCEDURE: Read_Status_Register					*/
/*									*/
/* This procedure read the status register and returns the byte.	*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Returns:								*/
/*		byte							*/
/************************************************************************/
unsigned char Read_Status_Register()
{
	unsigned char byte = 0;
	CE_Low();			/* enable device */
	Send_Byte(0x05);		/* send RDSR command */
	byte = Get_Byte();		/* receive byte */
	CE_High();			/* disable device */
	return byte;
}

/************************************************************************/
/* PROCEDURE: EWSR							*/
/*									*/
/* This procedure Enables Write Status Register.  			*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Returns:								*/
/*		Nothing							*/
/************************************************************************/
void EWSR()
{
	CE_Low();			/* enable device */
	Send_Byte(0x50);		/* enable writing to the status register */
	CE_High();			/* disable device */
}

/************************************************************************/
/* PROCEDURE: WRSR							*/
/*									*/
/* This procedure writes a byte to the Status Register.			*/
/*									*/
/* Input:								*/
/*		byte							*/
/*									*/
/* Returns:								*/
/*		Nothing							*/
/************************************************************************/
void WRSR(byte)
{
	CE_Low();			/* enable device */
	Send_Byte(0x01);		/* select write to status register */
	Send_Byte(byte);		/* data that will change the status of BPx 
						or BPL (only bits 2,3,7 can be written) */
	CE_High();			/* disable the device */
}

/************************************************************************/
/* PROCEDURE: WREN							*/
/*									*/
/* This procedure enables the Write Enable Latch.			*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Returns:								*/
/*		Nothing							*/
/************************************************************************/
void WREN()
{
	CE_Low();			/* enable device */
	Send_Byte(0x06);		/* send WREN command */
	CE_High();			/* disable device */
}

/************************************************************************/
/* PROCEDURE: WRDI							*/
/*									*/
/* This procedure disables the Write Enable Latch.			*/
/*									*/
/* Input:								*/
/*		None							*/
/*									*/
/* Returns:								*/
/*		Nothing							*/
/************************************************************************/
void WRDI()
{
	CE_Low();			/* enable device */
	Send_Byte(0x04);		/* send WRDI command */
	CE_High();			/* disable device */
}


/************************************************************************/
/* PROCEDURE: Read_ID							*/
/*									*/
/* This procedure Reads the manufacturer's ID and device ID.  It will 	*/
/* use 90h or ABh as the command to read the ID (90h in this sample).   */
/* It is up to the user to give the last byte ID_addr to determine      */
/* whether the device outputs manufacturer's ID first, or device ID 	*/
/* first.  Please see the product datasheet for details.  Returns ID in */
/* variable byte.							*/
/*									*/
/* Input:								*/
/*		ID_addr							*/
/*									*/
/* Returns:								*/
/*		byte:	ID1(Manufacture's ID = BFh or Device ID = 80h)	*/
/*									*/
/************************************************************************/
unsigned char Read_ID(ID_addr)
{
	unsigned char byte;
	CE_Low();			/* enable device */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩aⅴ一区二区三区四区五区| 色婷婷综合在线| eeuss国产一区二区三区| 欧美午夜电影网| 国产亚洲一区二区在线观看| 亚洲国产日韩a在线播放性色| 国产一区二区伦理| 欧美狂野另类xxxxoooo| 国产精品久久久久久户外露出| 黄页网站大全一区二区| 欧美午夜一区二区三区免费大片| 国产精品入口麻豆九色| 日韩成人免费看| 在线观看欧美日本| 中文字幕亚洲一区二区va在线| 久久久久久99久久久精品网站| 亚洲丝袜精品丝袜在线| 国产精品原创巨作av| 日韩一区二区在线免费观看| 国产精品人人做人人爽人人添| 国产在线精品一区二区夜色 | 成人性生交大合| 精品日韩一区二区三区| 午夜精品一区二区三区三上悠亚| 色综合欧美在线视频区| 亚洲男人电影天堂| 99久久精品国产观看| 国产精品久久久久久久久图文区 | 国产精品乱人伦一区二区| 久久精品99国产精品日本| 91精品久久久久久久久99蜜臂| 午夜精品福利在线| 91精品在线一区二区| 丝袜美腿亚洲色图| 337p亚洲精品色噜噜狠狠| 日韩中文字幕麻豆| 91超碰这里只有精品国产| 日韩av网站免费在线| 91精品国产欧美一区二区成人| 免费人成在线不卡| 精品国产伦一区二区三区观看方式| 老汉av免费一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 国产剧情一区二区| 国产精品嫩草99a| 91黄视频在线观看| 视频精品一区二区| 久久伊人蜜桃av一区二区| 国产精品自拍av| 依依成人精品视频| 91精品午夜视频| 国产一区在线视频| 综合自拍亚洲综合图不卡区| 欧美午夜精品一区| 美腿丝袜在线亚洲一区| 久久久噜噜噜久噜久久综合| 成人免费看视频| 亚洲午夜视频在线| 欧美成人aa大片| 成人网在线免费视频| 亚洲国产一区二区在线播放| 久久综合九色综合欧美就去吻| 成人av动漫在线| 三级亚洲高清视频| 国产精品久久久99| 7799精品视频| www.亚洲精品| 麻豆精品一区二区综合av| 亚洲欧洲精品一区二区三区不卡| 欧美剧情片在线观看| 国产一区在线不卡| 夜色激情一区二区| 国产亚洲一区二区三区四区| 色8久久精品久久久久久蜜| 麻豆传媒一区二区三区| 国产精品久久久久久久午夜片| 8v天堂国产在线一区二区| 成人av在线网| 久久99精品久久久久久久久久久久| ...中文天堂在线一区| 日韩视频免费观看高清完整版| 粉嫩久久99精品久久久久久夜| 日本欧美肥老太交大片| 亚洲激情中文1区| 国产精品初高中害羞小美女文 | 在线精品视频免费观看| 国产成人在线免费| 蜜桃av噜噜一区二区三区小说| 亚洲精品中文在线影院| 国产欧美日韩综合| 欧美一区二区不卡视频| 在线欧美日韩国产| www.综合网.com| 国产成人在线色| 国产一区久久久| 裸体在线国模精品偷拍| 亚洲成人激情社区| 亚洲一区自拍偷拍| 最近日韩中文字幕| 国产精品久久久久婷婷二区次| 久久婷婷综合激情| 精品久久五月天| 精品久久久久久久久久久久包黑料 | 国产精品免费丝袜| 国产欧美日韩精品在线| 久久影视一区二区| 精品精品欲导航| 日韩亚洲欧美综合| 91麻豆精品国产91久久久久久| 在线观看一区日韩| 在线亚洲一区观看| 欧美日韩一区二区三区在线| 一本大道综合伊人精品热热 | 不卡的av网站| 99视频超级精品| 91免费小视频| 久久青草国产手机看片福利盒子| 欧美日韩精品综合在线| 欧美亚男人的天堂| 欧美日韩一级片在线观看| 欧美少妇一区二区| 777奇米成人网| 日韩免费一区二区三区在线播放| 日韩久久精品一区| 久久久美女毛片| ㊣最新国产の精品bt伙计久久| 国产精品麻豆久久久| 中文字幕视频一区| 亚洲影视资源网| 蜜臀久久久99精品久久久久久| 精品一区二区三区免费毛片爱 | 国产亚洲精品bt天堂精选| 国产亚洲欧美在线| 国产精品短视频| 亚洲国产毛片aaaaa无费看| 五月天中文字幕一区二区| 老司机免费视频一区二区三区| 国产一区二区在线看| 丁香婷婷深情五月亚洲| 色婷婷久久综合| 欧美一区二视频| 欧美激情一区二区三区在线| 亚洲精品视频在线观看免费| 日韩高清一区二区| 国产成人精品三级麻豆| 欧美在线影院一区二区| 日韩午夜在线观看| 国产精品久久精品日日| 日本中文在线一区| 国产成人午夜精品5599| 色欧美片视频在线观看| 欧美成va人片在线观看| 中文字幕一区二区三区在线观看 | 亚洲国产色一区| 国产一区二区看久久| 色8久久精品久久久久久蜜| 欧美一卡2卡3卡4卡| 中文av一区特黄| 免费在线一区观看| 91影院在线免费观看| 精品国精品国产| 亚洲狠狠丁香婷婷综合久久久| 精品在线免费观看| 欧美日韩一二三区| 1区2区3区精品视频| 国产综合久久久久影院| 欧美精选在线播放| 亚洲三级免费观看| 国产精品亚洲午夜一区二区三区| 欧美日韩成人在线| 1区2区3区国产精品| 国产成人免费视频| 日韩免费高清视频| 午夜欧美在线一二页| 色综合视频在线观看| 国产精品视频看| 国产精品996| 日韩欧美成人午夜| 日韩成人免费电影| 欧美猛男gaygay网站| 亚洲精品中文在线| 91在线视频播放地址| 国产日本欧美一区二区| 国产综合色在线| 精品免费99久久| 久久草av在线| 91精品综合久久久久久| 天天综合色天天综合色h| 在线精品视频一区二区| 一区二区在线观看视频在线观看| av在线播放不卡| 国产精品久久久久影院亚瑟| 国产成人精品亚洲日本在线桃色| 精品国产自在久精品国产| 九九热在线视频观看这里只有精品| 欧美人与禽zozo性伦| 日韩电影一二三区| 日韩亚洲欧美高清| 免费看欧美女人艹b| 欧美日韩一级片在线观看|