📄 debug.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.
____________________________________________________________________________
____________________________________________________________________________
<module name> - <module description>
____________________________________________________________________________
comments tbd
____________________________________________________________________________
Revision History
Date Who Comment
________ ___ _____________________________________________________________
03/13/01 tbh initial version
07/27/01 tbh tweak port for 20x family
08/15/01 tbh added prototype for ramtest()
12/04/01 tbh added prototype for dbg_dump_sfr(), dbg_loadram()
06/18/02 tbh tweaked profiling macros for 210
12/06/02 ds added prototype for dbg_zeroram
============================================================================*/
//------------------------------------------------------------------------------
// This is hardcode debug stuff for performance profiling with an oaciloscope.
// To do this, all gpio pins must be dedicated to scope tracing.
// _profile_on(pin) drives the scope probe low, _profile_off(pin) drives it high.
//------------------------------------------------------------------------------
#ifdef __profile__
#ifdef k_flash_family
#define _profile_initialize(); { \
_mcu_register_set_bits(x_gpiob_dir, 0xFF); \
_mcu_register_set_bits(x_gpiob_out, 0xFF); }
#define _profile_off(__ch); { _mcu_register_clr_bits(x_gpiob_out, (kbm_gpio##__ch)); }
#define _profile_on(__ch); { _mcu_register_set_bits(x_gpiob_out, (kbm_gpio##__ch)); }
#else
#define _profile_initialize(); { gpio_wr_dir(0xFF); gpio_wr(0xFF); }
#define _profile_off(__ch); { _lo(kbm_gpio##__ch); }
#define _profile_on(__ch); { _hi(kbm_gpio##__ch); }
#endif
#else
#define _profile_initialize();
#define _profile_on(__ch);
#define _profile_off(__ch);
#endif
#ifdef k_20x_family
//------------------------------------------------------------------------------
// Declaration:
// void _phy_hard_reset(void);
//
// Purpose:
// Resets the phy to it's initial power-on state via GPIO pin 4.
//
// Arguments:
// None.
//
// Return:
// None.
//
// Since:
// MinimOS-2.0
//------------------------------------------------------------------------------
#define _phy_hard_reset() {x_gpioa_dir|=kbm_gpio4;_hi(kbm_gpio4);_lo(kbm_gpio4); trace0(0, nil, 0, "_phy_hard_reset()"); }
//------------------------------------------------------------------------------
// Declaration:
// void _led_on(void);
//
// Purpose:
// Turns on the happy-light led on the fpga board.
//
// Arguments:
// None.
//
// Return:
// None.
//
// Since:
// MinimOS-2.0
//------------------------------------------------------------------------------
#define _led_on() {x_gpioa_dir|=kbm_gpio0;_hi(kbm_gpio0);}
//------------------------------------------------------------------------------
// Declaration:
// void _led_off(void);
//
// Purpose:
// Turns off the happy-light led on the fpga board.
//
// Arguments:
// None.
//
// Return:
// None.
//
// Since:
// MinimOS-2.0
//------------------------------------------------------------------------------
#define _led_off() {x_gpioa_dir|=kbm_gpio0;_lo(kbm_gpio0);}
#endif
//------------------------------------------------------------------------------
// prototypes
void ramtest(void) reentrant;
void dbg_loadram(uint8, uint8, uint16) reentrant;
void dbg_dumpram(uint8, uint8, uint16) reentrant;
void dbg_trigger(void) reentrant;
void dbg_bufferstat(void) reentrant;
void dbg_dump_all_sfr(void) reentrant;
void dbg_dump_sfr(uint8 addr) reentrant;
uint8 dbg_sfr_register_rd(uint8 addr) reentrant;
void dbg_dump_build_settings(void);
void yop(void);
void dbg_zeroram(uint8, uint8, uint16) reentrant;
//---eof------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -