亚洲欧美第一页_禁久久精品乱码_粉嫩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| 午夜欧美一区二区三区在线播放| 国产调教视频一区| 欧美不卡激情三级在线观看| 日韩欧美另类在线| 欧美日韩电影在线播放| 91蝌蚪porny成人天涯| 国产资源在线一区| 国产白丝精品91爽爽久久| 久久国产福利国产秒拍| 丝袜美腿高跟呻吟高潮一区| 亚洲欧洲日韩综合一区二区| xf在线a精品一区二区视频网站| 欧美精品久久天天躁| 91美女精品福利| 欧美日韩一区二区三区四区五区| 欧美日韩免费电影| 精品日韩一区二区三区| 国产亚洲欧美一级| 亚洲另类一区二区| 亚洲欧美在线视频观看| 亚洲免费观看在线观看| 国产精品国产三级国产有无不卡 | 国产成人午夜电影网| 日本不卡的三区四区五区| 亚洲h精品动漫在线观看| 亚洲综合清纯丝袜自拍| 亚洲日本在线看| 天天综合网 天天综合色| 狠狠色丁香婷婷综合久久片| 成人性生交大片免费看中文| 成人一区在线观看| 欧美调教femdomvk| 9191精品国产综合久久久久久 | 久久精品综合网| 亚洲色图制服丝袜| 日韩av电影免费观看高清完整版在线观看| 一区二区免费看| 一二三区精品视频| 精品一区二区三区在线播放| 国内成人精品2018免费看| 99精品一区二区| 91丨porny丨首页| 日韩欧美亚洲另类制服综合在线| 欧美国产日韩a欧美在线观看| 国产欧美日本一区视频| 欧美国产日本视频| 日韩在线一二三区| 波多野结衣亚洲一区| 97se亚洲国产综合自在线| 欧美日韩免费高清一区色橹橹 | 国产亚洲人成网站| 日韩国产精品久久| av电影在线观看不卡| 欧美成人免费网站| 一区二区三区中文在线观看| 国内精品自线一区二区三区视频| 91国内精品野花午夜精品| 欧美日韩视频专区在线播放| 欧美国产日韩一二三区| 开心九九激情九九欧美日韩精美视频电影| www.欧美亚洲| 久久精品亚洲国产奇米99| 日韩中文字幕91| 一本色道亚洲精品aⅴ| 国产午夜三级一区二区三| 秋霞电影网一区二区| 日本黄色一区二区| 国产精品无人区| 亚洲国产综合人成综合网站| 蜜桃视频在线观看一区| 成人午夜激情在线| 26uuuu精品一区二区| 奇米精品一区二区三区在线观看| 欧美性受xxxx| 亚洲精品免费在线观看| av不卡免费电影| 欧美国产成人精品| 国产一区二区视频在线播放| 欧美一区二区观看视频| 亚洲在线免费播放| 91在线小视频| 国产精品二三区| 国产精品88av| 久久精品人人做| 国产原创一区二区| 精品久久久久久最新网址| 美女高潮久久久| 欧美一区二区精美| 日韩成人午夜电影| 这里是久久伊人| 日韩精品三区四区| 欧美日韩mp4| 五月综合激情日本mⅴ| 欧美日韩免费一区二区三区 | 精品一区二区三区免费| 日韩一二三区视频| 国产精品国产成人国产三级| 国产a视频精品免费观看| 国产欧美一二三区| 国产盗摄视频一区二区三区| 久久精品夜夜夜夜久久| 成人免费的视频| 一区免费观看视频| 色老综合老女人久久久| 成人美女视频在线观看| 国产精品视频麻豆| 91社区在线播放| 亚洲综合免费观看高清完整版 | 欧美日韩亚洲综合一区| 五月激情丁香一区二区三区| 欧美丰满嫩嫩电影| 久久99在线观看| 中文字幕免费一区| 99精品视频一区二区| 亚洲理论在线观看| 欧美美女喷水视频| 毛片av一区二区| 欧美韩日一区二区三区四区| 色综合久久综合网97色综合| 午夜精品福利一区二区三区蜜桃| 欧美一区二区在线免费观看| 经典三级在线一区| 中文字幕日韩欧美一区二区三区| 欧美在线高清视频| 亚洲婷婷综合久久一本伊一区| 欧洲另类一二三四区| 日本美女一区二区| 国产日产欧美一区二区三区| 色一情一伦一子一伦一区| 日韩精品电影一区亚洲| 久久综合一区二区| 在线观看国产91| 国产一区二区导航在线播放| 亚洲男人都懂的| 日韩女优视频免费观看| 成人av电影免费观看| 中文字幕国产一区| 色av一区二区| 狠狠久久亚洲欧美| 亚洲一区二区三区自拍| 精品福利一区二区三区| 国产一区二区三区四区五区入口| 亚洲日本成人在线观看| 欧美一区二区久久| 94-欧美-setu| 久久99精品久久久久婷婷| 亚洲黄色在线视频| 精品国产123| 欧美日韩一级二级三级| 国产91丝袜在线18| 视频一区二区三区在线| 国产精品欧美精品| 欧美一二区视频| 日本韩国一区二区三区| 国产精品18久久久| 午夜在线成人av| 国产精品久久久久久妇女6080| 欧美一区二区三区不卡| 色综合天天狠狠| 国产乱码字幕精品高清av | 欧美日韩综合在线| 成人一区在线看| 极品尤物av久久免费看| 亚洲二区在线视频| 国产精品国产三级国产| 精品国产伦一区二区三区观看体验 | 日韩av网站免费在线| 亚洲欧美另类久久久精品| 久久久久久久久久久黄色| 成人午夜私人影院| 精品亚洲成a人在线观看| 亚洲成va人在线观看| 专区另类欧美日韩| 国产女主播一区| 久久免费国产精品| 欧美一区二区三区人| 欧美午夜理伦三级在线观看| 97久久精品人人做人人爽| 国产福利一区二区三区视频在线| 美女视频一区二区| 日韩av不卡在线观看| 天天爽夜夜爽夜夜爽精品视频 | 99精品视频在线免费观看| 国产成人精品免费看| 久久99久久久久| 亚洲777理论| 午夜成人在线视频| 五月激情综合网| 三级亚洲高清视频| 亚洲成a人v欧美综合天堂| 亚洲国产日韩a在线播放性色|