亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲国产婷婷综合在线精品| 精品一区二区日韩| 久久成人av少妇免费| 国产成人在线影院| 欧洲亚洲国产日韩| 久久夜色精品国产噜噜av| 亚洲一区日韩精品中文字幕| 国产成人免费视频一区| 日韩一级黄色大片| 亚洲高清视频的网址| 成人av资源在线观看| 精品国产一区二区三区不卡| 性做久久久久久| 在线免费精品视频| 国产精品免费网站在线观看| 久久99久久99| 欧美一区二区三区在线视频| 亚洲一区二区三区美女| 91美女福利视频| 1000部国产精品成人观看| 韩国女主播成人在线观看| 欧美精品丝袜中出| 午夜视频久久久久久| 欧美色欧美亚洲另类二区| 亚洲欧美另类在线| 日本久久电影网| 亚洲人一二三区| 日本韩国精品一区二区在线观看| 99re在线视频这里只有精品| 国产日韩精品一区| 成人丝袜高跟foot| 中文字幕一区二区三区不卡在线 | 亚洲va中文字幕| 色婷婷av一区二区三区gif | 91精品办公室少妇高潮对白| 国产精品激情偷乱一区二区∴| 国产成人精品三级| 日韩电影在线免费| 欧美精品亚洲一区二区在线播放| 视频在线观看一区二区三区| 欧美精选一区二区| 久久精品久久综合| 久久这里只有精品视频网| 国产精品资源网| 国产精品区一区二区三| 91免费看`日韩一区二区| 一区二区三区四区亚洲| 欧美日韩久久一区| 久久激情综合网| 国产拍欧美日韩视频二区| 欧美成人高清电影在线| 久久不见久久见免费视频7| 精品国产乱码久久久久久蜜臀| 国产综合色精品一区二区三区| 日本一区二区三区四区| 色婷婷久久99综合精品jk白丝 | 亚洲国产精品成人综合色在线婷婷 | 国产精品欧美久久久久无广告| 国产 日韩 欧美大片| 亚洲欧美成aⅴ人在线观看| 欧美揉bbbbb揉bbbbb| 久草精品在线观看| 中文字幕一区二区三区在线播放 | 日韩中文字幕91| 精品久久久久久综合日本欧美| 成人综合激情网| 亚洲一区二区三区四区不卡| 久久新电视剧免费观看| 色丁香久综合在线久综合在线观看| 蓝色福利精品导航| 亚洲精品国产第一综合99久久 | 激情久久五月天| 国产精品国产馆在线真实露脸| 欧美日韩激情在线| 成人精品在线视频观看| 日韩电影在线观看网站| 日本一区二区不卡视频| 91精品国产综合久久国产大片| 国产成人啪午夜精品网站男同| 亚洲第一福利一区| 国产精品网站在线播放| 日韩一区二区三区视频在线| 91亚洲永久精品| 国产在线播放一区| 香蕉av福利精品导航| 国产精品乱码人人做人人爱| 日韩精品影音先锋| 欧美日韩高清一区二区| 91小视频免费观看| 国产精品亚洲综合一区在线观看| 午夜激情久久久| 亚洲视频一区在线观看| 欧美国产精品专区| 欧美成人在线直播| 欧美夫妻性生活| 91毛片在线观看| 99久免费精品视频在线观看| 久久成人羞羞网站| 蜜桃一区二区三区在线| 亚洲丶国产丶欧美一区二区三区| 欧美国产一区二区在线观看| 久久色中文字幕| 6080yy午夜一二三区久久| 91国产视频在线观看| 91农村精品一区二区在线| 大尺度一区二区| 高清不卡在线观看av| 经典三级视频一区| 国产精品一区二区久激情瑜伽 | 欧美国产欧美综合| 国产亚洲短视频| 精品国精品自拍自在线| 精品国产麻豆免费人成网站| 欧美一区二区在线播放| 欧美一区二区三区小说| 欧美精品在线一区二区三区| 欧美日韩国产一二三| 777亚洲妇女| 91精品国产全国免费观看| 6080国产精品一区二区| 制服丝袜亚洲网站| 日韩欧美久久一区| 精品精品国产高清a毛片牛牛| 久久综合久久久久88| 久久影院午夜片一区| 国产亚洲欧美中文| 国产精品美女久久久久久久网站| 国产精品欧美久久久久无广告 | 国产精品美女视频| 亚洲欧美精品午睡沙发| 亚洲综合久久久| 日韩精品五月天| 九九视频精品免费| 高清在线观看日韩| 91精品1区2区| 91精品国产综合久久久久| 精品国产一区二区三区av性色| 久久久久久免费毛片精品| 国产精品乱码一区二三区小蝌蚪| 国产精品黄色在线观看| 婷婷综合另类小说色区| 国产自产高清不卡| 99视频精品在线| 777奇米四色成人影色区| 精品国产123| 亚洲欧美日韩国产成人精品影院| 亚洲成av人片www| 韩国v欧美v亚洲v日本v| 色av综合在线| 欧美精品一区二区高清在线观看| 国产精品视频观看| 亚洲h动漫在线| 国产精品亚洲视频| 91福利视频在线| 亚洲精品一区在线观看| 日韩美女视频一区二区| 日韩高清在线观看| 成人av电影免费观看| 日韩欧美三级在线| 亚洲图片自拍偷拍| 成人夜色视频网站在线观看| 在线播放视频一区| 国产精品入口麻豆九色| 青青草97国产精品免费观看无弹窗版| 成人午夜在线免费| 日韩欧美国产电影| 一个色在线综合| 成人在线一区二区三区| 欧美一区二区三区四区视频| 韩国理伦片一区二区三区在线播放 | 亚洲综合激情网| 国产精品一区二区在线看| 欧美日本韩国一区二区三区视频| 亚洲国产成人在线| 蜜臀精品一区二区三区在线观看| 99re亚洲国产精品| 亚洲国产精品黑人久久久| 美女高潮久久久| 欧美理论电影在线| 亚洲欧美日韩中文播放| 懂色av中文字幕一区二区三区| 欧美一区二区三区男人的天堂| 一区二区三区在线视频免费观看 | 中文字幕一区二区三区四区 | 国产精品成人免费| 国产精品亚洲综合一区在线观看| 欧美一级在线视频| 亚洲成人动漫av| 欧美唯美清纯偷拍| 一区二区三区欧美激情| 91在线视频免费91| 中文字幕高清一区| 风间由美一区二区av101| 亚洲精品一区二区三区四区高清| 美女网站在线免费欧美精品| 欧美日本韩国一区| 日本一不卡视频| 欧美一级片免费看| 美女视频黄 久久| 欧美精品v国产精品v日韩精品 |