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

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

?? dk3200_ee_demo.c

?? uPSD3200系列MCU的EEPROM的仿真實例
?? C
字號:
/*------------------------------------------------------------------------------
DK3200_EE_DEMO.c

Version:
9/04/2004 - Ver 1.0 - Updated to check on reset if EEPROM Emulation was 
                      previously initialized.
8/24/2004 - Ver 0.2 - Modified for Checks and errors for 128 Byte Record size.
06/2002   - Ver 0.1 - Initial Version

Description:
Simple EEPROM Emulation Demo code for uPSD32xx.  This demo loops forever 
writing an incrementing value to the emulated EEPROM contents.  Upon reset, the
flash is checked to see if it was previously set up for emulating an EEPROM.  If
it was not, the flash is initialized and formated for EEPROM emulation.  If
it was, the current value is read from the record in the emulated EEPROM and is
displayed on the LCD.  This value plus 1 becomes the starting value that is
incrementally written to the emulated EEPROM.

Note: 
The first time this demo code is executed, it will initialize the flash for 
EEPROM emulation.  While the demo is running, take note of the value that was 
just written to the emulated EEPROM.  Press the reset switch or cycle the power 
and then observe that the demo detects that the flash was previously initialized
for EEPROM emulation.  It will then retrieve and display the value that was last
written to the EEPROM.

********************************************************************************
Important Notes:
(1) EEPROM record size is set in eeprom.h.
(2) This demo requires XDATA to be initialized to 0 for the EEPROM Emulation 
driver to work properly.  This is currently handled in the startup file.
(3) This demo doesn't handle error processing.  In most cases if an error
occurs, the demo stops.
********************************************************************************

Copyright (c) 2004 STMicroelectronics

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

#include "upsd3200_hardware.h"	   // environment hardware specific defines
#include "upsd3200.h"			   // special function register declarations for UPSD
#include "upsd3200_lcd.h"		   // prototype declarations and defines for uPSD IP drivers
#include "upsd3200_timer.h"
#include "eeprom.h"

xdata PSD_REGS PSD_reg _at_ PSD_REG_ADDR;  // Define PSD registers at address "csiop" space

   	  
void main (void) 
{
	unsigned char EEPROM_write_value;	  // Counter - value to write to record
	unsigned char status;

    unsigned char flash_previously_init;  // Flag to indicate if the flash was
                                          //  previously (before reset) initialized 
										  //  for EEPROM emulation.

	BYTE xdata buf[1];          //Buffer that holds data to write  
    BYTE xdata tmpbuf[1];       //Buffer which holds data read back from the flash
   	
//	WDKEY = 0x55;               // Turn off the Watch Dog Timer	(already done in startup code)

	PSD_reg.VM |= 0x80;         // enable peripheral I/O mode for LCD display

    timer0_init();   		 	// initialize timer0 interrupt 
	lcd_init();	  				// initialize LCD. 8 bits, 2 lines, 5x7 font,
     				  			// no blink, cursor off, clear 

	printfLCD("EEPROM Emulation\n");		//display on LCD
	printfLCD("demo on uPSD3200\n");
	delay_2sec();

    flash_previously_init = TRUE;          // Flag set to previously initialized.
  
   	status = Eeprom_Init();     // Determines if the flash was previously 
                                //  initialized for EEPROM emulation.  Also does
								//  some recovery if contents corrupted due to 
                                //  power failure.
    if (status != 0)            // Flash was not previously initialized.
    {  
        lcd_clear();
        printfLCD("Flash not init\n");
		printfLCD("for EEPROM Emul.\n");
		delay_2sec();

        lcd_clear();
        printfLCD("Formatting flash\n");
        printfLCD("for EEPROM Emul.\n");
  	    delay_2sec();

        flash_previously_init = FALSE;    // Flag to indicate the flash was not
		                                  //  previously initialized for EEPROM
                                          //  emulation.

   	    status = EEPROM_Format(0x0001);   // Initializes flash for EEPROM
		                                  //  emulation.  Format the flash
                                          //  for one record.
        switch (status)                   // Check for format errors and process.
        {
		case ILLEGAL_RECORD_NUMBER:
           lcd_clear();
           printfLCD("Illegal records\n");
	 	   printfLCD("reduce number\n");
		   delay_2sec();
	       while(1);                      // Process the error.

		case FORMAT_FAILED:
           lcd_clear();
    	   printfLCD("Format Failed\n");
		   printfLCD("Reset\n");
		   delay_1sec();
	       while(1);                      // Process the error.

		case SECTOR_ERASE_ERROR:
           lcd_clear();
    	   printfLCD("Sector Erase\n");
		   printfLCD("Error-Reset\n");
		   delay_1sec();
	       while(1);                      // Process the error.
        }
    }

    if (flash_previously_init == TRUE)    // Flash was init for EEPROM Emul prior
                                          //  to reset.
    {
       lcd_clear();                       // Indicate on display it was init.
       printfLCD("Previously init\n");
       printfLCD("for EEPROM Emul.\n");
       delay_2sec();

       lcd_clear();
       printfLCD("Reading Rec# 0\n");     // Indicate that Rec# 0 will be read
       printfLCD("contents...\n");        //  and displayed.
       delay_2sec();

       status = Read_Record(0,&tmpbuf[0]); // Read the previously stored record.
       if (status)                         // Check for read errors.
	   {
	      lcd_clear();
	      printfLCD("RD Error =%x\n",status);
	      while(1);                            // Process the error.
	   }
       lcd_clear();
       printfLCD("Rec# 0 contains\n");            // Display contents of record.
       printfLCD("the value: 0x%x\n",tmpbuf[0]);
       delay_2sec();
       delay_2sec();

	   EEPROM_write_value = ++tmpbuf[0];   // Set next value to write to EEPROM 
    }
    else
    {
       EEPROM_write_value = 0;    // EEPROM was not previously initialized so
                                  //  use this value as the starting value to 
                                  //  to write to EEPROM.
    }

    lcd_clear();                        // Describe operation of demo with
    printfLCD("Now going to    \n");    //  messages on LCD display.
    printfLCD("update Rec# 0 w/\n");
	delay_2sec();
    printfLCD("incrementing val\n");
    printfLCD("every 2 seconds.\n");
    delay_2sec();

	while (1)
	{		
        buf[0] = EEPROM_write_value++;
	    status = Update_Record(0, &buf);  // Write record with the content in buf[0] 
	    if (status)
		{
			lcd_clear();
			printfLCD("WR Error =%x\n",status);
            printfLCD("writing: 0x%x\n",buf[0]);
			while(1);                             // Process the error.
		}

        status = Read_Record(0,&tmpbuf[0]);    // read the record
		if (status)
		{
			lcd_clear();
			printfLCD("RD Error =%x\n",status);
			while(1);                             // Process the error.
		}

	    if (tmpbuf[0] == buf[0])              // Verify the record was written
                                              //  correctly.
	    {        
           lcd_clear();                       // Display the written value.
           printfLCD("Wrote Rec# 0\n");       
           printfLCD("with value: 0x%x\n",tmpbuf[0]);
		   delay_2sec();
        } 
	    else 
        {
            lcd_clear();
	        printfLCD("Read & Compare.\n");
	        printfLCD("Miscompared!\n");
			while(1);                        // Process the error.

	    }
     }
}  


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲激情综合网| 成人国产精品免费观看| 亚洲国产裸拍裸体视频在线观看乱了| 国产精品久久久久久亚洲伦| 欧美激情一区二区三区四区| 久久久www成人免费无遮挡大片| 精品国内二区三区| 久久伊99综合婷婷久久伊| 精品成a人在线观看| 久久久蜜桃精品| 久久久精品tv| 国产精品久久久久影视| 国产精品久久久久久久久动漫| 亚洲视频免费看| 亚洲精品日产精品乱码不卡| 一区二区三区产品免费精品久久75| 亚洲精品免费在线播放| 亚洲r级在线视频| 日本怡春院一区二区| 国产一区二区女| 国产成人免费xxxxxxxx| 91老司机福利 在线| 欧美日本国产一区| 精品剧情v国产在线观看在线| 久久综合一区二区| 国产精品第13页| 亚洲国产日韩av| 麻豆国产精品一区二区三区| 国产成人aaaa| 欧洲色大大久久| 日韩久久久久久| 中文字幕免费一区| 亚洲va欧美va人人爽| 久草这里只有精品视频| 波多野结衣一区二区三区 | 色综合久久中文字幕综合网| 日本精品一区二区三区高清| 日韩午夜av一区| 中国色在线观看另类| 亚洲狠狠爱一区二区三区| 精品制服美女丁香| voyeur盗摄精品| 在线播放国产精品二区一二区四区| 久久综合国产精品| 亚洲一区二区三区在线| 精品一区二区三区在线播放视频 | 欧美中文字幕亚洲一区二区va在线| 欧美精品1区2区| 日本一区二区视频在线观看| 午夜精品免费在线| 国产激情精品久久久第一区二区| 在线一区二区三区四区五区| 精品国产一区二区在线观看| 亚洲视频在线一区二区| 久久99精品久久久久| 91久久一区二区| 久久久天堂av| 亚洲va欧美va天堂v国产综合| 顶级嫩模精品视频在线看| 欧美日韩视频在线第一区| 国产精品久久二区二区| 久久99热99| 欧美日韩午夜影院| 亚洲精品综合在线| 成人综合激情网| 精品久久人人做人人爽| 一区二区三区国产| 国产成人久久精品77777最新版本| 欧美日韩免费一区二区三区视频| 国产欧美日韩在线观看| 免费高清视频精品| 欧美日韩在线亚洲一区蜜芽| 国产精品嫩草影院com| 久久99精品久久久久久国产越南| 欧美午夜精品免费| 中文字幕一区av| 国产精品18久久久久久久网站| 在线播放一区二区三区| 亚洲精品国产一区二区三区四区在线| 国产精品一级在线| 精品国产乱码久久久久久1区2区| 亚洲第一福利视频在线| 色婷婷av一区二区三区gif| 国产精品欧美一区喷水| 国产精品一区二区在线看| 精品久久人人做人人爰| 久久精品国产网站| 日韩精品一区二区三区swag| 天堂一区二区在线| 欧美日韩一区在线观看| 一区二区三区美女| 色婷婷av一区| 亚洲综合视频在线观看| 91美女片黄在线观看91美女| 欧美激情综合网| 国产成人午夜99999| 久久精品欧美日韩精品| 国产**成人网毛片九色| 国产亚洲一本大道中文在线| 国产麻豆欧美日韩一区| 2023国产一二三区日本精品2022| 麻豆国产精品官网| 欧美一二三区在线| 激情图片小说一区| 久久久美女艺术照精彩视频福利播放 | 亚洲成av人片观看| 欧美日韩免费在线视频| 日韩av二区在线播放| 欧美日韩一区不卡| 日本免费新一区视频| 日韩免费高清电影| 国产一区二区三区精品视频| 久久久久久久综合| 成人av先锋影音| 一区二区三区在线影院| 欧美日韩综合在线| 久久国产精品99久久人人澡| 久久青草欧美一区二区三区| 成人三级在线视频| 亚洲欧洲韩国日本视频| 在线观看免费成人| 视频一区欧美日韩| 精品美女一区二区| 国产激情精品久久久第一区二区 | 青青草视频一区| 久久久久久久久蜜桃| av在线不卡观看免费观看| 亚洲高清三级视频| 日韩精品专区在线影院重磅| 国产一区二区看久久| 国产精品三级在线观看| 欧美性猛交xxxx乱大交退制版| 日本成人在线电影网| 国产日产欧美一区二区三区 | 国产精品久久久久影院色老大 | 国产亚洲一区字幕| 色美美综合视频| 久久国产婷婷国产香蕉| 国产精品欧美综合在线| 欧美又粗又大又爽| 美女一区二区在线观看| 国产精品三级在线观看| 欧美日韩一区二区三区免费看 | 69av一区二区三区| 高清不卡一区二区在线| 亚洲国产精品影院| 国产欧美综合色| 欧美日韩精品欧美日韩精品一综合 | 国产尤物一区二区| 亚洲午夜在线视频| 久久这里只有精品6| 在线亚洲一区观看| 国产aⅴ精品一区二区三区色成熟| 亚洲综合激情另类小说区| 国产午夜三级一区二区三| 欧美性大战xxxxx久久久| 国产99久久久久久免费看农村| 亚洲成人手机在线| 国产精品久久影院| 日韩免费观看2025年上映的电影| 色综合天天天天做夜夜夜夜做| 青青草伊人久久| 一区二区欧美视频| 日本一区二区三区电影| 91精品久久久久久久99蜜桃| a级高清视频欧美日韩| 捆绑紧缚一区二区三区视频| 亚洲午夜精品网| 亚洲三级电影网站| 久久久一区二区| 欧美一级日韩免费不卡| 欧美性色欧美a在线播放| 丁香婷婷深情五月亚洲| 麻豆免费精品视频| 亚洲成人先锋电影| 亚洲免费在线播放| 国产精品国产a级| 久久婷婷国产综合国色天香| 欧美挠脚心视频网站| 91国模大尺度私拍在线视频| 懂色av一区二区三区免费看| 黑人巨大精品欧美一区| 日韩电影在线免费观看| 香蕉久久一区二区不卡无毒影院| 亚洲欧洲av一区二区三区久久| 337p日本欧洲亚洲大胆色噜噜| 7777精品伊人久久久大香线蕉| 91国产丝袜在线播放| 91一区二区三区在线观看| 成人一道本在线| 国产成人在线免费| 精品一二三四在线| 久久国产精品72免费观看| 日日夜夜一区二区| 日韩中文字幕一区二区三区| 午夜久久久久久久久久一区二区| 亚洲一区视频在线观看视频| 亚洲国产日日夜夜| 亚洲第四色夜色| 偷拍亚洲欧洲综合|