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

📄 dev.h

📁 <B>SMSC USB2.0 Flash硬盘驱动源码</B>
💻 H
📖 第 1 页 / 共 2 页
字号:
/*============================================================================
  ____________________________________________________________________________
                                ______________________________________________
   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.
  ____________________________________________________________________________
  ____________________________________________________________________________

  dev.h - the device manager implementarion
  ____________________________________________________________________________

  comments tbd
  ____________________________________________________________________________

  Revision History
  Date      Who  Comment
  ________  ___  _____________________________________________________________
  04/08/02  tbh  initial version
  05/09/02  cds  added _dev_soft_reset() macro
  06/21/02  cds  added _nand_pwr_on() and _nand_pwr_off() macros
  08/09/02  cds  added attribute flag variables, default constants, and
                 our very own first usable attribute flag on the 211:  attr_lo_sm_timing
                 to force nand chips to use the slower smart media spec compatible timing.
  08/13/02  tbh  moved g_dev_attr_xx to xdata
  08/27/02  cds  added attribute bit to force nand hd to enum as removable media always.
  09/06/02  ds   added references to the new variables used for the 'custom' blinking light code.
  09/06/02  ds   added an attribute bit to indicate the behavior of gpio5
  09/07/02  tbh  added the force iSerial to zero attrib bit
  09/12/02  tbh  moved g_post_access_blink_secs and g_blink_interval into
                 data space.  this should prevent access to xdata during MS and SD
                 transfers.  had to convert all strncpy's into memcpy's.
                 (MS hdw bug: corrupts data if xdata accessed during xfer.
                 same happens on SD?  cannot prove or disprove yet...)
  09/20/02  tbh  added prototypes for dev_indicate_bus_speed, dev_turn_off_activity_indicator,
                 dev_gpio_power_down, dev_toggle_activity_indicator
  10/01/02  ds   Moved the index definitions for nvstore, to dev.h so that it could be accessed from
                 other files. Also added definition k_ix_secure_mem  
  10/07/02  ds   Added k_ix_inq_pid_hdr and k_ix_inq_vid to support custom fields in the Inquiry data                               
  10/15/02  cds  - added k_sz_inq_pid_hdr and k_sz_inq_vid to denote size of the fields
                 - added globals g_inq_vid, g_inq_pid_hdr to hold contents to be used during inquiry
                 - added attribute bit 4:  1, use IMIDS/IPIDS fields, 0, default, build inq vid/pid from mfr/prd strings
  10/17/02  cds  - project-wide lun data & vtbl paging to reduce code space.           
                 - removed g_active_media from _lun_data, _lun_() virtual functions    
                 - added _lun_data_rd() and _lun_data_wr() macros to bypass lun paging 
                 - added lun_set_active(log_lun) function to switch luns               
  10/30/02  ds   Added a new attribute bit that specifies state of the activity-led on Suspend              
============================================================================*/

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _cf_pwr_on()                                                           \
{                                                                              \
  _mcu_register_set_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_cf);                   \
  _mcu_register_clr_bits(x_gpiob_out, kbm_gpio9);                              \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _cf_pwr_off()                                                          \
{                                                                              \
  _mcu_register_clr_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_cf);                   \
  _mcu_register_set_bits(x_gpiob_out, kbm_gpio9);                              \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _ms_pwr_on()                                                           \
{                                                                              \
  _mcu_register_set_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_ms);                   \
  _mcu_register_clr_bits(x_gpiob_out, kbm_gpio8);                              \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _ms_pwr_off()                                                          \
{                                                                              \
  _mcu_register_clr_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_ms);                   \
  _mcu_register_set_bits(x_gpiob_out, kbm_gpio8);                              \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _sm_pwr_on()                                                           \
{                                                                              \
  _mcu_register_set_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_sm);                   \
  _mcu_register_clr_bits(x_gpiob_out, kbm_gpio10);                             \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _sm_pwr_off()                                                          \
{                                                                              \
  _mcu_register_clr_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_sm);                   \
  _mcu_register_set_bits(x_gpiob_out, kbm_gpio10);                             \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _sd_pwr_on()                                                           \
{                                                                              \
  _mcu_register_set_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_sd);                   \
  _mcu_register_clr_bits(x_gpiob_out, kbm_gpio11);                             \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _sd_pwr_off()                                                          \
{                                                                              \
  _mcu_register_clr_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_sd);                   \
  _mcu_register_set_bits(x_gpiob_out, kbm_gpio11);                             \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _nand_pwr_on()                                                         \
{                                                                              \
  _mcu_register_set_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_sm);                   \
  _mcu_register_clr_bits(x_gpiob_out, kbm_gpio10);                             \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _nand_pwr_off()                                                        \
{                                                                              \
  _mcu_register_clr_bits(x_fmc_out_ctl, kbm_fmc_out_ctl_sm);                   \
  _mcu_register_set_bits(x_gpiob_out, kbm_gpio10);                             \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _inserted(__lun) _lun_data_wr((__lun), media, (_lun_data_rd((__lun), media)|(kbm_lun_media_present|kbm_lun_media_unknown|kbm_lun_media_changed)))

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _ejected(__lun) _lun_data_wr((__lun), media, (_lun_data_rd((__lun),media)&~(kbm_lun_media_present|kbm_lun_media_unknown|kbm_lun_media_changed)))

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _sd_ejected()                                                          \
{ TRACE0(446, dev, 0, "_sd_ejected()");                                         \
  _lun_data_wr(k_lun_sd, media, (_lun_data_rd(k_lun_sd,media)&~(kbm_lun_media_present|kbm_lun_media_unknown|kbm_lun_media_changed)));\
  _mcu_register_clr_bits(x_crd_ps, kbm_crd_ps_sd);                             \
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#define _mmc_ejected()                                                         \
{ TRACE0(447, dev, 0, "_mmc_ejected()");                                        \
  _lun_data_wr(k_lun_mmc, media, (_lun_data_rd(k_lun_mmc, media)&~(kbm_lun_media_present|kbm_lun_media_unknown|kbm_lun_media_changed)));\
  _mcu_register_clr_bits(x_crd_ps, kbm_crd_ps_mmc);                            \
}

⌨️ 快捷键说明

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