📄 iomacro.h
字号:
_B8, _B9, _B10, _B11, _B12, _B13, _B14, _B15, \
_B16, _B17, _B18, _B19, _B20, _B21, _B22, _B23, \
_B24, _B25, _B26, _B27, _B28, _B29, _B30, _B31) \
__io union { \
unsigned long _NAME; /* The sfr as 1 long */ \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, _B0, _B1, _B2, _B3, _B4, _B5, _B6, _B7) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B8, _B9, _B10, _B11, _B12, _B13, _B14, _B15) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B16, _B17, _B18, _B19, _B20, _B21, _B22, _B23) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B24, _B25, _B26, _B27, _B28, _B29, _B30, _B31) /* Bit names defined by user */ \
}; \
struct { /* The sfr as 4 bytes */ \
unsigned char _NAME ## 0; \
unsigned char _NAME ## 1; \
unsigned char _NAME ## 2; \
unsigned char _NAME ## 3; \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 1, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 2, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 3, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define SFR_L_BITS_BYTENAME(_NAME,_NAME0,_NAME1,_NAME2,_NAME3,_ADDR,_STRUCT) \
__io union { \
unsigned long _NAME; /* The sfr as 1 long */ \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names defined by user */ \
__BYTEBITS(_NAME, Bit8,Bit9,Bit10,Bit11,Bit12,Bit13,Bit14,Bit15) /* Bit names defined by user */ \
__BYTEBITS(_NAME, Bit16,Bit17,Bit18,Bit19,Bit20,Bit21,Bit22,Bit23) /* Bit names defined by user */ \
__BYTEBITS(_NAME, Bit24,Bit25,Bit26,Bit27,Bit28,Bit29,Bit30,Bit31) /* Bit names defined by user */ \
}; \
struct { /* The sfr as 4 bytes */ \
unsigned char _NAME0; \
unsigned char _NAME1; \
unsigned char _NAME2; \
unsigned char _NAME3; \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME0, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME1, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME2, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME3, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
_STRUCT \
} @ _ADDR;
#define DATA_SFR_L_BITS(_NAME, _ADDR, \
_B0, _B1, _B2, _B3, _B4, _B5, _B6, _B7, \
_B8, _B9, _B10, _B11, _B12, _B13, _B14, _B15, \
_B16, _B17, _B18, _B19, _B20, _B21, _B22, _B23, \
_B24, _B25, _B26, _B27, _B28, _B29, _B30, _B31) \
__no_init volatile union { \
unsigned long _NAME; /* The sfr as 1 long */ \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, _B0, _B1, _B2, _B3, _B4, _B5, _B6, _B7) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B8, _B9, _B10, _B11, _B12, _B13, _B14, _B15) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B16, _B17, _B18, _B19, _B20, _B21, _B22, _B23) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B24, _B25, _B26, _B27, _B28, _B29, _B30, _B31) /* Bit names defined by user */ \
}; \
struct { /* The sfr as 4 bytes */ \
unsigned char _NAME ## 0; \
unsigned char _NAME ## 1; \
unsigned char _NAME ## 2; \
unsigned char _NAME ## 3; \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 1, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 2, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 3, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define DATA_SFR_L_BITS_BYTENAME(_NAME,_NAME0,_NAME1,_NAME2,_NAME3,_ADDR,_STRUCT) \
__no_init volatile union { \
unsigned long _NAME; /* The sfr as 1 long */ \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names defined by user */ \
__BYTEBITS(_NAME, Bit8,Bit9,Bit10,Bit11,Bit12,Bit13,Bit14,Bit15) /* Bit names defined by user */ \
__BYTEBITS(_NAME, Bit16,Bit17,Bit18,Bit19,Bit20,Bit21,Bit22,Bit23) /* Bit names defined by user */ \
__BYTEBITS(_NAME, Bit24,Bit25,Bit26,Bit27,Bit28,Bit29,Bit30,Bit31) /* Bit names defined by user */ \
}; \
struct { /* The sfr as 4 bytes */ \
unsigned char _NAME0; \
unsigned char _NAME1; \
unsigned char _NAME2; \
unsigned char _NAME3; \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME0, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME1, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME2, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME3, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
_STRUCT \
} @ _ADDR;
#define SFR_L_BITS_EXT_IO(_NAME, _ADDR, \
_B0, _B1, _B2, _B3, _B4, _B5, _B6, _B7, \
_B8, _B9, _B10, _B11, _B12, _B13, _B14, _B15, \
_B16, _B17, _B18, _B19, _B20, _B21, _B22, _B23, \
_B24, _B25, _B26, _B27, _B28, _B29, _B30, _B31) \
__ext_io union { \
unsigned long _NAME; /* The sfr as 1 long */ \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, _B0, _B1, _B2, _B3, _B4, _B5, _B6, _B7) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B8, _B9, _B10, _B11, _B12, _B13, _B14, _B15) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B16, _B17, _B18, _B19, _B20, _B21, _B22, _B23) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _B24, _B25, _B26, _B27, _B28, _B29, _B30, _B31) /* Bit names defined by user */ \
}; \
struct { /* The sfr as 4 bytes */ \
unsigned char _NAME ## 0; \
unsigned char _NAME ## 1; \
unsigned char _NAME ## 2; \
unsigned char _NAME ## 3; \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 1, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 2, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 3, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
} @ _ADDR;
#define SFR_L_BITS_N(_NAME, _ADDR, \
_N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7, \
_N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15, \
_N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23, \
_N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) \
__io union { \
unsigned long _NAME; /* The sfr as 1 long */ \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME, Bit8,Bit9,Bit10,Bit11,Bit12,Bit13,Bit14,Bit15) /* Bit names hard coded to 8-15 */ \
__BYTEBITS(_NAME, Bit16,Bit17,Bit18,Bit19,Bit20,Bit21,Bit22,Bit23) /* Bit names hard coded to 16-23 */ \
__BYTEBITS(_NAME, Bit24,Bit25,Bit26,Bit27,Bit28,Bit29,Bit30,Bit31) /* Bit names hard coded to 24-31 */ \
}; \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, _N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) /* Bit names defined by user */ \
}; \
struct { /* The sfr as 4 bytes */ \
unsigned char _NAME ## 0; \
unsigned char _NAME ## 1; \
unsigned char _NAME ## 2; \
unsigned char _NAME ## 3; \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 1, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 2, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 3, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, _N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 1, _N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 2, _N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 3, _N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) /* Bit names defined by user */ \
}; \
} @ _ADDR;
#define DATA_SFR_L_BITS_N(_NAME, _ADDR, \
_N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7, \
_N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15, \
_N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23, \
_N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) \
__no_init volatile union { \
unsigned long _NAME; /* The sfr as 1 long */ \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME, Bit8,Bit9,Bit10,Bit11,Bit12,Bit13,Bit14,Bit15) /* Bit names hard coded to 8-15 */ \
__BYTEBITS(_NAME, Bit16,Bit17,Bit18,Bit19,Bit20,Bit21,Bit22,Bit23) /* Bit names hard coded to 16-23 */ \
__BYTEBITS(_NAME, Bit24,Bit25,Bit26,Bit27,Bit28,Bit29,Bit30,Bit31) /* Bit names hard coded to 24-31 */ \
}; \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, _N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) /* Bit names defined by user */ \
}; \
struct { /* The sfr as 4 bytes */ \
unsigned char _NAME ## 0; \
unsigned char _NAME ## 1; \
unsigned char _NAME ## 2; \
unsigned char _NAME ## 3; \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 1, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 2, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 3, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, _N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 1, _N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 2, _N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 3, _N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) /* Bit names defined by user */ \
}; \
} @ _ADDR;
#define SFR_L_BITS_N_EXT_IO(_NAME, _ADDR, \
_N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7, \
_N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15, \
_N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23, \
_N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) \
__ext_io union { \
unsigned long _NAME; /* The sfr as 1 long */ \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME, Bit8,Bit9,Bit10,Bit11,Bit12,Bit13,Bit14,Bit15) /* Bit names hard coded to 8-15 */ \
__BYTEBITS(_NAME, Bit16,Bit17,Bit18,Bit19,Bit20,Bit21,Bit22,Bit23) /* Bit names hard coded to 16-23 */ \
__BYTEBITS(_NAME, Bit24,Bit25,Bit26,Bit27,Bit28,Bit29,Bit30,Bit31) /* Bit names hard coded to 24-31 */ \
}; \
struct { /* The sfr as 32 bits */ \
__BYTEBITS(_NAME, _N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23) /* Bit names defined by user */ \
__BYTEBITS(_NAME, _N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) /* Bit names defined by user */ \
}; \
struct { /* The sfr as 4 bytes */ \
unsigned char _NAME ## 0; \
unsigned char _NAME ## 1; \
unsigned char _NAME ## 2; \
unsigned char _NAME ## 3; \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 1, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 2, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
__BYTEBITS(_NAME ## 3, Bit0,Bit1,Bit2,Bit3,Bit4,Bit5,Bit6,Bit7) /* Bit names hard coded to 0-7 */ \
}; \
struct { /* The sfr as 4 x 8 bits */ \
__BYTEBITS(_NAME ## 0, _N0, _N1, _N2, _N3, _N4, _N5, _N6, _N7) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 1, _N8, _N9, _N10, _N11, _N12, _N13, _N14, _N15) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 2, _N16, _N17, _N18, _N19, _N20, _N21, _N22, _N23) /* Bit names defined by user */ \
__BYTEBITS(_NAME ## 3, _N24, _N25, _N26, _N27, _N28, _N29, _N30, _N31) /* Bit names defined by user */ \
}; \
} @ _ADDR;
#else
#ifndef __IAR_SYSTEMS_ASM__
/* Special for the icca90 */
/* Byte sized SFRs */
#define SFR_B_BITS(_NAME,_ADDR,_A,_B,_C,_D,_E,_F,_G,_H)\
sfrb _NAME = _ADDR;
#define DATA_SFR_B_BITS(_NAME,_ADDR,_A,_B,_C,_D,_E,_F,_G,_H)\
sfrb _NAME = _ADDR;
#define SFR_B_BITS_EXT(_NAME,_ADDR,_A,_B,_C,_D,_E,_F,_G,_H)\
sfrb _NAME = _ADDR;
#define SFR_B2_BITS(_NAME1,_NAME2,_ADDR,_A,_B,_C,_D,_E,_F,_G,_H)\
sfrb _NAME1 = _ADDR; sfrb _NAME2 = _ADDR;
#define SFR_B_BITS_N(_NAME,_ADDR,_A,_B,_C,_D,_E,_F,_G,_H, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2)\
sfrb _NAME = _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)\
sfrb _NAME = _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)\
sfrb _NAME = _ADDR;
#define SFR_B2_BITS_N(_NAME1,_NAME2,_ADDR,_A,_B,_C,_D,_E,_F,_G,_H, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2)\
sfrb _NAME1 = _ADDR; sfrb _NAME2 = _ADDR;
#define DATA_SFR_B2_BITS_N(_NAME1,_NAME2,_ADDR,_A,_B,_C,_D,_E,_F,_G,_H, \
_A2,_B2,_C2,_D2,_E2,_F2,_G2,_H2)\
sfrb _NAME1 = _ADDR; sfrb _NAME2 = _ADDR;
/* Word sized SFRs */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -