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

📄 general.h

📁 智能水表程序 来着互联网
💻 H
字号:
#ifndef _GENERAL_H_
#define _GENERAL_H_

//-----------------------------------------------------------------------------
// Common Constant Define
//-----------------------------------------------------------------------------
#define  TRUE          1
#define  FALSE         0
#define  OK            1
#define  ERROR         0
#define  ON            1
#define  OFF           0
#define  HIGH          1
#define  LOW           0
#define  OPEN          1
#define  CLOSE         0
#define  STOP          1
#define  START         0
#define  ZERO          0
#define  CLEAR         0
	#ifndef  NULL
#define  NULL          0xFFFF
	#endif
#define  MSB           0x80
#define  LSB           0x01
#define  CR            0x0D
#define  LF            0x0A
#define  SPACE         ' '
#define  ASCII_MASK    '0'
#define  WRITE         0x00
#define  READ          0x01
//-----------------------------------------------------------------------------
// Type Constant Define
//-----------------------------------------------------------------------------
#define  BYTE          unsigned char
#define  UCHAR         unsigned char
#define  UINT          unsigned int
#define  ULONG         unsigned long
#define  CHAR          char
#define  INT           int
#define  WORD          int
//-----------------------------------------------------------------------------
// Structures, Unions, Enumerations, and Type definitions
//-----------------------------------------------------------------------------
typedef union _ULong {
   long Long;
   unsigned int UInt[2];
   unsigned char Char[4];
} ULong;

typedef union _UInt {
   unsigned int UInt;
   unsigned char Char[2];
} UInt;
//-----------------------------------------------------------------------------
// Common Function definitions
//-----------------------------------------------------------------------------
#define _toLower(c)    ((c)-'A'+'a' )
#define _toUpper(c)    ((c)-'a'+'A' )
#define _toAscii(c)    ((c) & 0x7F  )

#define MSBYTE(word)   (BYTE)((WORD)(word) >> 8)
#define LSBYTE(word)   (BYTE)(WORD)(word)
#define MSHALF(char)   (BYTE)(((char) >> 4) & 0x0f)
#define LSHALF(char)   (BYTE)((char) & 0x0f)


#endif
  

⌨️ 快捷键说明

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