datatype.h
来自「配合高频信号发生器和遥控器」· C头文件 代码 · 共 69 行
H
69 行
/***************************************************通用数据类型定义***************************************************/#ifndef _DATATYPE_H_#define _DATATYPE_H_#include <pic.h> #ifndef uchar typedef unsigned char byte; #define uchar byte #endif #ifndef schar typedef signed char sbyte; #define schar sbyte #endif #ifndef word typedef unsigned int uint; #define word uint #endif #ifndef ulong typedef unsigned long int ulong; #endif#define TRUE 1#define FALSE 0#define ON 1#define OFF 0#define BIT_TEST( x, y) (( (x) & (1<<(y))) != 0)typedef union { uchar byte; struct { //位0~位7 unsigned b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; }bits;}ByteTyp;//单字typedef union { uint w; struct{ uchar bl; //低字节 uchar bh; //高字节 }lhbyte;}WORD;//双字typedef union { ulong dw; struct{ uint dwl; //低字 uint dwh; //高字 }lhword;}DWORD;//四字typedef union { struct{ DWORD fbl; //低2字 DWORD fbh; //高2字 }lhdword; }FWORD;#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?