ARM专辑-152M-pdf.zip
源代码在线查看: basictyp.h
//*************************************************************************
//
// P H I L I P S P R O P R I E T A R Y
//
// COPYRIGHT (c) 1999 BY PHILIPS SINGAPORE.
// -- ALL RIGHTS RESERVED --
//
// File Name: BasicTyp.H
// Author: Hilbert Zhang ZhenYu
// Chew Thing Piao
// Created: Oct. 1 99
// Modified:
// Revision: 0.0
//
//*************************************************************************
//
//*************************************************************************
#ifndef __BASIC_TYPE_H__
#define __BASIC_TYPE_H__
#define IRQL_0
#define IRQL_1
#define OUT
#define IN
//*************************************************************************
// basic typedefs
//*************************************************************************
typedef unsigned char INT8;
typedef unsigned short INT16;
typedef unsigned long INT32;
typedef unsigned char * PINT8;
typedef unsigned short * PINT16;
typedef unsigned long * PINT32;
//typedef bit BOOLEAN;
//#define SFR sfr // 8 bits special function register
//#define SBIT sbit // bit access special function register
//#define DATA data // direct access internal data RAM
//#define IDATA idata // indirect access internal data RAM
//#define XDATA xdata // external access external data RAM
//#define PDATA pdata // paged access external data RAM
//#define CODE code // program code area
//*************************************************************************
// basic typedefs for structures
//*************************************************************************
typedef union {
struct
{
unsigned b0 :1;
unsigned b1 :1;
unsigned b2 :1;
unsigned b3 :1;
unsigned b4 :1;
unsigned b5 :1;
unsigned b6 :1;
unsigned b7 :1;
}bit_;
uint8 char_;
}char_bit,*pchar_bit;
typedef union {
struct
{
unsigned b0 :1;
unsigned b1 :1;
unsigned b2 :1;
unsigned b3 :1;
unsigned b4 :1;
unsigned b5 :1;
unsigned b6 :1;
unsigned b7 :1;
unsigned b8 :1;
unsigned b9 :1;
unsigned b10 :1;
unsigned b11 :1;
unsigned b12 :1;
unsigned b13 :1;
unsigned b14 :1;
unsigned b15 :1;
}bit_;
uint16 uint_;
}uint_bit,*puint_bit;
typedef union {
struct
{
INT8 Index;
INT8 Type;
} Descriptor;
struct
{
INT8 tx0;
INT8 tx1;
INT8 endp;
INT8 c0;
} chars;
struct
{
INT8 c0; // LSB for 8051 Keil C
INT8 c1;
INT8 c2;
INT8 c3; // MSB for 8051 Keil C
} chars0;
struct
{
INT16 i0; // LSW for 8051 Keil C
INT16 i1; // MSW for 8051 keil C
} ints;
INT32 u0;
} FLEXI_INT32; //
typedef union {
struct
{
INT8 c1; // MSB for 8051 Keil C
INT8 c0; // LSB for 8051 Keil C
} chars;
INT16 i0;
} FLEXI_INT16, * PFLEXI_INT16;
//#define DATA_SEG data
//#define BDATA_SEG bdata
//#define IDATA_SEG idata
//#define XDATA_SEG xdata
#ifdef GLOBAL_EXT //*************
//#define BIT_EXT sbit
#define STRUC_EXT
#define INT8_EXT INT8
#define INT16_EXT INT16
#define INT32_EXT INT32
#else //*************
//#define BIT_EXT extern bit
#define STRUC_EXT extern
#define INT8_EXT extern INT8
#define INT16_EXT extern INT16
#define INT32_EXT extern INT32
#endif
#endif