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

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

?? c2374.c

?? M29W320E flash驅動
?? C
?? 第 1 頁 / 共 5 頁
字號:
/**************** STFL-I Flash Memory Driver ***********************************

   Filename:    c2374.c
   Description: Library routines for the M29W320E
                32Mb (4Mb x 8 or 2Mb x 16,Page,Boot Block) Flash Memory drivers
                in different configurations.

   Version:     $Id: c2374.c,v 1.0 2006/06/16 
                     
   Author:     Ze-Yu He, MSAC,STMicroelectronics, Shanghai (China)
               Wiley Xu, MSAC,STMicroelectronics, Shanghai (China)
               Echo Chen,MSAC,STMicroelectronics, Beijing  (China)
   Copyright (c) 2006 STMicroelectronics.

   THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
   EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTY
   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
   AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
   PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
   REPAIR OR CORRECTION.
********************************************************************************

   Version History.

   Ver.   Date        Comments

   0.0    2006/05/29  Initial Release of the software (Alpha)
   1.0    2006/06/16  Qulified Release of the software  

********************************************************************************

   This source file provides library C code for using the M29W320E flash devices.
   The following device is supported in the code: M29W320ET and M29W320EB

   This file can be used to access the devices in 8bit and 16bit mode.

   The following functions are available in this library:

      Flash(BlockErase, ParameterType)            to erase one block
      Flash(CheckBlockProtection, ParameterType)  to check whether a given block is protected
      Flash(CheckCompatibility, ParameterType)    to check the compatibility of the flash 
      Flash(ChipErase, ParameterType)             to erase the whole chip
      Flash(ChipUnprotect, ParameterType)         to unprotect the whole chip
      Flash(GroupProtect, ParameterType)          to unprotect a blocks group
      Flash(Program, ParameterType)               to program an array of elements
      Flash(Read, ParameterType)                  to read from the flash device
      Flash(ReadCfi, ParameterType)               to read CFI information from the flash
      Flash(ReadDeviceId, ParameterType)          to get the Device ID from the device 
      Flash(ReadManufacturerCode, ParameterType)  to get the Manufacture Code from the device
      Flash(Reset, ParameterType)                 to reset the flash for normal memory access 
      Flash(Resume, ParameterType)                to resume a suspended erase
      Flash(SingleProgram, ParameterType)         to program a single element
      Flash(Suspend, ParameterType)               to suspend an erase
      Flash(Write, ParameterType)                 to write a value to the flash device

      FlashDoubleProgram()                        to program two elements in 16 bit only
      FlashEnterExtendedBlock()                   to issue the enter extended mode command
      FlashErrorStr()                             to return an error description (define VERBOSE)
      FlashExitExtendedBlock()                    to issue the exit extended mode command
      FlashMultipleBlockErase()                   to erase some blocks in same bank
      FlashPause()                                for timing short pauses (in micro seconds) 
      FlashQuadProgram()                          to program four elements in 
                                                              8 bit mode only       
      FlashReadExtendedBlockVerifyCode()    to read the lock/unlock status of the
                                                     Extended Memory Block
      FlashReadProtectionRegister()               to read a protection register location
      FlashReadStatusRegister()                   to read the Status Register
      FlashStatusPinConfig()                      to configure the Status/(Ready/Busy) pin
      FlashTimeOut()                              to return after function timeouts 
      FlashUnlockBypass()                      enter UnlockBypass mode
      FlashUnlockBypassProgram()                  to program in unlock bypass mode
      FlashUnlockBypassReset()                    to issue the unlock bypass reset command

   For further information consult the Data Sheet and the Application Note.
   The Application Note gives information about how to modify this code for
   a specific application.

   The hardware specific functions which may need to be modified by the user are:

      FlashWrite() for writing an element (uCPUBusType) to the flash
      FlashRead()  for reading an element (uCPUBusType) from the flash

   A list of the error conditions can be found at the end of the header file.

*******************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "c2374.h" /* Header file with global prototypes */

#ifdef TIME_H_EXISTS
   #include <time.h>
#endif 

/******************************************************************************
    Global variables
*******************************************************************************/ 
ErrorInfoType eiErrorInfo;


/*******************************************************************************
Function:     ReturnType Flash( CommandType cmdCommand, ParameterType *fp )
Arguments:    cmdCommand is an enum which contains all the available function
   commands of the SW driver.
              fp is a (union) parameter struct for all flash command parameters
Return Value: The function returns the following conditions: 

   Flash_AddressInvalid 
   Flash_BlockEraseFailed 
   Flash_BlockNrInvalid 
   Flash_BlockProtected 
   Flash_BlockProtectFailed 
   Flash_BlockProtectionUnclear 
   Flash_BlockUnprotected 
   Flash_CfiFailed 
   Flash_ChipEraseFailed 
   Flash_ChipUnprotectFailed 
   Flash_FunctionNotSupported
   Flash_GroupProtectFailed 
   Flash_NoInformationAvailable
   Flash_OperationOngoing 
   Flash_OperationTimeOut 
   Flash_ProgramFailed 
   Flash_ResponseUnclear 
   Flash_SpecificError
   Flash_Success 
   Flash_WrongType

Description:  This function is used to access all functions provided with the
   current flash chip.

Pseudo Code:
   Step 1: Select the right action using the cmdCommand parameter
   Step 2: Execute the Flash Function
   Step 3: Return the Error Code
*******************************************************************************/
ReturnType Flash( CommandType cmdCommand, ParameterType *fp ) { 
   ReturnType  rRetVal;
   uCPUBusType  ucDeviceId, ucManufacturerCode;

   switch (cmdCommand) {
      case BlockErase:
         rRetVal = FlashBlockErase( (*fp).BlockErase.ublBlockNr );
         break;

      case CheckBlockProtection: 
         rRetVal = FlashCheckBlockProtection( (*fp).CheckBlockProtection.ublBlockNr );  
         break; 

      case CheckCompatibility:
         rRetVal = FlashCheckCompatibility();
         break;

      case ChipErase:
         rRetVal = FlashChipErase( (*fp).ChipErase.rpResults );
         break;

      case ChipUnprotect: 
         rRetVal = FlashChipUnprotect((*fp).ChipUnprotect.rpResults ); 
         break; 

      case GroupProtect: 
         rRetVal = FlashGroupProtect( (*fp).GroupProtect.ublBlockNr ); 
         break; 

      case Program:
         rRetVal = FlashProgram( (*fp).Program.udMode,
                                 (*fp).Program.udAddrOff,
                                 (*fp).Program.udNrOfElementsInArray,
                                 (*fp).Program.pArray );                 

         break;

      case Read:
         (*fp).Read.ucValue = FlashRead( (*fp).Read.udAddrOff );
         rRetVal = Flash_Success;
         break;

      case ReadCfi:  
         rRetVal = FlashReadCfi( (*fp).ReadCfi.uwCfiFunc, &((*fp).ReadCfi.ucCfiValue) ); 
         break; 

      case ReadDeviceId:
         rRetVal = FlashReadDeviceId(&ucDeviceId);
         (*fp).ReadDeviceId.ucDeviceId = ucDeviceId;
         break;

      case ReadManufacturerCode:
         rRetVal = FlashReadManufacturerCode(&ucManufacturerCode);
         (*fp).ReadManufacturerCode.ucManufacturerCode = ucManufacturerCode;
         break;

      case Reset:
         rRetVal = FlashReset();
         break;

      case Resume:
         rRetVal = FlashResume();
         break;

      case SingleProgram:
         rRetVal = FlashSingleProgram( (*fp).SingleProgram.udAddrOff, (*fp).SingleProgram.ucValue );
         break;

      case Suspend:
         rRetVal = FlashSuspend();
         break;

      case Write:
         FlashWrite( (*fp).Write.udAddrOff, (*fp).Write.ucValue ); 
         rRetVal = Flash_Success;
         break;

      default:
         rRetVal = Flash_FunctionNotSupported;
         break;

   } /* EndSwitch */
   return rRetVal;
} /* EndFunction Flash */







/*******************************************************************************
Function:     ReturnType FlashBlockErase( uBlockType ublBlockNr )
Arguments:    ublBlockNr is the number of the Block to be erased.
Return Value: The function returns the following conditions:
   Flash_Success
   Flash_BlockEraseFailed
   Flash_BlockNrInvalid
   Flash_BlockProtected
   Flash_OperationTimeOut

Description:  This function can be used to erase the Block specified in ublBlockNr.
   The function checks that the block nr is within the valid range and not protected
   before issuing the erase command, otherwise the block will not be erased and an
   error code will be returned.
   The function returns only when the block is erased. During the Erase Cycle the
   Data Toggle Flow Chart of the Datasheet is followed. The polling bit, DQ7, is not
   used.
   
Pseudo Code:
   Step 1:  Check that the block number exists
   Step 2:  Check if the block is protected
   Step 3:  Write Block Erase command
   Step 4:  Wait for the timer bit to be set
   Step 5:  Follow Data Toggle Flow Chart until the Program/Erase Controller is
            finished
   Step 6:  Return to Read mode (if an error occurred)
*******************************************************************************/
ReturnType FlashBlockErase( uBlockType ublBlockNr) {

   ReturnType rRetVal = Flash_Success; /* Holds return value: optimistic initially! */

   /* Step 1: Check for invalid block. */
   if( ublBlockNr >= NUM_BLOCKS ) /* Check specified blocks <= NUM_BLOCKS */
      return Flash_BlockNrInvalid;

   /* Step 2: Check if the block is protected */
   if ( FlashCheckBlockProtection(ublBlockNr) == Flash_BlockProtected)
      return Flash_BlockProtected;

   /* Step 3: Write Block Erase command */
   FlashWrite( ConvAddr(0x00555), (uCPUBusType)CMD(0x00AA) );
   FlashWrite( ConvAddr(0x002AA), (uCPUBusType)CMD(0x0055) );
   FlashWrite( ConvAddr(0x00555), (uCPUBusType)CMD(0x0080) );
   FlashWrite( ConvAddr(0x00555), (uCPUBusType)CMD(0x00AA) );
   FlashWrite( ConvAddr(0x002AA), (uCPUBusType)CMD(0x0055) );
   FlashWrite( BlockOffset[ublBlockNr], (uCPUBusType)CMD(0x0030) );

   /* Step 4: Wait for the Erase Timer Bit (DQ3) to be set */
   FlashTimeOut(0); /* Initialize TimeOut Counter */
   while( !(FlashRead( BlockOffset[ublBlockNr] ) & CMD(0x0008) ) ){
      if (FlashTimeOut(5) == Flash_OperationTimeOut) {
         FlashWrite( ANY_ADDR, (uCPUBusType)CMD(0x00F0) ); /* Use single instruction cycle method */
         return Flash_OperationTimeOut;
      } /* EndIf */
   } /* EndWhile */

   /* Step 5: Follow Data Toggle Flow Chart until Program/Erase Controller completes */
   if( FlashDataToggle(BlockOffset[ublBlockNr]) !=  Flash_Success ) {
      /* Step 6: Return to Read mode (if an error occurred) */
      FlashWrite( ANY_ADDR, (uCPUBusType)CMD(0x00F0) ); /* Use single instruction cycle method */
      rRetVal=Flash_BlockEraseFailed;
   } /* EndIf */
   return rRetVal;
} /* EndFunction FlashBlockErase */





/*******************************************************************************
Function:      ReturnType FlashCheckBlockProtection( uBlockType ublBlockNr )
Arguments:     ublBlockNr = block number to be checked
Note: the first block is Block 0

Return Values: The function returns the following conditions: 
   Flash_BlockNrInvalid
   Flash_BlockUnprotected
   Flash_BlockProtected
   Flash_BlockProtectionUnclear

Description:   This function reads the protection status of a block.
Pseudo Code:
   Step 1:  Check that the block number exists
   Step 2:  Send the AutoSelect command
   Step 3:  Read Protection Status
   Step 4:  Return the device to Read Array mode

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡欧美aaaaa| 美国欧美日韩国产在线播放| 成人性视频网站| 国产日本欧美一区二区| 成人黄色777网| 一区二区三区四区在线播放 | 日韩一区二区免费视频| 加勒比av一区二区| 亚洲欧洲成人精品av97| 91福利社在线观看| 蜜臀av一区二区三区| 国产三级三级三级精品8ⅰ区| www.性欧美| 日韩av在线免费观看不卡| 精品久久久久久久久久久久久久久 | 99精品久久只有精品| 亚洲精品免费视频| 日韩三级在线观看| 成人中文字幕合集| 香蕉av福利精品导航| xf在线a精品一区二区视频网站| 成人性生交大片免费看中文| 亚洲国产婷婷综合在线精品| 精品久久久网站| 一本色道a无线码一区v| 亚洲午夜成aⅴ人片| 国产亚洲欧美中文| 欧美日韩三级一区| 岛国一区二区在线观看| 亚洲成精国产精品女| 国产欧美日韩在线| 欧美一级爆毛片| 波多野结衣91| 另类人妖一区二区av| 久久激情五月婷婷| 国产精品乱人伦| 在线不卡a资源高清| 丁香激情综合五月| 久久精品国产成人一区二区三区 | 欧美日韩午夜在线视频| 国产在线不卡视频| 亚洲午夜免费福利视频| 中文字幕乱码一区二区免费| 91精品国产入口在线| 91啪九色porn原创视频在线观看| 久久精品av麻豆的观看方式| 亚洲综合免费观看高清完整版在线| 26uuu亚洲综合色| 欧美伦理影视网| 91麻豆福利精品推荐| 国产高清久久久久| 老司机一区二区| 亚洲国产乱码最新视频 | 日韩精品三区四区| 亚洲免费资源在线播放| 久久精品一区二区三区四区| 欧美日韩国产综合视频在线观看 | 毛片av中文字幕一区二区| 樱花影视一区二区| 18欧美乱大交hd1984| 欧美激情在线免费观看| 精品福利一二区| 欧美成人video| 日韩免费在线观看| 日韩一级完整毛片| 555www色欧美视频| 欧美高清激情brazzers| 欧美午夜视频网站| 91福利精品视频| 91国偷自产一区二区三区观看| www.欧美日韩| 91视频91自| 色婷婷精品久久二区二区蜜臀av| 岛国精品在线观看| 91在线码无精品| 91丝袜呻吟高潮美腿白嫩在线观看| 国产传媒一区在线| 国产一区二区看久久| 国产精品亚洲а∨天堂免在线| 国产一本一道久久香蕉| 国产精品一区二区三区乱码| 国产精品一区专区| 成人a级免费电影| 99久久久精品| 日本二三区不卡| 欧美三区在线视频| 日韩欧美一级二级三级| 精品精品国产高清a毛片牛牛 | 日韩欧美国产小视频| 日韩亚洲欧美中文三级| 精品福利在线导航| 国产精品免费丝袜| 一区二区三区四区不卡在线| 一区二区三区产品免费精品久久75| 一区二区三区久久| 蜜臀av性久久久久av蜜臀妖精| 国产精品一区二区三区乱码| eeuss影院一区二区三区| 日本福利一区二区| 日韩视频免费观看高清完整版在线观看| 欧美mv和日韩mv国产网站| 国产欧美日韩在线| 亚洲国产日韩a在线播放性色| 午夜a成v人精品| 国产精品白丝jk黑袜喷水| 成人激情图片网| 欧美高清你懂得| 亚洲国产精品成人久久综合一区 | 五月天欧美精品| 韩国视频一区二区| 日本久久精品电影| 欧美一级电影网站| 成人欧美一区二区三区黑人麻豆 | 久久久精品综合| 亚洲一区二区三区自拍| 国内成人自拍视频| 色先锋aa成人| 337p粉嫩大胆噜噜噜噜噜91av | 91精品欧美福利在线观看| 国产日产亚洲精品系列| 亚洲一区二区精品视频| 国产东北露脸精品视频| 欧美无砖砖区免费| 国产精品久久久久9999吃药| 日本伊人精品一区二区三区观看方式| 国产精品综合av一区二区国产馆| 色爱区综合激月婷婷| 久久久亚洲综合| 婷婷丁香激情综合| 99久久99久久免费精品蜜臀| 精品国产百合女同互慰| 亚洲国产欧美在线| 91丨九色porny丨蝌蚪| 久久免费视频色| 日韩av中文字幕一区二区| 日本乱人伦aⅴ精品| 欧美激情资源网| 美女免费视频一区| 欧美日韩黄视频| 亚洲精品欧美激情| 成人国产亚洲欧美成人综合网| 日韩丝袜情趣美女图片| 亚洲午夜久久久久久久久电影院| 国产伦精品一区二区三区免费| 欧美性大战久久久| 中文字幕亚洲欧美在线不卡| 国产成人免费网站| 久久久久久亚洲综合影院红桃 | 欧美人与性动xxxx| 亚洲欧美日韩国产综合在线| 国产suv精品一区二区6| 欧美草草影院在线视频| 蜜桃一区二区三区在线| 5566中文字幕一区二区电影 | 国内精品免费在线观看| 欧美一区二区在线观看| 午夜视频在线观看一区| 欧美色倩网站大全免费| 亚洲线精品一区二区三区| 91视视频在线观看入口直接观看www | 国产精品免费视频网站| 国产成人鲁色资源国产91色综| 久久综合九色综合97婷婷| 久久电影网电视剧免费观看| 日韩精品综合一本久道在线视频| 日韩精品午夜视频| 日韩欧美美女一区二区三区| 日韩电影网1区2区| 91精品国产91综合久久蜜臀| 日韩黄色免费电影| 91精品国产欧美一区二区18| 免费观看久久久4p| 精品福利在线导航| 成人综合在线视频| 亚洲日本va午夜在线电影| 91色乱码一区二区三区| 亚洲免费av观看| 欧美影院一区二区三区| 天天综合色天天| 日韩西西人体444www| 黄色小说综合网站| 欧美国产日韩一二三区| 色婷婷av一区二区| 日韩电影一二三区| 2021中文字幕一区亚洲| 粉嫩av一区二区三区在线播放| 一区在线中文字幕| 欧美日韩精品一区二区三区蜜桃| 日韩高清在线不卡| 久久久久9999亚洲精品| 色综合久久久久久久| 午夜视频一区二区三区| 久久久国际精品| 99精品在线观看视频| 日精品一区二区三区| 欧美激情一区二区三区全黄| 欧美怡红院视频| 国产一区91精品张津瑜| 亚洲精品ww久久久久久p站 | 精品国产a毛片|