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

📄 eeprom.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.
  ____________________________________________________________________________
  ____________________________________________________________________________

  eeprom.h - eeprom interface
  ____________________________________________________________________________

  comments tbd
  ____________________________________________________________________________

  Revision History
  Date      Who  Comment
  ________  ___  _____________________________________________________________
  06/26/01  rcc  initial version
  09/25/01  tbh  rearranged
  01/24/02  rcc  changed the serial eeprom code to work with DI/DO on same pin saves a GPIO
                 and more importantly makes the code the same as the 201
============================================================================*/

//------------------------------------------------------------------------------
// Change the defines below if you ever need to scramble which gpios you need to use
// This code was designed for the 93LV56 or 66 A eeprom devices.
// Just assign the gpio you want to CL, CD, DI, or DO below
// Also put in k_position_of_data_out_gpio the decimal number of the GPio
// you have assigned to DO.  These are all the changes you need to make in order to use
#define CLK kbm_gpio7                 // This is eeprom CLK signal
#define CS  kbm_gpio2                 // This is eeprom CS signal
#define DI  kbm_gpio4                 // This is eeprom DI signal 
#define DO  kbm_gpio4                 // This is eeprom DO signal
#define k_position_of_data_out_gpio 4 //This is the decimal number of the gpio used in DO above

//------------------------------------------------------------------------------
#define k_pin_high 1
#define k_pin_low 0

//------------------------------------------------------------------------------
#define kbm_set_util_reg_as_gpios 0x00                  //set gpio 0,1,2,3,4 as gpios disable gpio0 toggle
#define k_data_rotate_right k_position_of_data_out_gpio //(N) number of times to rotate right is using Gpio N for dat in.
#define kbm_MSB_only_mask  0x80                         //look at MSB only

//------------------------------------------------------------------------------
// prototypes
void eeprom_write_enable(void)  reentrant;
void eeprom_write_disable(void) reentrant;
void eeprom_write(uint8 addr, uint8 dataout) reentrant;
uint8 eeprom_read(uint8 addr) reentrant;

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

⌨️ 快捷键说明

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