common.h

来自「s32410串口demo, 开发工具ads1.2,实现串口通信.」· C头文件 代码 · 共 25 行

H
25
字号
#define  NULL 0
typedef char    BYTE;   /* byte */
typedef short   HWORD;  /* half word */
typedef long    WORD;   /* word */
typedef unsigned char   UBYTE;  /* unsigned byte */
typedef unsigned short  UHWORD; /* unsigned half word */
typedef unsigned long   UWORD;  /* unsigned word */
typedef unsigned char   u8;
typedef unsigned short  u16;
typedef unsigned long   u32;

#define get_value(n)    (*((volatile UBYTE *)(n)))          /* byte input */
#define put_value(n,c)  (*((volatile UBYTE *)(n)) = (c))    /* byte output */
#define get_hvalue(n)   (*((volatile UHWORD *)(n)))         /* half word input */
#define put_hvalue(n,c) (*((volatile UHWORD *)(n)) = (c))   /* half word output */
#define get_wvalue(n)   (*((volatile UWORD *)(n)))          /* word input */
#define put_wvalue(n,c) (*((volatile UWORD *)(n)) = (c))    /* word output */
#define set_bit(n,c)    (*((volatile UBYTE *)(n))|= (c))    /* byte bit set */
#define clr_bit(n,c)    (*((volatile UBYTE *)(n))&=~(c))    /* byte bit clear */
#define set_hbit(n,c)   (*((volatile UHWORD *)(n))|= (c))   /* half word bit set */
#define clr_hbit(n,c)   (*((volatile UHWORD *)(n))&=~(c))   /* half word bit clear */
#define set_wbit(n,c)   (*((volatile UWORD *)(n))|= (c))    /* word bit set */
#define clr_wbit(n,c)   (*((volatile UWORD *)(n))&=~(c))    /* word bit clear */

⌨️ 快捷键说明

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