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

📄 trace.h

📁 U盘控制器USB97C223的固件代码,对2kPAGE NAND FLASH 有很好的支持.
💻 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.
  ____________________________________________________________________________
  ____________________________________________________________________________

  trace.h - debugging via the smsc trace fifo.
  ____________________________________________________________________________

  comments tbd
  ____________________________________________________________________________

  Revision History
  Date      Who  Comment
  ________  ___  _____________________________________________________________
  10/22/00  tbh  initial version to support trgen
  07/27/01  tbh  tweak port for 20x family
  08/15/01  tbh  moved trace port addr to 0xFFFE and 0xFFFF for the 20x family
  07/01/03  ds   The trace port addr for 243 is located at 0xbfff. Added that change.
============================================================================*/

#ifdef k_20x_family
#if !defined(__kernel__) && !defined(__manager__)
// sorry, but had to do this to get this register visible to the u2dp
// application layer, since apps don't include cpu.h, and don't see registers.
#define kbm_WRS 0x01
sfr SPCFNC = 0x8F;
#endif
#ifdef k_mcu_97243
#define TRACE();     {SPCFNC=kbm_WRS;XBYTE[0xBFFF]=1;SPCFNC=0;}
#define TRBYTE(val); {SPCFNC=kbm_WRS;XBYTE[0xBFFE]=((uint8)(val));SPCFNC=0;}
#else
#define TRACE();     {SPCFNC=kbm_WRS;XBYTE[0xFFFF]=1;SPCFNC=0;}
#define TRBYTE(val); {SPCFNC=kbm_WRS;XBYTE[0xFFFE]=((uint8)(val));SPCFNC=0;}
#endif
#endif

#ifdef k_10x_family
#define TRACE();     {XBYTE[0xBFFF]=1;}
#define TRBYTE(val); XBYTE[0xBFFE]=(val);
#endif

#define TRWORD(val);  {TRBYTE((val) & 0xFF); TRBYTE((val) >> 8);}
#define TREVENT(nbr); {TRBYTE(0xFD); TRWORD((nbr));}
#define TRACE0(nbr, cat, lvl, str);                     {TREVENT(nbr);}
#define TRACE1(nbr, cat, lvl, str, p1);                 {TREVENT(nbr); TRWORD(p1);}
#define TRACE2(nbr, cat, lvl, str, p1, p2);             {TREVENT(nbr); TRWORD(p1); TRWORD(p2);}
#define TRACE3(nbr, cat, lvl, str, p1, p2, p3);         {TREVENT(nbr); TRWORD(p1); TRWORD(p2); TRWORD(p3);}
#define TRACE4(nbr, cat, lvl, str, p1, p2, p3, p4);     {TREVENT(nbr); TRWORD(p1); TRWORD(p2); TRWORD(p3); TRWORD(p4);}
#define TRACE5(nbr, cat, lvl, str, p1, p2, p3, p4, p5); {TREVENT(nbr); TRWORD(p1); TRWORD(p2); TRWORD(p3); TRWORD(p4); TRWORD(p5);}
#define trace();
#define trace0(nbr, cat, lvl, str);
#define trace1(nbr, cat, lvl, str, p1);
#define trace2(nbr, cat, lvl, str, p1, p2);
#define trace3(nbr, cat, lvl, str, p1, p2, p3);
#define trace4(nbr, cat, lvl, str, p1, p2, p3, p4);
#define trace5(nbr, cat, lvl, str, p1, p2, p3, p4, p5);

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

⌨️ 快捷键说明

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