target.h

来自「完整的TCP/IP源代码,绝对好用」· C头文件 代码 · 共 109 行

H
109
字号
#ifndef target_h
#define target_h
//#define f44m    
//#define monitor51

#define    ARP_CACHE_LENGTH    10   // the number of the cache.

typedef char           INT8;    /*  1                   1   */
typedef unsigned char  UINT8;   /*  1                   1   */
typedef signed short   INT16;   /*  2                   2   */
typedef unsigned short UINT16;  /*  2                   2   */
typedef signed long    INT32;   /*  4                   4   */
typedef unsigned long  UINT32;  /*  4                   4   */
typedef union 
{
      unsigned long i;
	  struct
	  {
        unsigned char cha1;
		unsigned char cha2;
		unsigned char cha3;
		unsigned char cha4;
 	  } character;
} long_type;
typedef union 
{
      unsigned int i;
	  struct
	  {
        unsigned char cha1;
		unsigned char cha2;
 	  } character;
} INT_type;
typedef union 
{
      unsigned long l;
	  struct
	  {
        unsigned char u8_1;//the MSB
		unsigned char u8_2;
		unsigned char u8_3;
		unsigned char u8_4;//the LSB
 	  } u8;
} long_2_c;

typedef union 
{
      unsigned int i;
	  struct
	  {
        unsigned char u8_1;//the MSB
		unsigned char u8_2;//the LSB
 	  } u8;
} int_2_c;

typedef union 
{
      unsigned char xdata* xptr;
	  struct
	  {
        unsigned char high;//the high-order byte of offset
		unsigned char low;//the low-order byte of offset
 	  } p;
} xptr_2_c;

typedef union 
{
      unsigned char code* cptr;
	  struct
	  {
        unsigned char high;//the high-order byte of offset
		unsigned char low;//the low-order byte of offset
 	  } p;
} cptr_2_c;

typedef union 
{
      void * ptr;
	  struct
	  {
		unsigned char type;//the type of the pointer
        unsigned char high;//the high-order byte of offset
		unsigned char low;//the low-order byte of offset
 	  } p;
} ptr_2_c;

typedef union
{
   unsigned long i;
   struct
   {
     unsigned int int_data1;
     unsigned int int_data2;
   }integer;
}long2int;


#define ADDRLOW8(addr)	(UINT8)(UINT16)(addr)
#define ADDRHIGH8(addr)	(UINT8)(((UINT16)(addr))>>8)

#define ETHER           0x0001   /*  Ethernet hardware type, needs swapping */
#define HARDWARE_TYPE   ETHER

#define FALSE   0
#define TRUE    1

#endif

⌨️ 快捷键说明

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