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

📄 macro.h

📁 非常实用的AD和pwm的ad公司21990dsp芯片的控制源代码
💻 H
字号:
/****************************************************************************************
*                                                                                      *
* Application: General Purpose Mocro File                                              *
*                                                                                      *
* File: Macro.h                                                                        *
*                                                                                      *
* Description: Macro Include File                                                      *
* Purpose    : Define Macros for Commonly Needed Tasks                                 *
*                                                                                      *
* Author     : KU                                                                      *
* Version    : 1.0                                                                     *
* Date       : January 2000                                                            *
* Modification History:    None                                                        *
*                                                                                      *
* Embedded Control Systems                                                             *
* Analog Devices Inc.                                                                  *
****************************************************************************************/

#ifndef MACRO_INCLUDE
#define MACRO_INCLUDE

.extern PUT_VECTOR;
/****************************************************************************************
*                                                                                      *
* Type: Macro                                                                          *
*                                                                                      *
* Call: Set_InterruptVector(Vector_Address, Address_ServiceRoutine)                    *
*                                                                                      *
* Initialize an Inturrupt vector Address                                               *
*                                                                                      *
* Inputs  :%0: Constant or absolute address of Interrupt Vector                        *
* 	   %1: Constant or absolute address of corresponding Interrupt Service Routine *
*                                                                                      *
* Ouputs  :None                                                                        *
*                                                                                      *
* Modified:I4, AX1, AY0, AR, MR0, SR, PX                                               *
*                                                                                      *
****************************************************************************************/
	#define Set_InterruptVector(vector, ISRaddr) \
		I4 = vector; \
		MR0 =ISRaddr; \
		CALL PUT_VECTOR



/****************************************************************************************
*                                                                                      *
* Type: Macro                                                                          *
*                                                                                      *
* Call: Write_DM(DM_Address, Value)                                                    *
*                                                                                      *
* Copy Register contents to specified DM location                                      *
*                                                                                      *
* Inputs  :   	%0: Constant or absolute address of data memory location               *
* 		%1: Value to be written to memory                                      *
*                                                                                      *
* Ouputs  :	None                                                                   *
*                                                                                      *
* Modified:	AR                                                                     *
*                                                                                      *
****************************************************************************************/
	#define Write_DM(addr,val) \
    		ar = val; \
		dm(addr)=AR


/****************************************************************************************
*                                                                                      *
* Type: Macro                                                                          *
*                                                                                      *
* Call: Copy_DM(DM_Address, Value)                                                     *
*                                                                                      *
* Copy one data memory location to another address                                     *
*                                                                                      *
* Inputs  :   	%0: Constant or absolute address of source data memory location        *
* 		%1: Constant or absolute address of destination data memory location   *
*                                                                                      *
* Ouputs  :	None                                                                   *
*                                                                                      *
* Modified:	AR                                                                     *
*                                                                                      *
****************************************************************************************/
/*	
	.MACRO Copy_dm(%0,%1);
    		ar=dm(%0);
		dm(%1)=ar;
	.ENDMACRO;
*/

/****************************************************************************************
*                                                                                      *
* Type: Macros for bit operations on data memory locations                             *
*                                                                                      *
* Call: XXXX_bit_DM(DM_Address , Bit_Position)                                         *
*                                                                                      *
* Macros for Set Bit, Clear Bit, Test Bit and Toggle Bit Operations                    *
*                                                                                      *
* Inputs  :   	src: Constant or absolute address of data memory location               *
* 		pos: Position of bit to be set, cleared, tested or toggled (0-15)       *
*                                                                                      *
* Ouputs  :	None, ASTAT for TGL_bit_DM                                             *
*                                                                                      *
* Modified:	AR, ASTAT                                                              *
*                                                                                      *
****************************************************************************************/
#define Set_Bit_DM(src,pos) \
    ar=dm(src); \
    ar= setbit pos of ar; \
    dm(src)=ar


#define Clear_Bit_DM(src,pos) \
    ar=dm(src); \
    ar= clrbit pos of ar; \
    dm(src)=ar


#define Test_Bit_DM(src,pos) \
    ar=dm(src); \
    ar= tstbit pos of ar


#define Toggle_Bit_DM(src,pos) \
    ar=dm(src); \
    ar= tglbit pos of ar; \
    dm(src)=ar



/****************************************************************************************
*                                                                                      *
* Type: Macros for conditional branches                                                *
*                                                                                      *
* Call: if_xxx_Jump(Jump_Address)                                                      *
*                                                                                      *
* Inputs  :   	%0: Constant or absolute address of jump                               *
*                                                                                      *
* Ouputs  :	None                                                                   *
*                                                                                      *
* Modified:	None                                                                   *
*                                                                                      *
****************************************************************************************/
/* .MACRO if_Set_Jump(%0);
    if NE jump %0;
.ENDMACRO;

.MACRO if_Clr_Jump(%0);
    if EQ jump %0;
.ENDMACRO;

.MACRO If_Gtr_Jump(%0);
    if GT jump %0;
.ENDMACRO;
*/
#endif

⌨️ 快捷键说明

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