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

📄 nand.h

📁 u盘MCU端源代码,开发U盘的可以参考.
💻 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.
  ____________________________________________________________________________
  ____________________________________________________________________________
  fmcdev.h - USB97210 device specific hardware interface definitions and
             functions that are external to the MCU (ergo external to minimos).
  ____________________________________________________________________________
  comments tbd
  ____________________________________________________________________________
  Revision History
  Date      Who  Comment
  ________  ___  _____________________________________________________________
  06/21/02  cds  initial version - defines the overrides for a raw nand-flash
                 fixed media lun.  The NAND lun is derived from the smart
                 media class, but a smart media lun should be able to co-exist
                 co-exist with this derived nand-flash lun. 
  06/25/02  cds  incorporated boot block reading/writing for device usb config
                 info                  
  07/29/02  cds  exported nand write fmc transfer functions & moved n2k controller
                 commands into this module from nand_2k_media.c
  08/13/02  cds  export n2k_rd/wr_va2pa functions
  08/27/02  cds  - added nand_check_wp() to check state of teh wp bit
                 - overrode dfa_lun_inquiry() to set the removable flag before enumeration
                   and after all attributes & write protection decisions have been made
                 - overrode dfa_lun_test_unit_ready() to poll write protect bit changes
  09/04/02  cds  - removed n2k va2pa conversion routines.  functionality moved to
                   nand_xx_va2pa functions
  09/05/02  cds  added n2k_page_write_cache_data() function
============================================================================*/

#ifndef __nand_dot_h__
#define __nand_dot_h__


//+-----------------------------------------------------------------------------
// Name:
//   nand_select_card()
//
// Declaration:
//   void nand_select_card(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD
//
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
void nand_select_card( void ) reentrant ;


//+-----------------------------------------------------------------------------
// Name:
//   nand_identify_media_format()
//
// Declaration:
//   void nand_identify_media_format(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD
//
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result nand_identify_media_format(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result nand_write_begin_first_split(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result n2k_write_begin_xfer(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result n2k_write_begin_split(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result n2k_write_begin_first_split(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result n2k_write_begin_burst(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result n2k_write_end_burst(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result nand_page_read_for_data(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result n2k_page_read_for_copy(void) reentrant ; 

//------------------------------------------------------------------------------
// jump to offset within page in chip cache for data source... page_rd_for_data
// must have previously been called.
//------------------------------------------------------------------------------
t_result n2k_page_set_rd_offset( uint16 offset ) reentrant ; 

//------------------------------------------------------------------------------
// jump to offset within page in chip cache for data dest
//------------------------------------------------------------------------------
t_result n2k_page_set_wr_offset( uint16 offset )  reentrant ;

//------------------------------------------------------------------------------
// program page with serial data input
//------------------------------------------------------------------------------
t_result nand_cmd_page_program(void) reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result nand_cmd_cache_program(void) reentrant ;

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
t_result nand_cmd_page_write_cache_data() reentrant ;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result nand_cmd_check_status(void) reentrant;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result nand_cmd_reset_device(void) reentrant;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result nand_cmd_read_id(void) reentrant;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
t_result nand_cmd_read_id_ex(void) reentrant;
t_result nand_cmd_check_status_new(void) reentrant;

//-----------------------------------------------------------------------------
// helper macros
//-----------------------------------------------------------------------------
// generic equation:  
// current specs allow for up to 8K / page, which can have at most 16 segments, so 
// 
#define _n2k_data_offset(__segment) ((uint16)((((uint16)__segment)<<9)|(((uint16)__segment)<<4)))
#define _n2k_extra_data_offset(__segment)((uint16)((((uint16)(__segment+1))<<9)|(((uint16)__segment)<<4)))

//+-----------------------------------------------------------------------------
// probe media sts to see if wp status has changed
//------------------------------------------------------------------------------
t_result nand_check_wp() reentrant;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// nand lun overrides
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

// #if (k_log_lun_nand < k_max_log_lun)

//------------------------------------------------------------------------------
// define instance method of enabling the lun mux.  since thereis already
// a mechanism for doing this, I'm simply going to use it (defined in fmc.h)
// instead of wrapping a function call in this class (which is the more "OO" pure way
// of encapsulating the "class" methods) to that function.
//
// note it is a FUNCTION not a DFA!!!!
//-------------------------------------------------------------------------------
#undef _v_lun_enable_mux
#define _v_lun_enable_mux fmc_select_nand


//------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_reset_controller(void) reentrant;
#undef _v_lun_reset_controller
#define _v_lun_reset_controller nand_reset_controller

//------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_initialize_controller(void) reentrant;
#undef _v_lun_initialize_controller
#define _v_lun_initialize_controller nand_initialize_controller

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_process_idle(void) reentrant;
#undef _v_lun_process_idle
#define _v_lun_process_idle nand_process_idle

//------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_dfa_initialize_media(void) reentrant;
#undef _v_dfa_lun_initialize_media
#define _v_dfa_lun_initialize_media nand_dfa_initialize_media

//------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_dfa_reset_media(void) reentrant;
#undef _v_dfa_lun_reset_media
#define _v_dfa_lun_reset_media nand_dfa_reset_media

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_dfa_identify_media(void) reentrant;
#undef _v_dfa_lun_identify_media
#define _v_dfa_lun_identify_media nand_dfa_identify_media

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_dfa_inquiry(void) reentrant;
#undef _v_dfa_lun_inquiry
#define _v_dfa_lun_inquiry nand_dfa_inquiry

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_dfa_test_unit_ready(void) reentrant;
#undef _v_dfa_lun_test_unit_ready
#define _v_dfa_lun_test_unit_ready nand_dfa_test_unit_ready 

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_dfa_read(void) reentrant ;
#undef _v_dfa_lun_read
#define _v_dfa_lun_read nand_dfa_read

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_dfa_write(void) reentrant ;
#undef _v_dfa_lun_write
#define _v_dfa_lun_write nand_dfa_write

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
void nand_dfa_verify(void) reentrant ;
#undef _v_dfa_lun_verify
#define _v_dfa_lun_verify nand_dfa_verify


// index into the vtbl
typedef uint8 t_nand_vtbl_ix ;
typedef enum e_nand_vtbl_entry
{
  k_nand_vtbl_sz = k_sm_vtbl_sz
} ;

// nand class definition:
#define _v_nand _v_sm

// nand class vtable declaration & vtable size declaration
extern code  _vtbl_decl(nand) ;

// #endif // if k_log_lun_nand < k_max_log_lun

#else
#error "warning: header included too many times!"
#endif  // __nand_dot_h__

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

⌨️ 快捷键说明

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