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

📄 compiler.h

📁 ix2-lib-spi-1_2_0.zip源码
💻 H
字号:
/*H**************************************************************************
* NAME:         compiler.h
*----------------------------------------------------------------------------
* Copyright (c) 2002 Atmel.
*----------------------------------------------------------------------------
* RELEASE:      ix2-lib-spi-1_2_0      
* FILE_REV:     1.2     
*----------------------------------------------------------------------------
* PURPOSE:
* This file redefines dedicated KEIL, RAISONANCE and TASKINKG C51/C251
* keywords in order to ensure that any source file can be processed by
* these compilers.
*****************************************************************************/

#ifndef _COMPILER_H_
#define _COMPILER_H_

/*_____ I N C L U D E S ____________________________________________________*/


/*_____ D E C L A R A T I O N S ____________________________________________*/

typedef unsigned char       Uchar;
typedef unsigned int        Uint16;
typedef int                 Int16;
typedef float               Float16;
typedef unsigned long int   Uint32;
typedef long int            Int32;
typedef unsigned char       Bool;


/*_____ M A C R O S ________________________________________________________*/

/* General purpose defines */

/* Constants */
#define FALSE	0
#define TRUE	1
#define OFF     0
#define ON      1
#define CLR     0
#define SET     1

/* Bit and bytes manipulations */
#define LOW(U16)                ((Uchar)U16)
#define HIGH(U16)               ((Uchar)(U16>>8))	
#define TST_BIT_X(addrx,mask) 	(*addrx & mask)
#define SET_BIT_X(addrx,mask)	(*addrx = (*addrx | mask))
#define CLR_BIT_X(addrx,mask) 	(*addrx = (*addrx & ~mask))
#define OUT_X(addrx,value)      (*addrx = value)
#define IN_X(addrx)			    (*addrx)


#ifdef KEIL             /* KEIL compiler */

#define Reentrant(x)    x reentrant
#define Sfr(x,y)		sfr x = y
#define Sfr16(x,y)	    sfr16 x = y
#define Sbit(x,y,z)	    sbit x = y ^ z
#define Interrupt(x,y)	x interrupt y
#define At(x)			_at_ x

#ifdef __C51__          /* C51 Compiler */
#define far  xdata      /* far is for C251 only */  
#endif

#endif                  /* End of KEIL */


#ifdef RAISONANCE       /* RAISONANCE compiler */

#define Reentrant(x)	x reentrant
#define Sfr(x,y)		sfr x = y
#define Sbit(x,y,z)	    sbit x = y ^ z
#define Interrupt(x,y)	x interrupt y
#define At(x)			_at_ x

#ifdef __C51__          /* C51 Compiler */
#define far  xdata      /* far is for 251 only */
#endif

#endif                  /* End of RAISONANCE */


#ifdef TASKING          /* TASKING compiler */

#include <keil.h>       /* Include Tasking / Keil compatibility header file */ 

#define far 			_far
#define Reentrant(x)	_reentrant x
#define Sfr(x,y)		_sfrbyte x _at(y)
#define Sbit(x,y,z)	    _sfrbit x _atbit(y,z)
#define Interrupt(x,y)	_interrupt(y) x

#endif                  /* End of TASKING */


#endif /* _COMPILER_H_ */

⌨️ 快捷键说明

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