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

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

?? upsd_flash.c

?? 適合初學者學習的UPSD的點陣LCD漢字顯示
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* upsd_flash.c

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) The penalty is the extra processor 
time to make the nested calls.

These files have been compiled using a C cross compiler from COSMIC 
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.


NOTES:

1.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.

2.The Software is provided "AS IS."
  LIMITATION OF LIABILITY:    NEITHER WSI 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.

You are free to use/modify any of the provided code at your own risk
in your applications with the expressed limitation of liability above.
*/

#pragma	large

#include "upsd3200.h"			// special function register declarations for UPSD
#include "upsd_flash.h"          // include the definition of your system memory map


/* Functions
   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. */

unsigned char flash_write_with_poll(volatile unsigned char xdata* addr, unsigned char 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 
    //   if( poll == NVM_DATA_POLL )
			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
}
/*unsigned char flash_boot_write_with_poll(volatile unsigned char xdata* addr, unsigned char 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
}
*/


/* 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. */
/*
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

			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
	}*/


/* Module: flash_erase_bulk
   Erases the entire main Flash memory (all sectors).
   You'll need to include the header files generated by PSDsoft
   Express. Important: The address passed to this function should 
   be independent of memory paging or else the PSD page 
   register value should be set to the correct page prior to calling this 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩日日夜夜| 欧美性受极品xxxx喷水| 国产成人亚洲综合a∨婷婷图片| 日韩极品在线观看| 日韩精品一二区| 国产一区二区影院| 国产**成人网毛片九色| www.色综合.com| 欧美色偷偷大香| www.在线成人| 91在线视频观看| 欧美日韩大陆在线| 久久人人爽人人爽| 亚洲国产精品欧美一二99| 另类欧美日韩国产在线| 波多野结衣中文字幕一区二区三区 | 欧美一二三区在线| 久久嫩草精品久久久精品 | 极品尤物av久久免费看| 不卡大黄网站免费看| 欧美在线观看视频一区二区三区| 欧美日本在线播放| 国产精品久久久久精k8| 日韩精品亚洲一区| 色婷婷狠狠综合| 精品久久久久久综合日本欧美| 国产精品国产三级国产三级人妇 | 午夜激情久久久| 不卡区在线中文字幕| 精品国产免费视频| 丝袜a∨在线一区二区三区不卡| 国产一区二区三区电影在线观看| 在线国产亚洲欧美| 日本一区二区三区四区在线视频| 日韩不卡一区二区| 欧美精品乱码久久久久久按摩| 国产精品青草综合久久久久99| 麻豆高清免费国产一区| 欧美一级搡bbbb搡bbbb| 天天色 色综合| 欧美一区二区三区人| 日本在线观看不卡视频| 日韩女同互慰一区二区| 亚洲www啪成人一区二区麻豆| 色婷婷精品久久二区二区蜜臀av| 日本一区二区久久| 国产精品一区免费视频| 欧美成人乱码一区二区三区| 日韩 欧美一区二区三区| 日韩一级二级三级精品视频| 蜜臀av一级做a爰片久久| 精品国产乱码久久久久久蜜臀| 美女脱光内衣内裤视频久久影院| 欧美电视剧免费观看| 国产精品一品视频| 亚洲卡通欧美制服中文| 欧美午夜精品理论片a级按摩| 亚洲大尺度视频在线观看| 91精品国产免费久久综合| 国产一区二区三区国产| 亚洲久草在线视频| ...xxx性欧美| 日韩视频在线观看一区二区| 国产精品一区二区果冻传媒| 悠悠色在线精品| 久久久久久久一区| 91麻豆精品国产91| av不卡在线观看| 亚洲欧美日韩国产手机在线| 一本大道久久a久久综合婷婷| 日韩—二三区免费观看av| ...中文天堂在线一区| 国产免费观看久久| 欧美成人精品3d动漫h| 欧美日韩在线综合| 成人做爰69片免费看网站| 精品亚洲aⅴ乱码一区二区三区| 日日骚欧美日韩| 国产日韩欧美麻豆| 欧美精品日韩一区| 豆国产96在线|亚洲| 日本一区二区高清| 2024国产精品| 色婷婷狠狠综合| 国产欧美精品国产国产专区| 欧美三级蜜桃2在线观看| 卡一卡二国产精品| 五月天欧美精品| 亚洲最快最全在线视频| 国产精品美女www爽爽爽| 久久精品免费在线观看| 91精品国产91综合久久蜜臀| 在线观看欧美黄色| 91免费看片在线观看| 99视频超级精品| 91小视频在线免费看| 成人h精品动漫一区二区三区| 日韩精品久久久久久| 免费的成人av| 美女脱光内衣内裤视频久久网站| 亚洲成av人片一区二区| 亚洲 欧美综合在线网络| 亚洲小说欧美激情另类| 午夜视频一区二区| 天堂va蜜桃一区二区三区 | 欧美日韩一级二级| 99久久婷婷国产综合精品| 国产91富婆露脸刺激对白| 国产成人综合视频| 国产成人精品免费网站| 风间由美中文字幕在线看视频国产欧美| 久久99蜜桃精品| 久久国产麻豆精品| 国产91在线观看| 国产一区二区在线视频| 国产乱人伦偷精品视频免下载| 国产精品香蕉一区二区三区| 成人久久视频在线观看| 91国产免费看| 4438x亚洲最大成人网| 精品乱码亚洲一区二区不卡| 中文字幕一区二区三中文字幕| 亚洲色图清纯唯美| 亚洲超丰满肉感bbw| 久久99精品国产麻豆不卡| 波多野结衣亚洲| 欧美自拍偷拍午夜视频| 在线免费不卡电影| 日本一区二区在线不卡| 樱花影视一区二区| 欧美一区二区二区| 精品国产制服丝袜高跟| 欧美激情综合在线| 亚洲一区精品在线| 国产在线麻豆精品观看| 成人免费va视频| 欧美午夜电影在线播放| 欧美成人vps| 亚洲欧洲国产日本综合| 婷婷综合五月天| 国产毛片精品国产一区二区三区| 91蝌蚪国产九色| 久久综合99re88久久爱| 国产精品人成在线观看免费| 亚洲成人av一区二区三区| 国产精品一二二区| 在线播放中文字幕一区| 亚洲美女视频一区| 国产毛片精品一区| 欧美区在线观看| 亚洲免费伊人电影| 黄色日韩网站视频| 国产不卡视频在线播放| 欧美成人精品二区三区99精品| 日韩毛片在线免费观看| 国产精品99久久久| 色乱码一区二区三区88 | 亚洲靠逼com| 一区二区三区中文字幕电影| 精品一区二区免费视频| 在线免费观看一区| 欧美美女喷水视频| 亚洲福利一二三区| 成人免费视频视频在线观看免费| 欧美精品久久久久久久多人混战| 国产精品乱码妇女bbbb| 美女性感视频久久| 欧美中文字幕亚洲一区二区va在线| 亚洲欧洲三级电影| 成人黄色一级视频| 久久午夜免费电影| 久久精品国产免费| 色狠狠av一区二区三区| 亚洲精品视频在线观看免费| 成人高清av在线| 国产日产亚洲精品系列| 狠狠色丁香婷综合久久| 欧美日韩国产片| 3atv一区二区三区| 亚洲成av人片一区二区梦乃| 欧美喷潮久久久xxxxx| 色综合中文字幕国产 | 精品综合久久久久久8888| 丝袜a∨在线一区二区三区不卡| 亚洲图片自拍偷拍| 亚洲成人黄色小说| 国产精品18久久久久久久久久久久| 福利一区二区在线观看| 一区二区三区四区中文字幕| 69久久99精品久久久久婷婷| 国产欧美日韩视频在线观看| 337p粉嫩大胆噜噜噜噜噜91av| 91精品婷婷国产综合久久竹菊| 精品国产一区二区三区av性色| 日本v片在线高清不卡在线观看| 欧美日韩精品欧美日韩精品一| 亚洲欧美电影一区二区| 欧美亚洲国产怡红院影院| 一区二区三区不卡视频| 欧美视频中文一区二区三区在线观看|