📄 type.h
字号:
/*------------------------------------------------------------------------------------------------------------------
* type.h --
*
*
*
------------------------------------------------------------------------------------------------------------------*/
#ifndef __H_TYPE__
#define __H_TYPE__
//为了C++语言中兼容。
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------------------------------------------
* 重新定义结构类型
---------------------------------------------------------------------------------------------------------------*/
#ifndef u32
#define u32 unsigned int
#endif
#ifndef u16
#define u16 unsigned short
#endif
#ifndef u8
#define u8 unsigned char
#endif
#ifndef s32
#define s32 int
#endif
#ifndef s16
#define s16 short int
#endif
#ifndef s8
#define s8 signed char
#endif
#ifndef False
#define False 0
#endif
#ifndef True
#define True (!False)
#endif
/*---------------------------------------------------------------------------------------------------------------
* Sets or clr the result on bPort
---------------------------------------------------------------------------------------------------------------*/
#define BIT_SET(bPort, bBitMask) (bPort |= bBitMask)
#define BIT_CLR(bPort, bBitMask) (bPort &= bBitMask)
/*---------------------------------------------------------------------------------------------------------------
* Returns the result
---------------------------------------------------------------------------------------------------------------*/
#define GET_BIT_SET(bPort, bBitMask) (bPort | bBitMask)
#define GET_BIT_CLR(bPort, bBitMask) (bPort & ~bBitMask)
/*---------------------------------------------------------------------------------------------------------------
* Returns 0 if the condition is False & a non-zero value if is True
---------------------------------------------------------------------------------------------------------------*/
#define TEST_BIT_SET(bPort, bBitMask) (bPort & bBitMask)
#define TEST_BIT_CLR(bPort, bBitMask) ((~bPort) & bBitMask)
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -