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

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

?? flashcode.c

?? Title: DK3200_RS232_IAP(upsd32XX) Project Name: DK3200_RS232_IAP Description: In-Application-Prog
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*

FLASHCODE.C:  Flash Memory management routines

--------------------------------------------------------------------------
Copyright (c)2002-2003 ST Microelectronics
This example demo code is provided as is and has no warranty,
implied or otherwise.  You are free to use/modify any of the provided
code at your own risk in your applications with the expressed limitation
of liability (see below) so long as your product using the code contains
at least one uPSD products (device).

LIMITATION OF LIABILITY:   NEITHER STMicroelectronics NOR ITS VENDORS OR 
AGENTS SHALL BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA,
INTERRUPTION OF BUSINESS, NOR FOR INDIRECT, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES OF ANY KIND WHETHER UNDER THIS AGREEMENT OR
OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
--------------------------------------------------------------------------

These functions are provided to help you develop your initial code. 
They are optimized for speed rather that size. As a result, you will 
see very few nested function calls. If speed is not critical, you 
can use function calls for common tasks (like dat polling after 
writing a byte to Flash or EEPROM) The penalty is the extra processor 
time to make the nested calls.

These files have been compiled using a C cross compiler from KEIL 
Software Inc. You may have to implement some syntax changes to be 
compatible with other compilers. The intent of this generated C code 
is to provide you with a core of useful broadbased functions that are 
adaptable to many vendor's compilers and microcontrollers.


Note:

Some of the routines provided may not have been thoroughly tested.  
Please check them in your system. If you find a bug, or a place 
where the code could be improved, PLEASE forward your comments by 
emailing to apps.psd@st.com. Any comments and feedback are 
appreciated. Please tell us what you like and or what you think 
can be improved.


Revision History:

08/21/2002 (Jon Moore)
Uncommented psd834f2.h include. Added #defines to enable flash routines 
used by firmware. Added xdata modifier to flash_write_with_poll pointer 
variables. Changed all variables named 'data' to 'dat' to avoid conflict 
with Keil compiler reserved word.

11/07/2003 (Marian Ilecko)
All headers and library files rearranged and cleaned up.


Be sure to uncomment the associated #define statements inside the 
header file, flashcode.h, to use individual desired functions 
contained in this file, flashcode.c. Your compiler will ignore the functions
in this file unless you do so.
*/

#include "flashcode.h"
#include "upsd3200.h"

typedef unsigned char uchar;

/* Function prototypes */

/*
Group: Main Flash Memory
Coverage: Program, Erase, Reset, Read ID, Read Protection
*/

/*
Module: flash_write_with_poll
Programs a single byte, checks status using polling method.
You'll need to include the header files generated by PSDsoft
Express. Important: if memory paging is used, the correct 
page value must be set in the PSD page register prior to 
calling this function.
*/

#ifdef _F_W_W_P

unsigned char flash_write_with_poll(volatile uchar xdata* addr, uchar dat)
{
	unsigned char done;
	unsigned char error;
	unsigned char err;
	unsigned char poll;

	done = FALSE;
   	err = FALSE;

	//  Note:  the following constants (FLASH_COMMON_XXXX)
	//     are declared type volatile in the header file 
	//	   so they are not optimized away by the compiler

	
	*(FLASH_COMMON_X555) = 0xAA;     // unlock main flash, write 0xAA to addess 0xX555
	*(FLASH_COMMON_XAAA) = 0x55;     // unlock main flash, write 0x55 to addess 0xXAAA
	*(FLASH_COMMON_X555) = 0xA0;     // write 0xA0 command to program

	*(addr) = dat;                  // write byte to flash   
	
	dat = dat & NVM_DATA_POLL;     // get bit DQ7 of original dat   
	
	do                               // now use dat polling method to verify successful write
    {  

   		poll = *(addr);          // Read the location that was just programmed

		error = poll & NVM_ERROR;   // save timeout error bit at DQ5

		poll = poll & NVM_DATA_POLL;  // get DQ7 of poll byte read from flash  

		if (dat == poll)        // compare DQ7 

			done = TRUE;     // dat byte programmed into flash OK,
                                         // indicate successful exit criteria

		else if (error ==  NVM_ERROR )	 // check for timeout error   
			err = TRUE;      // indicate timeout error occurred

    } while((done == FALSE) && (err == FALSE)); 


	if (err == TRUE)                 // make sure timeout error and dat poll didn't 
                                         // occur simultaneously
	{
		poll = *(addr);          // Read location in flash again

		poll = poll & NVM_DATA_POLL;   // get DQ7 of poll byte read from flash  

		if (dat == poll)        // compare DQ7 

			done = TRUE;     // dat byte programmed into flash OK at the same
                                         // time timout error occured, indicate successful 
		                        // exit criteria

		*(FLASH_COMMON_X555) = 0xF0;  // reset the flash array (short reset instruction) 
		        // now delay 3 msec per dat sheet
    }

   	return(done);         // a successful flash write returns 1, timeout error returns 0
}
#endif


#ifdef _F_B_W_W_P

unsigned char flash_boot_write_with_poll(volatile uchar xdata* addr, uchar dat)
{
	unsigned char done;
	unsigned char error;
	unsigned char err;
	unsigned char poll;

	done = FALSE;
   	err = FALSE;

	//  Note:  the following constants (FLASH_BOOT_XXXX)
	//     are declared type volatile in the header file 
	//	   so they are not optimized away by the compiler

	
	*(FLASH_BOOT_X555) = 0xAA;     // unlock main flash, write 0xAA to addess 0xX555
	*(FLASH_BOOT_XAAA) = 0x55;     // unlock main flash, write 0x55 to addess 0xXAAA
	*(FLASH_BOOT_X555) = 0xA0;     // write 0xA0 command to program

	*(addr) = dat;                  // write byte to flash   
	
	dat = dat & NVM_DATA_POLL;     // get bit DQ7 of original dat   
	
	do                               // now use dat polling method to verify successful write
    {  

   		poll = *(addr);          // Read the location that was just programmed

		error = poll & NVM_ERROR;   // save timeout error bit at DQ5

		poll = poll & NVM_DATA_POLL;  // get DQ7 of poll byte read from flash  

		if (dat == poll)        // compare DQ7 

			done = TRUE;     // dat byte programmed into flash OK,
                                         // indicate successful exit criteria

		else if (error ==  NVM_ERROR )	 // check for timeout error   
			err = TRUE;      // indicate timeout error occurred

    } while((done == FALSE) && (err == FALSE)); 


	if (err == TRUE)                 // make sure timeout error and dat poll didn't 
                                         // occur simultaneously
	{
		poll = *(addr);          // Read location in flash again

		poll = poll & NVM_DATA_POLL;   // get DQ7 of poll byte read from flash  

		if (dat == poll)        // compare DQ7 

			done = TRUE;     // dat byte programmed into flash OK at the same
                                         // time timout error occured, indicate successful 
		                        // exit criteria

		*(FLASH_BOOT_X555) = 0xF0;  // reset the flash array (short reset instruction) 
		        // now delay 3 msec per dat sheet
    }

   	return(done);         // a successful flash write returns 1, timeout error returns 0
}


#endif



/*
Module: flash_write_with_toggle
Programs a single byte, checks status using toggle method.
You'll need to include the header files generated by PSDsoft
Express. Important: if memory paging is used, the correct page 
value must be set in the PSD page register prior to calling this 
function.
*/

#ifdef _F_W_W_T

unsigned char flash_write_with_toggle(addr,dat)	
volatile unsigned char *addr;
unsigned char dat;

	{
	unsigned char done;
	unsigned char error;
	unsigned char err;
	volatile unsigned char toggle_A;
	volatile unsigned char toggle_B;

	done = FALSE;
   	err = FALSE;

	//  Note:  the following constants (FLASH_BOOT_XXXX)
	//     are declared type volatile in the header file 
	//	   so they are not optimized away by the compiler

	*(FLASH_BOOT_X555) = 0xAA;		// unlock main flash, write 0xAA to addess 0xX555
	*(FLASH_BOOT_XAAA) = 0x55;		// unlock main flash, write 0x55 to addess 0xXAAA
	*(FLASH_BOOT_X555) = 0xA0;		// write 0xA0 command to program

	*(addr) = dat;		// write byte to flash   

		// now use toggling method to verify successful write

	toggle_A = *(addr);			// Read the location that was just programmed

	toggle_A = toggle_A & NVM_DATA_TOGGLE;	// mask toggle bit at DQ6
   		  								
	do
		{  
   		toggle_B = *(addr);		// Again read the location that was just programmed

		error = toggle_B & NVM_ERROR;	// save timeout error flag at DQ5

		toggle_B = toggle_B & NVM_DATA_TOGGLE;	// mask toggle bit at DQ6
   		  								
		if (toggle_A == toggle_B)	// compare toggle bit DQ6

			done = TRUE;		// bit did not toggle, dat byte programmed into 
						// flash OK, indicate successful exit criteria
		else
			{
	 		 if (error ==  NVM_ERROR )	// check for timeout error   
				err = TRUE; 	// indicate timeout error occurred

			toggle_A = toggle_B;  	// save most recent sample of toggle bit 
						// to compare with next sample
			}

		} while((done == FALSE) && (err == FALSE)); 


	if (err == TRUE)			// make sure timeout error and dat toggle didn't 
						// occur simultaneously
		{
		toggle_B = *(addr);		// Read location in flash again

		toggle_B = toggle_B & NVM_DATA_TOGGLE;	// mask toggle bit at DQ6

		if (toggle_A == toggle_B)		// compare toggle bit DQ6

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩日精品视频一区| 乱一区二区av| 欧美大片在线观看| 日本二三区不卡| 国内精品久久久久影院薰衣草| 中文字幕亚洲一区二区av在线| 91麻豆精品国产91久久久资源速度 | 韩国成人在线视频| 一区二区三区中文在线观看| 久久午夜羞羞影院免费观看| 在线观看日产精品| 99在线热播精品免费| 精品一二三四在线| 视频一区二区中文字幕| 亚洲人123区| 国产日韩综合av| 日韩一区二区三区免费观看| 在线观看不卡一区| 99久久精品国产精品久久| 国产盗摄一区二区| 精品亚洲免费视频| 蜜桃一区二区三区在线| 丝袜脚交一区二区| 亚洲午夜日本在线观看| 亚洲黄色录像片| **网站欧美大片在线观看| 国产丝袜美腿一区二区三区| 日韩精品一区二区三区在线| 欧美图片一区二区三区| 91国偷自产一区二区开放时间| 99视频精品在线| 豆国产96在线|亚洲| 国产精品一区二区三区网站| 精品一区二区免费视频| 亚洲午夜激情av| 亚洲欧美日韩一区二区三区在线观看| 日韩欧美123| 成人午夜视频福利| 免费黄网站欧美| 亚洲成av人片| 亚洲一区二区三区中文字幕| 久久久精品免费免费| 欧美一区二区大片| 欧美精品丝袜中出| 精品视频在线免费看| 91日韩在线专区| 成a人片亚洲日本久久| 狠狠色狠狠色综合系列| 久久精品国产99国产| 天天射综合影视| 亚洲一区电影777| 亚洲国产精品久久久久婷婷884| 亚洲国产精品ⅴa在线观看| 精品日韩一区二区三区免费视频| 日韩一区二区电影| 欧美一区二区三区色| 日韩区在线观看| 欧美一区二区免费视频| 69av一区二区三区| 日韩欧美亚洲国产另类| 日韩一区二区三区视频在线| 91精品国产综合久久香蕉麻豆 | 日韩一区二区视频| 日韩你懂的在线观看| 精品成a人在线观看| 精品不卡在线视频| 日本一区二区三区久久久久久久久不 | 欧美久久一二区| 日韩一区二区在线看片| 日韩手机在线导航| 精品国产乱码久久久久久夜甘婷婷| 日韩免费视频线观看| www国产精品av| 国产婷婷色一区二区三区在线| 国产女人水真多18毛片18精品视频 | 一区二区三区欧美| 亚洲最快最全在线视频| 亚洲日本va午夜在线电影| 亚洲成人av在线电影| 蜜桃视频在线观看一区二区| 久久99国内精品| 丁香桃色午夜亚洲一区二区三区| 99v久久综合狠狠综合久久| 在线亚洲+欧美+日本专区| 777欧美精品| 精品理论电影在线观看| 中文字幕不卡三区| 亚洲丝袜自拍清纯另类| 亚洲成av人片一区二区三区| 国内欧美视频一区二区| 91在线精品一区二区| 欧美精品久久一区二区三区| 26uuu欧美日本| 亚洲视频在线观看一区| 日韩成人一区二区三区在线观看| 国产一区二区导航在线播放| 91亚洲大成网污www| 在线一区二区视频| 欧美一区二区三区免费大片| 亚洲天天做日日做天天谢日日欢 | 中文字幕av一区 二区| 亚洲最新视频在线观看| 精品午夜一区二区三区在线观看| 成人国产精品免费观看视频| 欧美日韩国产一区二区三区地区| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲人成伊人成综合网小说| 久久精品免费看| 色婷婷综合久久久中文一区二区| 日韩欧美不卡一区| 亚洲黄色性网站| 国产激情一区二区三区桃花岛亚洲| 色婷婷av一区二区三区之一色屋| 日韩一二三区不卡| 亚洲一区二区影院| 国产一区日韩二区欧美三区| 欧美一区二区网站| 亚洲免费观看高清完整版在线观看熊| 久久99国产精品久久99| 欧美中文字幕亚洲一区二区va在线| 久久伊人中文字幕| 婷婷亚洲久悠悠色悠在线播放| 成人黄色a**站在线观看| 精品国产一区二区三区av性色 | 日韩中文欧美在线| 91麻豆免费观看| 欧美高清在线一区二区| 日韩电影免费在线看| 在线精品亚洲一区二区不卡| 国产精品色一区二区三区| 韩国中文字幕2020精品| 91精品国产色综合久久ai换脸| 国产欧美日本一区二区三区| 丝袜美腿高跟呻吟高潮一区| 欧美三级在线视频| 一区二区三区在线播| 国产成人精品影视| 日韩欧美高清在线| 色天使久久综合网天天| 国产欧美一区二区在线观看| 看电视剧不卡顿的网站| 欧美猛男超大videosgay| 亚洲精品中文在线影院| 99久久久精品免费观看国产蜜| 国产亚洲精久久久久久| 久久99精品久久只有精品| 欧美一区二区三区四区久久| 图片区小说区区亚洲影院| 欧美日韩高清一区二区| 亚洲成av人片www| 91麻豆精品国产91久久久使用方法| 一区二区三区中文字幕电影| 91成人国产精品| 午夜精品福利视频网站| 欧美伦理影视网| 免费av网站大全久久| 欧美一级黄色片| 极品美女销魂一区二区三区| 精品噜噜噜噜久久久久久久久试看| 日韩成人伦理电影在线观看| 欧美一区国产二区| 久久成人免费日本黄色| 久久久久青草大香线综合精品| 国产成人综合亚洲网站| 精品国产91洋老外米糕| 婷婷开心久久网| 91精品免费观看| 国产制服丝袜一区| 国产精品欧美一级免费| 91同城在线观看| 亚洲自拍偷拍综合| 制服丝袜亚洲色图| 国内一区二区视频| 国产精品入口麻豆原神| 日本韩国视频一区二区| 午夜欧美电影在线观看| 欧美日韩亚洲综合一区二区三区| 免费不卡在线视频| 国产精品网友自拍| 欧美色手机在线观看| 美日韩一区二区| 国产视频视频一区| 91看片淫黄大片一级在线观看| 亚洲国产综合91精品麻豆| 欧美一区二区三区精品| 狠狠色伊人亚洲综合成人| 国产精品网站在线| 欧美色综合网站| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美在线观看一区| 日日嗨av一区二区三区四区| 国产欧美日韩卡一| 欧美日韩国产影片| 成人一区二区视频| 亚洲成a人片在线不卡一二三区| 欧美变态tickle挠乳网站| www.亚洲精品| 丝袜诱惑制服诱惑色一区在线观看 | 成人黄色av电影| 一区二区在线免费|