📄 iomacro.h
字号:
__near __no_init volatile union { \
unsigned char _NAME; /* The sfrb as 1 byte */ \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) \
}; \
} @ _ADDR;
#define SFR_B_BITS_EXT_IO(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H) \
__ext_io union { \
unsigned char _NAME; /* The sfrb as 1 byte */ \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) \
}; \
} @ _ADDR;
#define SFR_B_BITS_EXT_N(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) \
__near __no_init volatile union { \
unsigned char _NAME; /* The sfrb as 1 byte */ \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) \
}; \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) \
}; \
} @ _ADDR;
#define SFR_B_BITS_EXT_IO_N(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) \
__ext_io union { \
unsigned char _NAME; /* The sfrb as 1 byte */ \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) \
}; \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) \
}; \
} @ _ADDR;
#define DATA_SFR_B_BITS(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H) \
__no_init volatile union { \
unsigned char _NAME; /* The sfrb as 1 byte */ \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) \
}; \
} @ _ADDR;
#define DATA_SFR_B_BITS_N(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) \
__no_init volatile union { \
unsigned char _NAME; /* The sfrb as 1 byte */ \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) \
}; \
struct { /* The sfrb as 8 bits */ \
__BYTEBITS(_NAME, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) \
}; \
} @ _ADDR;
#define DATA_SFR_W_BITS(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, _I,_J,_K,_L,_M,_N,_O,_P) \
__no_init volatile union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAME ## L; \
unsigned char _NAME ## H; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAME ## L, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## H, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define SFR_W_BITS(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, _I,_J,_K,_L,_M,_N,_O,_P) \
__io union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAME ## L; \
unsigned char _NAME ## H; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAME ## L, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## H, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define SFR_W_BITS_BYTENAME(_NAME, _NAMEL,_NAMEH, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, \
_I,_J,_K,_L,_M,_N,_O,_P) \
__io union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAMEL; \
unsigned char _NAMEH; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAMEL, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAMEH, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define DATA_SFR_W_BITS_BYTENAME(_NAME, _NAMEL,_NAMEH, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, \
_I,_J,_K,_L,_M,_N,_O,_P) \
__no_init volatile union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAMEL; \
unsigned char _NAMEH; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAMEL, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAMEH, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define SFR_W_BITS_EXT_IO(_ADDR, _NAME, _A,_B,_C,_D,_E,_F,_G,_H, _I,_J,_K,_L,_M,_N,_O,_P) \
__ext_io union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAME ## L; \
unsigned char _NAME ## H; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAME ## L, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## H, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define SFR_W_BITS_EXT_IO_BYTENAME(_ADDR, _NAME, _NAMEL,_NAMEH, _A,_B,_C,_D,_E,_F,_G,_H, _I,_J,_K,_L,_M,_N,_O,_P) \
__ext_io union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAMEL; \
unsigned char _NAMEH; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAMEL, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAMEH, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define SFR_W_BITS_N(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, _I,_J,_K,_L,_M,_N,_O,_P, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2, \
_I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) \
__io union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAME ## L; \
unsigned char _NAME ## H; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAME ## L, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## H, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAME ## L, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## H, _I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) /* Bit names defined by user */ \
}; \
} @ _ADDR;
#define DATA_SFR_W_BITS_N(_NAME, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, _I,_J,_K,_L,_M,_N,_O,_P, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2, \
_I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) \
__no_init volatile union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAME ## L; \
unsigned char _NAME ## H; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAME ## L, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## H, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAME ## L, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## H, _I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) /* Bit names defined by user */ \
}; \
} @ _ADDR;
#define SFR_W_BITS_N_BYTENAME(_NAME, _NAMEL,_NAMEH, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, \
_I,_J,_K,_L,_M,_N,_O,_P, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2, \
_I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) \
__io union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAMEL; \
unsigned char _NAMEH; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAMEL, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAMEH, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAMEL, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) /* Bit names defined by user */ \
__BYTEBITS(_NAMEH, _I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) /* Bit names defined by user */ \
}; \
} @ _ADDR;
#define DATA_SFR_W_BITS_N_BYTENAME(_NAME, _NAMEL,_NAMEH, _ADDR, _A,_B,_C,_D,_E,_F,_G,_H, \
_I,_J,_K,_L,_M,_N,_O,_P, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2, \
_I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) \
__no_init volatile union { \
unsigned short _NAME; /* The sfrw as 1 short */ \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A,_B,_C,_D,_E,_F,_G,_H) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I,_J,_K,_L,_M,_N,_O,_P) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 16 bits */ \
__BYTEBITS(_NAME, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) /* Bit names defined by user */ \
}; \
struct { /* The sfrw as 2 bytes */ \
unsigned char _NAMEL; \
unsigned char _NAMEH; \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAMEL, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAMEH, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
struct { /* The sfrw as 2 x 8 bits */ \
__BYTEBITS(_NAMEL, _A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2) /* Bit names defined by user */ \
__BYTEBITS(_NAMEH, _I2,_J2,_K2,_L2,_M2,_N2,_O2,_P2) /* Bit names defined by user */ \
}; \
} @ _ADDR;
#define SFR_L_BITS(_NAME, _ADDR, \
_B0, _B1, _B2, _B3, _B4, _B5, _B6, _B7, \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -