⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flash.h

📁 <B>SMSC USB2.0 Flash硬盘驱动源码</B>
💻 H
字号:
/*============================================================================
  ____________________________________________________________________________
                                ______________________________________________
   SSSS  M   M          CCCC          Standard Microsystems Corporation
  S      MM MM   SSSS  C                    Austin Design Center
   SSS   M M M  S      C                 11000 N. Mopac Expressway
      S  M   M   SSS   C                Stonelake Bldg. 6, Suite 500
  SSSS   M   M      S   CCCC                Austin, Texas 78759
                SSSS            ______________________________________________
  ____________________________________________________________________________

  Copyright(C) 1999, Standard Microsystems Corporation
  All Rights Reserved.

  This program code listing is proprietary to SMSC and may not be copied,
  distributed, or used without a license to do so.  Such license may have
  Limited or Restricted Rights. Please refer to the license for further
  clarification.
  ____________________________________________________________________________

  Notice: The program contained in this listing is a proprietary trade
  secret of SMSC, Hauppauge, New York, and is copyrighted
  under the United States Copyright Act of 1976 as an unpublished work,
  pursuant to Section 104 and Section 408 of Title XVII of the United
  States code. Unauthorized copying, adaption, distribution, use, or
  display is prohibited by this law.
  ____________________________________________________________________________

  Use, duplication, or disclosure by the Government is subject to
  restrictions as set forth in subparagraph(c)(1)(ii) of the Rights
  in Technical Data and Computer Software clause at DFARS 52.227-7013.
  Contractor/Manufacturer is Standard Microsystems Corporation,
  80 Arkay Drive, Hauppauge, New York, 1178-8847.
  ____________________________________________________________________________
  ____________________________________________________________________________

  flash.h -
  ____________________________________________________________________________

  comments tbd
  ____________________________________________________________________________

  Revision History
  Date      Who  Comment
  ________  ___  _____________________________________________________________
  04/15/02  tbh  initial version
  08/06/02  tbh  ported to fmc, only support k_at29c010a because code is so
                 tight we can barely afford to spare 3 x 128 byte pages.
  09/07/02  tbh  updated to function correctly.  only supports sst39vf010                 .
============================================================================*/

// IMPORTANT:
// because flash addr 0 is smack in the middle of the code ram address range
// and writing to that range will whack the code in the ram with whatever you write
// you must ensure that whatever flash code that occupies the target address does
// not get run during writing/erasing because it will be corrupted.
// none of the relocatable flash functions are big enough to cross this address.
// but if you change them, they might get there...

// a 4k chunk of xdata starting here will be overwritten during otprom/nvstore update
#define k_ram_base 0x6000

// THIS IS THE ONLY SUPPORTED CHIP
#define k_sst39vf010

#ifdef k_sst39vf010
  #define k_flash_addr0 0x5555
  #define k_flash_addr1 0x2AAA
  #define k_flash_sector_sz 0x1000
  #define k_flash_sector_erase 0x30
  #define k_otprom_base 0xF000
  #define k_nvstore_base 0xFE80
#endif

//------------------------------------------------------------------------------
extern xdata t_result g_flash_rslt;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _flash_execute_from_ram()  \
  _mcu_register_set_bits(x_util_config, kbm_util_config_sram_sw)

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _flash_execute_from_flash()  \
  _mcu_register_clr_bits(x_util_config, kbm_util_config_sram_sw)

//------------------------------------------------------------------------------
uint8 otprom_read(uint8 addr) reentrant;
void otprom_write_flush(void) reentrant;

//---eof------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -